Rhaya
rhayarealmwiki
https://rhayarealm.miraheze.org/wiki/Main_Page
MediaWiki 1.41.0
first-letter
Media
Special
Talk
User
User talk
Rhaya
Rhaya talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Module
Module talk
Template:Infobox settlement
10
2
2
2021-06-05T23:18:03Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement]]
wikitext
text/x-wiki
{{#if:{{#invoke:String|match|{{#invoke:Plain text|main|{{{settlement_type|{{{type|}}}}}}}}|{{#invoke:Plain text|main|{{{subdivision_name|}}}}}|plain=true|ignore_errors=1}}{{#if:{{{subdivision_name1|}}}|{{#invoke:String|match|{{#invoke:Plain text|main|{{{settlement_type|{{{type|}}}}}}}}|{{#invoke:Plain text|main|{{{subdivision_name1|}}}}}|plain=true|ignore_errors=1}}}}|[[Category:Infobox settlement pages with bad settlement type]]}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| bodyclass = geography vcard
| bodystyle = width:23em
| headerstyle = text-align:left
| abovestyle = font-size:1.25em; white-space:nowrap
| {{#ifeq:{{yesno|{{{embed|}}}}}|yes|title|above}} = {{#ifeq:{{yesno|{{{embed|}}}}}|yes|
|<span class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</span>
}}{{#if:{{{native_name|}}}|<br /><span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}{{#if:{{{other_name|}}}|<br /><span class="nickname" style="font-size:78%">{{{other_name}}}</span>}}
<!--** names, type, and transliterations ** -->
| subheaderstyle = background-color:#cddeff; font-weight:bold;
| subheader = {{#if:{{both|{{{name|}}}{{{official_name|}}}{{#ifeq:{{yesno|{{{embed|}}}}}|yes|1}}|{{{settlement_type|{{{type|}}}}}}}}|<span class="category">{{{settlement_type|{{{type}}}}}}</span>}}
| rowclass1 = mergedtoprow
| rowcellstyle1 = font-weight:bold;
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
<!--| rowcellstyle18 = padding:0.7em 0.8em-->
| data18 = {{#if:{{{image_skyline|}}}{{{image|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{#if:{{{image_skyline|}}}|{{{image_skyline}}}|{{{image|}}}}}|size={{{image_size|{{{imagesize|}}}}}}|sizedefault=250px|alt={{{image_alt|{{{alt|}}}}}}|title={{{image_caption|{{{caption|Skyline of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}}}}{{#if:{{{image_caption|{{{caption|}}}}}}|<div>{{{image_caption|{{{caption|}}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</small>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</small>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</small>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}|Logo}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</small>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br />{{{map_caption}}}}} }}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}|Nickname(s): <span class="nickname">{{{nickname}}}</span>}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}|Motto(s): {{{motto}}} }}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{motto|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|Anthem: {{{anthem}}} }}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br /><small>{{{map_caption}}}</small>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<br /><small>{{{map_caption1}}}</small>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:Coordinates|coordinsert|{{{coordinates|}}}|type:city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{{population_total}}}|R}})}}}}|{{#if:{{{subdivision_name|}}}|region:{{Country abbreviation|{{{subdivision_name}}}|{{{subdivision_name1|{{{subdivision_name2|{{{subdivision_name3|}}}}}}}}} }} }} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{ifempty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = {{#if:{{{seat|}}}{{{seat1|}}}|mergedrow|mergedtoprow}}
| label49 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data49 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass50 = mergedtoprow
| header50 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<span style="font-weight:normal">{{{government_footnotes|}}}</span>}}
<!-- ***Government*** -->
| rowclass51 = mergedrow
| label51 = • Type
| data51 = {{{government_type|}}}
| rowclass52 = mergedrow
| label52 = • Body
| class52 = agent
| data52 = {{{governing_body|}}}
| rowclass53 = mergedrow
| label53 = • {{{leader_title}}}
| data53 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass54 = mergedrow
| label54 = • {{{leader_title1}}}
| data54 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title2}}}
| data55 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title3}}}
| data56 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title4}}}
| data57 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass58 = mergedtoprow
| header58 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<span style="font-weight:normal">{{{area_footnotes|}}}</span>
}}
}}
| rowclass59 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label59 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<span style="font-weight:normal">{{{area_footnotes|}}}</span>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data59 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
|mag ={{{area_magnitude|}}}
}}}}
| rowclass60 = mergedrow
| label60 = • Land
| data60 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass61 = mergedrow
| label61 = • Water
| data61 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}%}}}}
| rowclass62 = mergedrow
| label62 = • Urban<span style="font-weight:normal">{{{area_urban_footnotes|}}}</span>
| data62 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass63 = mergedrow
| label63 = • Rural<span style="font-weight:normal">{{{area_rural_footnotes|}}}</span>
| data63 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass64 = mergedrow
| label64 = • Metro<span style="font-weight:normal">{{{area_metro_footnotes|}}}</span>
| data64 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass65 = mergedrow
| label65 = Area rank
| data65 = {{{area_rank|}}}
| rowclass66 = mergedrow
| label66 = • {{{area_blank1_title}}}
| data66 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass67 = mergedrow
| label67 = • {{{area_blank2_title}}}
| data67 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 =
| data68 = {{#if:{{{area_note|}}}|<small>{{{area_note}}}</small>}}
<!-- ***Dimensions*** -->
| rowclass69 = mergedtoprow
| header69 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<span style="font-weight:normal">{{{dimensions_footnotes|}}}</span>}}
| rowclass70 = mergedrow
| label70 = • Length
| data70 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass71 = mergedrow
| label71 = • Width
| data71 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass72 = mergedtoprow
| label72 = Elevation<span style="font-weight:normal">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</span>
| data72 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass73 = mergedtoprow
| label73 = Highest elevation<span style="font-weight:normal">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</span>
| data73 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass74 = mergedrow
| label74 = • Rank
| data74 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass75 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label75 = Lowest elevation<span style="font-weight:normal">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</span>
| data75 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass76 = mergedrow
| label76 = • Rank
| data76 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass77 = mergedtoprow
| label77 = Population <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
| data77 = {{#if:{{{population|}}}
| {{formatnum:{{{population}}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass78 = mergedtoprow
| header78 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
}}
}}
}}
| rowclass79 = mergedrow
| label79 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data79 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass80 = mergedrow
| label80 = • Estimate <span style="font-weight:normal">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</span>
| data80 = {{#if:{{{population_est|}}}|{{formatnum:{{{population_est}}}}} }}
<!-- ***Population rank*** -->
| rowclass81 = mergedrow
| label81 = • Rank
| data81 = {{{population_rank|}}}
| rowclass82 = mergedrow
| label82 = • Density
| data82 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass83 = mergedrow
| label83 = • Density rank
| data83 = {{{population_density_rank|}}}
| rowclass84 = mergedrow
| label84 = • [[Urban area|Urban]]<span style="font-weight:normal">{{{population_urban_footnotes|}}}</span>
| data84 = {{#if:{{{population_urban|}}}| {{formatnum:{{{population_urban}}}}} }}
| rowclass85 = mergedrow
| label85 = • Urban density
| data85 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass86 = mergedrow
| label86 = • [[Rural area|Rural]]<span style="font-weight:normal">{{{population_rural_footnotes|}}}</span>
| data86 = {{#if:{{{population_rural|}}}|{{formatnum:{{{population_rural}}}}}}}
| rowclass87 = mergedrow
| label87 = • Rural density
| data87 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass88 = mergedrow
| label88 = • [[Metropolitan area|Metro]]<span style="font-weight:normal">{{{population_metro_footnotes|}}}</span>
| data88 = {{#if:{{{population_metro|}}}| {{formatnum:{{{population_metro}}}}} }}
| rowclass89 = mergedrow
| label89 = • Metro density
| data89 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass90 = mergedrow
| label90 = • {{{population_blank1_title|}}}<span style="font-weight:normal">{{{population_blank1_footnotes|}}}</span>
| data90 = {{#if:{{{population_blank1|}}}|{{formatnum:{{{population_blank1}}}}}}}
| rowclass91 = mergedrow
| label91 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data91 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass92 = mergedrow
| label92 = • {{{population_blank2_title|}}}<span style="font-weight:normal">{{{population_blank2_footnotes|}}}</span>
| data92 = {{#if:{{{population_blank2|}}}|{{formatnum:{{{population_blank2}}}}}}}
| rowclass93 = mergedrow
| label93 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data93 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 =
| data94 = {{#if:{{{population_note|}}}|<small>{{{population_note}}}</small>}}
| rowclass95 = mergedtoprow
| label95 = [[Demonym|Demonym(s)]]
| data95 = {{{population_demonym|}}}
<!-- ***Demographics 1*** -->
| rowclass96 = mergedtoprow
| header96 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<span style="font-weight:normal">{{{demographics1_footnotes|}}}</span>}}
| rowclass97 = mergedrow
| label97 = • {{{demographics1_title1}}}
| data97 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass98 = mergedrow
| label98 = • {{{demographics1_title2}}}
| data98 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{{demographics1_title3}}}
| data99 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass100 = mergedrow
| label100 = • {{{demographics1_title4}}}
| data100 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{{demographics1_title5}}}
| data101 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass102 = mergedrow
| label102 = • {{{demographics1_title6}}}
| data102 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass103 = mergedrow
| label103 = • {{{demographics1_title7}}}
| data103 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<span style="font-weight:normal">{{{demographics2_footnotes|}}}</span>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics2_title1}}}
| data105 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics2_title2}}}
| data106 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics2_title3}}}
| data107 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics2_title4}}}
| data108 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics2_title5}}}
| data109 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics2_title6}}}
| data110 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics2_title7}}}
| data111 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass112 = mergedtoprow
| label112 = {{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}
| data112 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{{timezone1|{{{timezone}}}}}} {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}|([[UTC{{{utc_offset1|{{{utc_offset}}}}}}]])}} }}
| rowclass113 = mergedrow
| label113 = <nowiki />
| data113 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone2|}}}|{{{timezone2}}} {{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}|([[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]])}} }} }}
| rowclass114 = mergedrow
| label114 = <span style="white-space:nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data114 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{{timezone1_DST|{{{timezone_DST|}}}}}} ([[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]])}} }}
| rowclass115 = mergedrow
| label115 = <nowiki />
| data115 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{#if:{{{timezone2_DST|}}}|{{{timezone2_DST}}} ([[UTC{{{utc_offset2_DST|}}}]])}} }} }}
<!-- ***Postal Code(s)*** -->
| rowclass116 = mergedtoprow
| label116 = {{{postal_code_type}}}
| class116 = adr
| data116 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<span class="postal-code">{{{postal_code}}}</span>}}}}
| rowclass117 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label117 = {{{postal2_code_type}}}
| class117 = adr
| data117 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<span class="postal-code">{{{postal2_code}}}</span>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass118 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label118 = {{#if:{{{area_code_type|}}}|{{{area_code_type}}}|[[Telephone numbering plan|Area code(s)]]}}
| data118 = {{{area_code|}}}
<!-- Geocode-->
| rowclass119 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label119 = [[Geocode]]
| class119 = nickname
| data119 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass120 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label120 = [[ISO 3166|ISO 3166 code]]
| class120 = nickname
| data120 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass121 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label121 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data121 = {{{registration_plate|}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass122 = mergedtoprow
| label122 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data122 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass123 = mergedrow
| label123 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data123 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass124 = mergedrow
| label124 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data124 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass125 = mergedrow
| label125 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data125 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass126 = mergedrow
| label126 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data126 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass127 = mergedrow
| label127 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data127 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass128 = mergedrow
| label128 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data128 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass129 = mergedrow
| label129 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data129 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass130 = mergedtoprow
| label130 = {{{blank_name_sec2}}}
| data130 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass131 = mergedrow
| label131 = {{{blank1_name_sec2}}}
| data131 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass132 = mergedrow
| label132 = {{{blank2_name_sec2}}}
| data132 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass133 = mergedrow
| label133 = {{{blank3_name_sec2}}}
| data133 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass134 = mergedrow
| label134 = {{{blank4_name_sec2}}}
| data134 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass135 = mergedrow
| label135 = {{{blank5_name_sec2}}}
| data135 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass136 = mergedrow
| label136 = {{{blank6_name_sec2}}}
| data136 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass137 = mergedrow
| label137 = {{{blank7_name_sec2}}}
| data137 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass138 = mergedtoprow
| label138 = Website
| data138 = {{#if:{{{website|}}}|{{{website}}}}}
<!-- ***Footnotes*** -->
| belowstyle = text-align:left; font-size:smaller
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<includeonly>{{#switch:{{{coordinates_region|}}}|CA-X|US-X|IN-X=[[Category:Infobox settlement uses with imprecise region codes]]
}}{{#if:{{{image_dot_map|}}}{{{dot_mapsize|}}}{{{dot_map_base_alt|}}}{{{dot_map_alt|}}}{{{dot_map_caption|}}}{{{dot_x|}}}{{{dot_y|}}}|[[Category:Pages using infobox settlement with a dot map]]
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_magnitude | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | caption | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_title1 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics2_footnotes | demographics2_info1 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_title1 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes| founder | geocode | governing_body | government_footnotes | government_type | grid_name | grid_position | image | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_skyline | image_size | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | motto | name | named_for | native_name | native_name_lang | nickname | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_link | timezone_DST | timezone1 | timezone1_DST | timezone2 | timezone2_DST | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | website | width_km | width_mi
}}{{#if:{{{image|}}}|[[Category:Pages using infobox settlement with the image parameter|{{#if:{{{image_skyline|}}}|!}}{{PAGENAME}}]]}}{{#if:{{{coordinates_wikidata|}}}{{{wikidata|}}}
|[[Category:Pages using infobox settlement with the wikidata parameter]]
}}<noinclude>
{{Documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
2ce26f650c93944a840d46321669c882adab06f1
Template:Cite GNIS
10
33
64
2021-06-05T23:18:04Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Cite_GNIS]]
wikitext
text/x-wiki
#REDIRECT [[Template:Cite gnis]]
2430ade6b59e4826ea72a59e01c3bf35f25af65c
Template:Cite gnis
10
34
66
2021-06-05T23:18:05Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Cite_gnis]]
wikitext
text/x-wiki
{{#if: {{{1|{{{id|}}}}}}
| {{#if: {{{2|{{{title|{{{name|}}}}}}}}}
| {{cite web
| url = https://geonames.usgs.gov/apex/f?p=gnispq:{{#ifeq: {{{type|}}}|antarid
| 5:::NO::P5_ANTAR_ID:
| 3:::NO::P3_FID:
}}{{urlencode:{{{1|{{{id}}}}}}}}
| title = {{{2|{{{title|{{{name}}}}}}}}}
| access-date = {{{3|{{{access-date|{{{accessdate|}}}}}}}}}
| date = {{{4|{{{date|{{{entry-date|{{{entrydate|}}}}}}}}}}}}
| website = {{#ifeq:{{{links|}}}|off
| Geographic Names Information System
| [[Geographic Names Information System]]}}
| publisher = {{#ifeq:{{{links|}}}|off
| United States Geological Survey
| [[United States Geological Survey]]}}
| ref = {{{ref|}}}
}}
| {{citation error|no {{para|name}} specified|cite gnis|nocat={{{template doc demo|{{{template-doc-demo|}}}}}}}}
}}
| {{citation error|no {{para|id}} specified|cite gnis|nocat={{{template doc demo|{{{template-doc-demo|}}}}}}}}
}}<noinclude>
{{Documentation}}
<!--
PLEASE ADD CATEGORIES TO THE /doc SUBPAGE AND INTERWIKIS TO WIKIDATA
-->
</noinclude>
b02693793d560c0207367b0586788b657824aa04
Template:Cite web
10
35
68
2021-06-05T23:18:05Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Cite_web]]
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</includeonly><noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Cite web}}
</noinclude>
3346631c4b8024c3a949b31545107af19adc1c27
Template:Country abbreviation
10
42
82
2021-06-05T23:18:08Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Country_abbreviation]]
wikitext
text/x-wiki
<includeonly>{{safesubst:#invoke:Country extract|main|{{{1|}}}|{{{2|}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
3045ff36600fb6e40b07a642240a09b7745a03b0
Template:Country data Michigan
10
43
84
2021-06-05T23:18:08Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Country_data_Michigan]]
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Michigan
| flag alias = Flag of Michigan.svg
| flag alias-1836 = Flag of the United States (1836-1837).svg
| flag alias-1837 = Flag of the United States (1837-1845).svg
| flag alias-1845 = Flag of the United States (1845-1846).svg
| flag alias-1846 = Flag of the United States (1846-1847).svg
| flag alias-1847 = Flag of the United States (1847-1848).svg
| flag alias-1848 = Flag of the United States (1848-1851).svg
| flag alias-1851 = Flag of the United States (1851-1858).svg
| flag alias-1858 = Flag of the United States (1858-1859).svg
| flag alias-1859 = Flag of the United States (1859-1861).svg
| flag alias-1861 = Flag of the United States (1861-1863).svg
| flag alias-1863 = Flag of the United States (1863-1865).svg
| flag alias-1865 = Flag of the United States (1865-1867).svg
| flag alias-1867 = Flag of the United States (1867-1877).svg
| flag alias-1877 = Flag of the United States (1877-1890).svg
| flag alias-1890 = Flag of the United States (1890-1891).svg
| flag alias-1891 = Flag of the United States (1891-1896).svg
| flag alias-1896 = Flag of the United States (1896-1908).svg
| flag alias-1908 = Flag of the United States (1908-1912).svg
| flag alias-naval =Flag of the United States.svg
| link alias-army = Michigan Army National Guard
| link alias-air force = Michigan Air National Guard
| link alias-military = Michigan National Guard
| link alias-naval = Michigan Naval Militia
| link alias-navy = Michigan Naval Militia
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1836
| var2 = 1837
| var3 = 1845
| var4 = 1846
| var5 = 1847
| var6 = 1848
| var7 = 1851
| var8 = 1858
| var9 = 1859
| var10 = 1861
| var11 = 1863
| var12 = 1865
| var13 = 1867
| var14 = 1877
| var15 = 1890
| var16 = 1891
| var17 = 1896
| var18 = 1908
</noinclude>
}}
c62d38555019bd89598bf3768af16c88a0ae8f55
Template:FIPS
10
45
88
2021-06-05T23:18:10Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:FIPS]]
wikitext
text/x-wiki
[{{#if:{{{county|}}}{{{3|}}}
|https://factfinder.census.gov/bkmk/table/1.0/en/DEC/10_DP/DPDP1/0600000US{{{state|{{{1}}}}}}{{{county|{{{3}}}}}}{{{place|{{{2}}}}}}
|https://factfinder.census.gov/bkmk/table/1.0/en/DEC/10_DP/DPDP1/1600000US{{{state|{{{1}}}}}}{{{place|{{{2}}}}}}
}} {{{state|{{{1}}}}}}-{{{place|{{{2}}}}}}]<noinclude>
{{Documentation}}
</noinclude>
3d6f50bb4e286e395c7400c3d43bb89b055665e6
Template:GNIS4
10
49
96
2021-06-05T23:18:13Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:GNIS4]]
wikitext
text/x-wiki
#REDIRECT [[Template:GNIS 4]]
{{Rcat shell|{{R from template shortcut}}{{R from spacing}}}}
a79ef13aca2c01823ef938ddff5cd4e39cc695af
Template:GNIS 4
10
50
98
2021-06-05T23:18:13Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:GNIS_4]]
wikitext
text/x-wiki
[https://geonames.usgs.gov/apex/f?p=gnispq:{{#ifeq:{{{type}}}|antarid|5:::NO::P5_ANTAR_ID:|3:::NO::P3_FID:}}{{#if:1| {{{1| {{{id}}} }}} }} {{{1|{{{id}}}}}}]<noinclude>
{{Documentation}}
</noinclude>
ef2bc358d0a7a3de878ecf5e4ad318f252b9eaab
Template:Infobox settlement/densdisp
10
22
42
2021-06-05T23:18:15Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/densdisp]]
wikitext
text/x-wiki
<includeonly>{{#if:
{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#switch:auto
|{{{/km2}}}|{{{/sqmi}}}={{#iferror:{{#expr:-{{formatnum:{{{pop}}}|R}}}}
||{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}
+0
>0
|1}}
}}
}}
|1
}}
|1
}}
|{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}}}}}}}
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}}}}}}}
}}}}}}}}
|{{rnd
|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}
|{{max/2
|{{precision|{{formatnum:{{{/sqmi}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}}}
}}
}}
}}
|{{{/km2}}}
}}
|metu=km<sup>2</sup>
|impv={{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{rnd|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
}}}}}}}}
|{{rnd
|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}
|{{max/2
|{{#expr:{{precision|{{formatnum:{{{/km2}}}|R}}}}-1}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}}}
}}
}}
}}
|{{{/sqmi}}}
}}
|impu=sq mi
|s=/
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
55905884d3fa7eed2ee5abe53f9d247ac45d5d8e
Template:Infobox settlement/columns
10
24
46
2021-06-05T23:18:15Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/columns]]
wikitext
text/x-wiki
<table style="width:100%; background:none;">
<tr>{{#if:{{{0|}}}
|<!-- if 0
-->{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}
|<!-- if 0 and (1 or 2 or 3 or 4 or 5)
--><td><table style="width:100%; background:none;">
{{#if:{{{1|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{1|}}}</td></tr>
}}{{#if:{{{2|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{2|}}}</td></tr>
}}{{#if:{{{3|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{3|}}}</td></tr>
}}{{#if:{{{4|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{4|}}}</td></tr>
}}{{#if:{{{5|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{5|}}}</td></tr>
}}</table></td>
}}<td style="vertical-align:top;text-align:center;">{{{0|}}}</td>
|<!-- if not 0
-->{{#ifexpr:({{#if:{{{1|}}}|1|0}}+{{#if:{{{2|}}}|1|0}}+{{#if:{{{3|}}}|1|0}}+{{#if:{{{4|}}}|1|0}}) > 2
|<!-- if more than two images
-->{{#if:{{{1|}}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{2|}}}||colspan=2}}>{{{1|}}}</td>
}}{{#if:{{{2|}}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{1|}}}||colspan=2}}>{{{2|}}}</td>
}}</tr><tr>{{#if:{{{3|}}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{4|}}}||colspan=2}}>{{{3|}}}</td>
}}{{#if:{{{4| }}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{3|}}}||colspan=2}}>{{{4|}}}</td>
}}
|<!-- if two or fewer images
-->{{#if:{{{1|}}}
|<td style="vertical-align:middle; text-align:center;">{{{1|}}}</td>
}}{{#if:{{{2|}}}
|<td style="vertical-align:middle; text-align:center;">{{{2|}}}</td>
}}{{#if:{{{3|}}}
|<td style="vertical-align:middle; text-align:center;">{{{3|}}}</td>
}}{{#if:{{{4| }}}
|<td style="vertical-align:middle; text-align:center;">{{{4|}}}</td>
}}
}}
}}</tr></table><noinclude>
{{documentation}}
</noinclude>
aa35855300d9811f7770a1acf10c4ce658f84986
Template:Infobox settlement/areadisp
10
51
100
2021-06-05T23:18:15Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/areadisp]]
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}|area}}{{#if:{{{mag|}}}|/mag}}
|metv={{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}|{{{ha}}}|{{{km2}}}}}
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3
|{{rnd<!-- convert dunams to hectares -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/10}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+1)
}}<!-- end rnd -->
|{{rnd<!-- convert dunams to square kilometres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/1E3}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
}}<!-- end rnd -->
}}<!-- end #ifexpr:...{{{dunam}}}...<1E3 -->
|{{#if:{{{acre|}}}
|{{rnd<!-- convert acres to hectares -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}
|{{max/2<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{acre}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
|{{rnd<!-- convert square miles to square kilometres -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #if:{{{acre|}}} -->
}}<!-- end #if:{{{dunam|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
|metu={{#if:{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3|X}}
|{{{acre|}}}
}}
}}
|ha
|km<sup>2</sup>
}}
|impv={{#if:{{{acre|}}}{{{sqmi|}}}
|{{#if:{{{acre|}}}|{{{acre}}}|{{{sqmi}}}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}
|{{rnd<!-- convert hectares to acres -->
|{{#expr:{{formatnum:{{{ha}}}|R}}/0.4046856422}}
|({{precision|{{formatnum:{{{ha}}}|R}}}})
}}<!-- end rnd -->
|{{rnd<!-- convert square kilometres to square miles -->
|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}
|{{max/2<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{km2}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #if:{{{ha|}}} -->
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589
|{{rnd<!-- convert dunams to acres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}})
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
|{{rnd<!-- convert dunams to square miles -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #ifexpr:...{{{dunam}}}...<2589 -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}<!-- end #if:{{{acre|}}}{{{sqmi|}}} -->
|impu={{#if:{{{acre|}}}{{#if:{{{sqmi|}}}
|
|{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589|X}}
}}
}}
|acre
|sq mi
}}
|dunv={{#if:{{#ifeq:{{lc:{{{pref}}}}}|dunam|{{{dunam|}}}|no dunams}}
|{{{dunam}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{km2|}}}
|{{rnd<!-- convert square kilometres to dunams -->
|{{#expr:{{formatnum:{{{km2}}}|R}}*1E3}}
|({{precision|{{formatnum:{{{km2}}}|R}}}}-3)
}}<!-- end rnd -->
|{{rnd<!-- convert hectares to dunams -->
|{{#expr:{{formatnum:{{{ha}}}|R}}*10}}
|({{precision|{{formatnum:{{{ha}}}|R}}}}-1)
}}<!-- end rnd -->
}}<!-- end #if:{{{km2|}}} -->
|{{#if:{{{sqmi|}}}
|{{rnd<!-- convert square miles to dunams -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-4)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
|{{rnd<!-- convert acres to dunams -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{acre}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #if:{{{sqmi|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}
|dunu={{#if:{{{link|}}}|[[dunam]]|dunam}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
095178e0174d43b6499f5a497f99abb7e1214f6c
Template:Infobox settlement/doc
10
52
102
2021-06-05T23:18:16Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/doc]]
wikitext
text/x-wiki
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{Intricate template}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters}}
{{Uses Wikidata|P625}}
This template is aliased or used as a sub-template for several infobox front-end templates. It should be used to produce an [[WP:Infobox|Infobox]] for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, et cetera—in fact, any subdivision below the level of a country, for which {{tl|Infobox country}} should be used. Parameters are described in the table below. For questions, see the [[Template talk:Infobox settlement|talk page]]. For a U.S. city guideline, see [[WP:USCITIES]].
==Usage==
* '''Important''': Please enter all numeric values in a raw, unformatted fashion. References are to be included in their respective section footnotes field. Numeric values that are not "raw" may create an "Expression error". Raw values will be automatically formatted by the template. If you find a raw value is not formatted in your usage of the template, please post a notice on the discussion page for this template.
* An expression error may also occur when any coordinate parameter has a value, but one or more coordinate parameters are blank or invalid.
Basic blank template, ready to cut and paste. See the next section for a copy of the template with all parameters and comments. See the table below that for a full description of each parameter.
===Using metric units===
<pre style="overflow:auto">
{{Infobox settlement
| name =
| native_name =
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| settlement_type =
| image_skyline =
| image_alt =
| image_caption =
| image_flag =
| flag_alt =
| image_seal =
| seal_alt =
| image_shield =
| shield_alt =
| etymology =
| nickname =
| motto =
| image_map =
| map_alt =
| map_caption =
| pushpin_map =
| pushpin_label_position =
| pushpin_map_alt =
| pushpin_map_caption =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint =
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name =
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 =
| subdivision_type3 =
| subdivision_name3 =
| established_title =
| established_date =
| founder =
| seat_type =
| seat =
| government_footnotes =
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name =
| leader_title1 =
| leader_name1 =
| leader_title2 =
| leader_name2 =
| leader_title3 =
| leader_name3 =
| leader_title4 =
| leader_name4 =
| legislature =
| upper_house =
| lower_house =
| unit_pref = Metric
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
| area_footnotes =
| area_urban_footnotes = <!-- <ref> </ref> -->
| area_rural_footnotes = <!-- <ref> </ref> -->
| area_metro_footnotes = <!-- <ref> </ref> -->
| area_magnitude = <!-- <ref> </ref> -->
| area_note =
| area_water_percent =
| area_rank =
| area_blank1_title =
| area_blank2_title =
<!-- square kilometers -->
| area_total_km2 =
| area_land_km2 =
| area_water_km2 =
| area_urban_km2 =
| area_rural_km2 =
| area_metro_km2 =
| area_blank1_km2 =
| area_blank2_km2 =
<!-- hectares -->
| area_total_ha =
| area_land_ha =
| area_water_ha =
| area_urban_ha =
| area_rural_ha =
| area_metro_ha =
| area_blank1_ha =
| area_blank2_ha =
| length_km =
| width_km =
| dimensions_footnotes =
| elevation_footnotes =
| elevation_m =
| population_as_of =
| population_footnotes =
| population_total =
| population_density_km2 = auto
| population_note =
| population_demonym =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| postal_code_type =
| postal_code =
| area_code_type =
| area_code =
| iso_code =
| website = <!-- {{URL|example.com}} -->
| footnotes =
}}
</pre>
===Using non-metric units===
<pre style="overflow:auto">
{{Infobox settlement
| name =
| native_name =
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| settlement_type =
| image_skyline =
| image_alt =
| image_caption =
| image_flag =
| flag_alt =
| image_seal =
| seal_alt =
| image_shield =
| shield_alt =
| etymology =
| nickname =
| motto =
| image_map =
| map_alt =
| map_caption =
| pushpin_map =
| pushpin_label_position =
| pushpin_map_alt =
| pushpin_map_caption =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint =
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name =
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 =
| subdivision_type3 =
| subdivision_name3 =
| established_title =
| established_date =
| founder =
| seat_type =
| seat =
| government_footnotes =
| leader_party =
| leader_title =
| leader_name =
| unit_pref = US<!-- or UK -->
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
| area_footnotes =
| area_urban_footnotes = <!-- <ref> </ref> -->
| area_rural_footnotes = <!-- <ref> </ref> -->
| area_metro_footnotes = <!-- <ref> </ref> -->
| area_magnitude = <!-- use only to set a special wikilink -->
| area_note =
| area_water_percent =
| area_rank =
| area_blank1_title =
| area_blank2_title =
<!-- square miles -->
| area_total_sq_mi =
| area_land_sq_mi =
| area_water_sq_mi =
| area_urban_sq_mi =
| area_rural_sq_mi =
| area_metro_sq_mi =
| area_blank1_sq_mi =
| area_blank2_sq_mi =
<!-- acres -->
| area_total_acre =
| area_land_acre =
| area_water_acre =
| area_urban_acre =
| area_rural_acre =
| area_metro_acre =
| area_blank1_acre =
| area_blank2_acre =
| length_mi =
| width_mi =
| dimensions_footnotes =
| elevation_footnotes =
| elevation_ft =
| population_as_of =
| population_footnotes =
| population_total =
| population_density_sq_mi= auto
| population_note =
| population_demonym =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| postal_code_type =
| postal_code =
| area_code_type =
| area_code =
| iso_code =
| website = <!-- {{URL|example.com}} -->
| footnotes =
}}
</pre>
===Short version===
<pre style="overflow:auto">
{{Infobox settlement
| name =
| native_name =
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| settlement_type =
| image_skyline =
| image_alt =
| image_caption =
| etymology =
| nickname =
| coordinates = <!-- {{Coord}} -->
| population_total =
| subdivision_type = Country
| subdivision_name =
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 =
| website = <!-- {{URL|example.com}} -->
}}
</pre>
===Complete empty syntax, with comments===
This copy of the template lists all parameters except for some of the repeating numbered parameters which are noted in the comments. Comments here should be brief; see the table below for full descriptions of each parameter.
<pre style="overflow:auto;">
{{Infobox settlement
| name = <!-- at least one of the first two fields must be filled in -->
| official_name =
| native_name = <!-- if different from the English name -->
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| other_name =
| settlement_type = <!-- such as Town, Village, City, Borough etc. -->
<!-- transliteration(s) -->
| translit_lang1 =
| translit_lang1_type =
| translit_lang1_info =
| translit_lang1_type1 =
| translit_lang1_info1 =
| translit_lang1_type2 =
| translit_lang1_info2 = <!-- etc., up to translit_lang1_type6 / translit_lang1_info6 -->
| translit_lang2 =
| translit_lang2_type =
| translit_lang2_info =
| translit_lang2_type1 =
| translit_lang2_info1 =
| translit_lang2_type2 =
| translit_lang2_info2 = <!-- etc., up to translit_lang2_type6 / translit_lang2_info6 -->
<!-- images, nickname, motto -->
| image_skyline =
| imagesize =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| flag_alt =
| flag_border =
| flag_link =
| image_seal =
| seal_size =
| seal_alt =
| seal_link =
| seal_type =
| image_shield =
| shield_size =
| shield_alt =
| shield_link =
| image_blank_emblem =
| blank_emblem_type = <!-- defaults to Logo -->
| blank_emblem_size =
| blank_emblem_alt =
| blank_emblem_link =
| etymology =
| nickname =
| motto =
| anthem =
<!-- maps and coordinates -->
| image_map =
| mapsize =
| map_alt =
| map_caption =
| image_map1 =
| mapsize1 =
| map_alt1 =
| map_caption1 =
| pushpin_map = <!-- name of a location map as per Template:Location_map -->
| pushpin_label_position = <!-- position of the pushpin label: left, right, top, bottom, none -->
| pushpin_label = <!-- only necessary if "name" or "official_name" are too long -->
| pushpin_map_alt =
| pushpin_mapsize =
| pushpin_relief =
| pushpin_map_caption =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint = <!-- to specify exact location of coordinates (was coor_type) -->
| coordinates_footnotes = <!-- for references: use <ref> tags -->
| grid_name = <!-- name of a regional grid system -->
| grid_position = <!-- position on the regional grid system -->
<!-- location -->
| subdivision_type = Country
| subdivision_name = <!-- the name of the country -->
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 = <!-- etc., subdivision_type6 / subdivision_name6 -->
<!-- established -->
| established_title = <!-- Founded -->
| established_date =
| established_title1 = <!-- Incorporated (town) -->
| established_date1 =
| established_title2 = <!-- Incorporated (city) -->
| established_date2 =
| established_title3 =
| established_date3 =
| established_title4 =
| established_date4 =
| established_title5 =
| established_date5 =
| established_title6 =
| established_date6 =
| established_title7 =
| established_date7 =
| extinct_title =
| extinct_date =
| founder =
| named_for =
<!-- seat, smaller parts -->
| seat_type = <!-- defaults to: Seat -->
| seat =
| seat1_type = <!-- defaults to: Former seat -->
| seat1 =
| parts_type = <!-- defaults to: Boroughs -->
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = <!-- parts text, or header for parts list -->
| p1 =
| p2 = <!-- etc., up to p50: for separate parts to be listed-->
<!-- government type, leaders -->
| government_footnotes = <!-- for references: use <ref> tags -->
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name = <!-- add &nbsp; (no-break space) to disable automatic links -->
| leader_title1 =
| leader_name1 = <!-- etc., up to leader_title4 / leader_name4 -->
<!-- display settings -->
| total_type = <!-- to set a non-standard label for total area and population rows -->
| unit_pref = <!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = <!-- for references: use <ref> tags -->
| area_magnitude = <!-- use only to set a special wikilink -->
| dunam_link = <!-- If dunams are used, this specifies which dunam to link. -->
| area_total_km2 = <!-- ALL fields with measurements have automatic unit conversion -->
| area_total_sq_mi = <!-- see table @ Template:Infobox settlement for details -->
| area_total_ha =
| area_total_acre =
| area_total_dunam = <!-- used in Middle East articles only -->
| area_land_km2 =
| area_land_sq_mi =
| area_land_ha =
| area_land_acre =
| area_land_dunam = <!-- used in Middle East articles only -->
| area_water_km2 =
| area_water_sq_mi =
| area_water_ha =
| area_water_acre =
| area_water_dunam = <!-- used in Middle East articles only -->
| area_water_percent =
| area_urban_footnotes = <!-- for references: use <ref> tags -->
| area_urban_km2 =
| area_urban_sq_mi =
| area_urban_ha =
| area_urban_acre =
| area_urban_dunam = <!-- used in Middle East articles only -->
| area_rural_footnotes = <!-- for references: use <ref> tags -->
| area_rural_km2 =
| area_rural_sq_mi =
| area_rural_ha =
| area_rural_acre =
| area_rural_dunam = <!-- used in Middle East articles only -->
| area_metro_footnotes = <!-- for references: use <ref> tags -->
| area_metro_km2 =
| area_metro_sq_mi =
| area_metro_ha =
| area_metro_acre =
| area_metro_dunam = <!-- used in Middle East articles only -->
| area_rank =
| area_blank1_title =
| area_blank1_km2 =
| area_blank1_sq_mi =
| area_blank1_ha =
| area_blank1_acre =
| area_blank1_dunam = <!-- used in Middle East articles only -->
| area_blank2_title =
| area_blank2_km2 =
| area_blank2_sq_mi =
| area_blank2_ha =
| area_blank2_acre =
| area_blank2_dunam = <!-- used in Middle East articles only -->
| area_note =
<!-- dimensions -->
| dimensions_footnotes = <!-- for references: use <ref> tags -->
| length_km =
| length_mi =
| width_km =
| width_mi =
<!-- elevation -->
| elevation_footnotes = <!-- for references: use <ref> tags -->
| elevation_m =
| elevation_ft =
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = <!-- for references: use <ref> tags -->
| elevation_max_m =
| elevation_max_ft =
| elevation_max_point = <!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_footnotes = <!-- for references: use <ref> tags -->
| elevation_min_m =
| elevation_min_ft =
| elevation_min_point = <!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_as_of =
| population_footnotes = <!-- for references: use <ref> tags -->
| population_total =
| pop_est_as_of =
| pop_est_footnotes =
| population_est =
| population_rank =
| population_density_km2 = <!-- for automatic calculation of any density field, use: auto -->
| population_density_sq_mi=
| population_urban_footnotes =
| population_urban =
| population_density_urban_km2 =
| population_density_urban_sq_mi =
| population_rural_footnotes =
| population_rural =
| population_density_rural_km2 =
| population_density_rural_sq_mi =
| population_metro_footnotes =
| population_metro =
| population_density_metro_km2 =
| population_density_metro_sq_mi =
| population_density =
| population_density_rank =
| population_blank1_title =
| population_blank1 =
| population_density_blank1_km2 =
| population_density_blank1_sq_mi=
| population_blank2_title =
| population_blank2 =
| population_density_blank2_km2 =
| population_density_blank2_sq_mi=
| population_demonym = <!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
| population_note =
<!-- demographics (section 1) -->
| demographics_type1 =
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title1 =
| demographics1_info1 = <!-- etc., up to demographics1_title5 / demographics1_info5 -->
<!-- demographics (section 2) -->
| demographics_type2 =
| demographics2_footnotes = <!-- for references: use <ref> tags -->
| demographics2_title1 =
| demographics2_info1 = <!-- etc., up to demographics2_title5 / demographics2_info5 -->
<!-- time zone(s) -->
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| timezone2 =
| utc_offset2 =
| timezone2_DST =
| utc_offset2_DST =
<!-- postal codes, area code -->
| postal_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code =
| postal2_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal2_code =
| area_code_type = <!-- defaults to: Area code(s) -->
| area_code =
| geocode =
| iso_code =
| registration_plate_type =
| registration_plate =
<!-- blank fields (section 1) -->
| blank_name_sec1 =
| blank_info_sec1 =
| blank1_name_sec1 =
| blank1_info_sec1 =
| blank2_name_sec1 =
| blank2_info_sec1 = <!-- etc., up to blank7_name_sec1 / blank7_info_sec1 -->
<!-- blank fields (section 2) -->
| blank_name_sec2 =
| blank_info_sec2 =
| blank1_name_sec2 =
| blank1_info_sec2 =
| blank2_name_sec2 =
| blank2_info_sec2 = <!-- etc., up to blank7_name_sec2 / blank7_info_sec2 -->
<!-- website, footnotes -->
| website = <!-- {{URL|example.com}} -->
| footnotes =
}}
</pre>
==Parameter names and descriptions==
{| class="wikitable" style="background: white"
| colspan=3 style="background: orange; text-align: center;" |
===Name and transliteration===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
| '''name''' || optional || This is the usual name in English. If it's not specified, the infobox will use the '''official_name''' as a title unless this too is missing, in which case the page name will be used.
|- style="vertical-align:top;"
| '''official_name''' || optional || The official name in English if different from '''name'''
|- style="vertical-align:top;"
| '''native_name''' || optional || Name in the local language, if different from '''name''', and if not English. This will display under the name/official name
|- style="vertical-align:top;"
| '''native_name_lang''' || optional || Use [[List of ISO 639-2 codes|ISO 639-2 code]], e.g. "fr" for French. If there is more than one native name, in different languages, enter those names using {{tl|lang}}, instead.
|- style="vertical-align:top;"
| '''other_name''' || optional || For places with a former or more common name like Bombay or Saigon
|- style="vertical-align:top;"
| '''settlement_type''' || optional || Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names, provided that either '''name''' or '''official_name''' is filled in. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless '''total_type''' is set).
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Transliteration(s)
|- style="vertical-align:top;"
| '''translit_lang1''' || optional || Will place the "entry" before the word "transliteration(s)". Can be used to specify a particular language like in [[Dêlêg]] or one may just enter "Other", like in [[Gaza City|Gaza]]'s article.
|- style="vertical-align:top;"
| '''translit_lang1_type'''<br />'''translit_lang1_type1'''<br />to<br />'''translit_lang1_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang1_info'''<br />'''translit_lang1_info1'''<br />to<br />'''translit_lang1_info6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2''' || optional || Will place a second transliteration. See [[Dêlêg]]
|- style="vertical-align:top;"
| '''translit_lang2_type'''<br />'''translit_lang2_type1'''<br />to<br />'''translit_lang2_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2_info'''<br />'''translit_lang2_info1'''<br />to<br />'''translit_lang2_info6''' || optional ||
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Images, nickname, motto===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Skyline image
|- style="vertical-align:top;"
| '''image_skyline''' || optional || Despite the name it can be any image that an editor wishes.
|- style="vertical-align:top;"
| '''imagesize''' || optional || Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, '''px''' must be specified; default size is 250px.
|- style="vertical-align:top;"
| '''image_alt''' || optional || [[Alt text]] for the image, used by visually impaired readers who cannot see the image. See [[WP:ALT]].
|- style="vertical-align:top;"
| '''image_caption''' || optional || Will place a caption under the image_skyline (if present)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Flag image
|- style="vertical-align:top;"
| '''image_flag''' || optional || Used for a flag.
|- style="vertical-align:top;"
| '''flag_size''' || optional || Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''flag_alt''' || optional || Alt text for the flag.
|- style="vertical-align:top;"
| '''flag_border''' || optional || Set to 'no' to remove the border from the flag
|- style="vertical-align:top;"
| '''flag_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seal image
|- style="vertical-align:top;"
| '''image_seal''' || optional || If the place has an official seal.
|- style="vertical-align:top;"
| '''seal_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''seal_alt''' || optional || Alt text for the seal.
|- style="vertical-align:top;"
| '''seal_link'''<br />'''seal_type''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Coat of arms image
|- style="vertical-align:top;"
| '''image_shield''' || optional || Can be used for a place with a coat of arms.
|- style="vertical-align:top;"
| '''shield_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''shield_alt''' || optional || Alt text for the shield.
|- style="vertical-align:top;"
| '''shield_link''' || optional || Can be used if a wiki article if known but is not automatically linked by the template. See [[Coquitlam, British Columbia]]'s infobox for an example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Logo or emblem image
|- style="vertical-align:top;"
| '''image_blank_emblem''' || optional || Can be used if a place has an official logo, crest, emblem, etc. Logo is the default type. See [[Kingston upon Hull]]'s infobox for an example.
|- style="vertical-align:top;"
| '''blank_emblem_type''' || optional || To specify what type of emblem "image_blank_emblem" is. The default is Logo.
|- style="vertical-align:top;"
| '''blank_emblem_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''blank_emblem_alt''' || optional || Alt text for blank emblem.
|- style="vertical-align:top;"
| '''blank_emblem_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Nickname, motto
|- style="vertical-align:top;"
| '''etymology''' || optional || origin of name
|- style="vertical-align:top;"
| '''nickname''' || optional || well-known nickname(s)
|- style="vertical-align:top;"
| '''motto''' || optional || Will place the motto under the nicknames
|- style="vertical-align:top;"
| '''anthem''' || optional || Will place the anthem (song) under the nicknames
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Maps, coordinates===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Map images
|- style="vertical-align:top;"
| '''image_map''' || optional ||
|- style="vertical-align:top;"
| '''mapsize''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt''' || optional || Alt text for map.
|- style="vertical-align:top;"
| '''map_caption''' || optional ||
|- style="vertical-align:top;"
| '''image_map1''' || optional || A secondary map image. The field '''image_map''' must be filled in first. Example see: [[Bloomsburg, Pennsylvania]].
|- style="vertical-align:top;"
| '''mapsize1''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt1''' || optional || Alt text for secondary map.
|- style="vertical-align:top;"
| '''map_caption1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Pushpin map(s), coordinates
|- style="vertical-align:top;"
| '''pushpin_map''' || optional || The name of a location map as per [[Template:Location map]] (e.g. ''Indonesia'' or ''Russia''). The coordinate fields (from {{para|coordinates}}) position a pushpin coordinate marker and label on the map '''automatically'''. Example: [[Padang, Indonesia]]. To show multiple pushpin maps, provide a list of maps separated by #, e.g., ''California#USA''
|- style="vertical-align:top;"
| '''pushpin_label_position''' || optional || The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.
|- style="vertical-align:top;"
| '''pushpin_map_alt''' || optional || Alt text for pushpin map.
|- style="vertical-align:top;"
| '''pushpin_mapsize''' || optional || Must be entered as only a number—'''do not use px'''. The default value is 250.
|- style="vertical-align:top;"
| '''pushpin_map_caption''' || optional || Fill out if a different caption from ''map_caption'' is desired.
|- style="vertical-align:top;"
| '''pushpin_relief''' || optional || Set this to <code>y</code> or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).
|- style="vertical-align:top;"
| '''pushpin_overlay''' || optional || Can be used to specify an image to be superimposed on the regular pushpin map.
|- style="vertical-align:top;"
| '''coordinates''' || optional || Latitude and longitude. Use {{tl|Coord}}. See the documentation for {{tl|Coord}} for more details on usage.
|- style="vertical-align:top;"
| '''coor_pinpoint''' || optional || If needed, to specify more exactly where (or what) coordinates are given (e.g. ''Town Hall'') or a specific place in a larger area (e.g. a city in a county). Example: [[Masovian Voivodeship]]
|- style="vertical-align:top;"
| '''coordinates_footnotes''' || optional || Reference(s) for coordinates, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''grid_name'''<br />'''grid_position''' || optional || Name of a regional grid system and position on the regional grid
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Location, established, seat, subdivisions, government, leaders===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Location
|- style="vertical-align:top;"
| '''subdivision_type''' || optional || almost always <code><nowiki>Country</nowiki></code>
|- style="vertical-align:top;"
| '''subdivision_name''' || optional || Depends on the subdivision_type—use the name in text form, sample: <code>United States</code> or <code><nowiki>United States</nowiki></code>, flag icons or flag templates can be used in this field.
|- style="vertical-align:top;"
| '''subdivision_type1'''<br />to<br />'''subdivision_type6''' || optional || Can be State/Province, region, county.
|- style="vertical-align:top;"
| '''subdivision_name1'''<br />to<br />'''subdivision_name6''' || optional || Use the name in text form, sample: <code>Florida</code> or <code><nowiki>[[Florida]]</nowiki></code>. Flag icons or flag templates can be used in this field per [[WP:MOSFLAG]].
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Established
|- style="vertical-align:top;"
| '''established_title''' || optional || Example: Founded
|- style="vertical-align:top;"
| '''established_date''' || optional ||
|- style="vertical-align:top;"
| '''established_title1''' || optional || Example: Incorporated (town) <br/>[Note that "established_title1" is distinct from "established_title"; you can think of "established_title" as behaving like "established_title0".]
|- style="vertical-align:top;"
| '''established_date1''' || optional || [See note for "established_title1".]
|- style="vertical-align:top;"
| '''established_title2''' || optional || Example: Incorporated (city)
|- style="vertical-align:top;"
| '''established_date2''' || optional ||
|- style="vertical-align:top;"
| '''established_title3''' || optional ||
|- style="vertical-align:top;"
| '''established_date3''' || optional ||
|- style="vertical-align:top;"
| '''established_title4''' || optional ||
|- style="vertical-align:top;"
| '''established_date4''' || optional ||
|- style="vertical-align:top;"
| '''established_title5''' || optional ||
|- style="vertical-align:top;"
| '''established_date5''' || optional ||
|- style="vertical-align:top;"
| '''established_title6''' || optional ||
|- style="vertical-align:top;"
| '''established_date6''' || optional ||
|- style="vertical-align:top;"
| '''established_title7''' || optional ||
|- style="vertical-align:top;"
| '''established_date7''' || optional ||
|- style="vertical-align:top;"
| '''extinct_title''' || optional || For when a settlement ceases to exist
|- style="vertical-align:top;"
| '''extinct_date''' || optional ||
|- style="vertical-align:top;"
| '''founder''' || optional || Who the settlement was founded by
|- style="vertical-align:top;"
| '''named_for''' || optional || The source of the name of the settlement (a person, a place, et cetera)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seat of government
|- style="vertical-align:top;"
| '''seat_type''' || optional || The label for the seat of government (defaults to ''Seat'').
|- style="vertical-align:top;"
| '''seat''' || optional || The seat of government.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Smaller parts (e.g. boroughs of a city)
|- style="vertical-align:top;"
| '''parts_type''' || optional || The label for the smaller subdivisions (defaults to ''Boroughs'').
|- style="vertical-align:top;"
| '''parts_style''' || optional || Set to ''list'' to display as a collapsible list, ''coll'' as a collapsed list, or ''para'' to use paragraph style. Default is ''list'' for up to 5 items, otherwise ''coll''.
|- style="vertical-align:top;"
| '''parts''' || optional || Text or header of the list of smaller subdivisions.
|- style="vertical-align:top;"
| '''p1'''<br />'''p2'''<br />to<br />'''p50''' || optional || The smaller subdivisions to be listed. Example: [[Warsaw]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Government type, leaders
|- style="vertical-align:top;"
| '''government_footnotes''' || optional || Reference(s) for government, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''government_type''' || optional || Example: [[Mayor-council government]]
|- style="vertical-align:top;"
| '''governing_body''' || optional || Name of the place's governing body
|- style="vertical-align:top;"
| '''leader_party''' || optional || Political party of the place's leader
|- style="vertical-align:top;"
| '''leader_title''' || optional || First title of the place's leader, e.g. Mayor
|- style="vertical-align:top;"
| '''leader_name''' || optional || Name of the place's leader
|- style="vertical-align:top;"
| '''leader_title1'''<br />to<br />'''leader_title4''' || optional ||
|- style="vertical-align:top;"
| '''leader_name1'''<br />to<br />'''leader_name4''' || optional || For long lists use {{tl|Collapsible list}}. See [[Halifax Regional Municipality|Halifax]] for an example.
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Geographic information===
|- style="vertical-align:top;"
| colspan=3 | These fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they should enter both values in their respective fields.
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Display settings
|- style="vertical-align:top;"
| '''total_type''' || optional || Specifies what "total" area and population figure refer to, e.g. ''Greater London''. This overrides other labels for total population/area. To make the total area and population display on the same line as the words "Area" and "Population", with no "Total" or similar label, set the value of this parameter to ''' '''.
|- style="vertical-align:top;"
| '''unit_pref''' || optional || To change the unit order to ''imperial (metric)'', enter '''imperial'''. The default display style is ''metric (imperial)''. However, the template will swap the order automatically if the '''subdivision_name''' equals some variation of the USA or the UK.<br />For the middle east, a unit preference of [[dunam]] can be entered (only affects total area). <br /> All values must be entered in a '''raw format: no commas, spaces, or unit symbols'''. The template will format them automatically.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Area
|- style="vertical-align:top;"
| '''area_footnotes''' || optional || Reference(s) for area, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''area_magnitude''' || optional || Setting this to any non-empty value will create a link to the appropriate order of magnitude of area page (e.g. [[1 E+6 m²]]).
|- style="vertical-align:top;"
| '''dunam_link''' || optional || If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting <code>dunam_link</code> to another measure (e.g. <code>dunam_link=water</code>). Linking can also be turned off by setting the parameter to something else (e.g. <code>dunam_link=none</code> or <code>dunam_link=off</code>).
|- style="vertical-align:top;"
| '''area_total_km2''' || optional || Total area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_total_ha''' || optional || Total area in hectares—symbol: ha. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.
|- style="vertical-align:top;"
| '''area_total_sq_mi''' || optional || Total area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.
|- style="vertical-align:top;"
| '''area_total_acre''' || optional || Total area in acres. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display hectares if area_total_ha is empty.
|- style="vertical-align:top;"
| '''area_total_dunam''' || optional || Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: [[Gaza City|Gaza]] and [[Ramallah]]
|- style="vertical-align:top;"
| '''area_land_km2''' || optional || Land area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_land_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_land_sq_mi''' || optional || Land area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_land_km2 is empty.
|- style="vertical-align:top;"
| '''area_land_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_land_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_land_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_km2''' || optional || Water area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_water_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_water_sq_mi''' || optional || Water area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_water_km2 is empty.
|- style="vertical-align:top;"
| '''area_water_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_water_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_water_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_percent''' || optional || percent of water without the "%"
|- style="vertical-align:top;"
| '''area_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_urban_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_urban_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| '''area_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_rural_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_rural_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_metro_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_metro_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_rank''' || optional || The settlement's area, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''area_blank1_title''' || optional || Example see London
|- style="vertical-align:top;"
| '''area_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank1_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank1_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank2_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank2_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_note''' || optional || A place for additional information such as the name of the source.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Dimensions
|- style="vertical-align:top;"
| '''dimensions_footnotes''' || optional || Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''length_km''' || optional || Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''length_mi''' || optional || Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.
|- style="vertical-align:top;"
| '''width_km''' || optional || Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''width_mi''' || optional || Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Elevation
|- style="vertical-align:top;"
| '''elevation_footnotes''' || optional || Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''elevation_m''' || optional || Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_ft''' || optional || Raw number, entered in feet. Will automatically convert to display the average elevation in meters if '''elevation_m''' field is empty. However, if a range in elevation (e.g. 50–500 ft ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_max_footnotes'''<br />'''elevation_min_footnotes''' || optional || Same as above, but for the "max" and "min" elevations. See [[Leeds]].
|- style="vertical-align:top;"
| '''elevation_max_m'''<br />'''elevation_max_ft'''<br />'''elevation_max_rank'''<br />'''elevation_min_m'''<br />'''elevation_min_ft'''<br />'''elevation_min_rank''' || optional || Used to give highest & lowest elevations and rank, instead of just a single value. Example: [[Halifax Regional Municipality]].
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Population, demographics===
|- style="vertical-align:top;"
| colspan=3 | The density fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they can enter both values in their respective fields. '''To calculate density with respect to the total area automatically, type ''auto'' in place of any density value.'''
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Population
|- style="vertical-align:top;"
| '''population_total''' || optional || Actual population (see below for estimates) preferably consisting of digits only (without any commas)
|- style="vertical-align:top;"
| '''population_as_of''' || optional || The year for the population total (usually a census year)
|- style="vertical-align:top;"
| '''population_footnotes''' || optional || Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_est''' || optional || Population estimate.
|- style="vertical-align:top;"
| '''pop_est_as_of''' || optional || The year or month & year of the population estimate
|- style="vertical-align:top;"
| '''pop_est_footnotes''' || optional || Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_urban''' || optional ||
|- style="vertical-align:top;"
| '''population_urban_footnotes''' || optional || Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rural''' || optional ||
|- style="vertical-align:top;"
| '''population_rural_footnotes''' || optional || Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_metro''' || optional ||
|- style="vertical-align:top;"
| '''population_metro_footnotes''' || optional || Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rank''' || optional || The settlement's population, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_density_rank''' || optional || The settlement's population density, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_blank1_title''' || optional || Can be used for estimates. Example: [[Windsor, Ontario]]
|- style="vertical-align:top;"
| '''population_blank1''' || optional || The population value for blank1_title
|- style="vertical-align:top;"
| '''population_density_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_demonym''' || optional || A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in [[Liverpool]] is known as a [[Liverpudlian]].
|- style="vertical-align:top;"
| '''population_note''' || optional || A place for additional information such as the name of the source. See [[Windsor, Ontario]] for example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 1)
|- style="vertical-align:top;"
| '''demographics_type1''' || optional || Section Header. For example: Ethnicity
|- style="vertical-align:top;"
| '''demographics1_footnotes''' || optional || Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics1_title1'''<br />to<br />'''demographics1_title5''' || optional || Titles related to demographics_type1. For example: White, Black, Hispanic...
|- style="vertical-align:top;"
| '''demographics1_info1'''<br />to<br />'''demographics1_info5''' || optional || Information related to the "titles". For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 2)
|- style="vertical-align:top;"
| '''demographics_type2''' || optional || A second section header. For example: Languages
|- style="vertical-align:top;"
| '''demographics2_footnotes''' || optional || Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics2_title1'''<br />to<br />'''demographics2_title5''' || optional || Titles related to '''demographics_type2'''. For example: English, French, Arabic...
|- style="vertical-align:top;"
| '''demographics2_info1'''<br />to<br />'''demographics2_info5''' || optional || Information related to the "titles" for type2. For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Other information===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Time zone(s)
|- style="vertical-align:top;"
| '''timezone1''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1''' || optional ||
|- style="vertical-align:top;"
| '''timezone1_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1_DST''' || optional ||
|- style="vertical-align:top;"
| '''timezone2''' || optional || A second timezone field for larger areas such as a Province.
|- style="vertical-align:top;"
| '''utc_offset2''' || optional ||
|- style="vertical-align:top;"
| '''timezone2_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset2_DST''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Postal code(s) & area code
|- style="vertical-align:top;"
| '''postal_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal_code''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code''' || optional ||
|- style="vertical-align:top;"
| '''area_code_type''' || optional || If left blank/not used template will default to "[[Telephone numbering plan|Area code(s)]]"
|- style="vertical-align:top;"
| '''area_code''' || optional ||
|- style="vertical-align:top;"
| '''geocode''' || optional || See [[Geocode]]
|- style="vertical-align:top;"
| '''iso_code''' || optional || See [[ISO 3166]]
|- style="vertical-align:top;"
| '''registration_plate_type''' || optional || If left blank/not used template will default to "[[Vehicle registration plate|Vehicle registration]]"
|- style="vertical-align:top;"
| '''registration_plate''' || optional || See [[Vehicle registration plate]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 1)
|- style="vertical-align:top;"
| '''blank_name_sec1''' || optional || Fields used to display other information. The name is displayed in bold on the left side of the infobox.
|- style="vertical-align:top;"
| '''blank_info_sec1''' || optional || The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]
|- style="vertical-align:top;"
| '''blank1_name_sec1'''<br />to<br />'''blank7_name_sec1''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec1'''<br />to<br />'''blank7_info_sec1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 2)
|- style="vertical-align:top;"
| '''blank_name_sec2''' || optional || For a second section of blank fields
|- style="vertical-align:top;"
| '''blank_info_sec2''' || optional || Example: [[Beijing]]
|- style="vertical-align:top;"
| '''blank1_name_sec2'''<br />to<br />'''blank7_name_sec2''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec2'''<br />to<br />'''blank7_info_sec2''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Website, footnotes
|- style="vertical-align:top;"
| '''website''' || optional || External link to official website, Use {{Tl|URL}}, thus: <nowiki>{{URL|example.com}}</nowiki>
|- style="vertical-align:top;"
| '''footnotes''' || optional || Text to be displayed at the bottom of the infobox
|- style="vertical-align:top;"
| '''short_description''' || optional || [[WP:SHORTDESC|specify custom short description]]; if not specified, one will be automatically generated, e.g. "Place in Israel".
|}
<!-- End of parameter name/description table -->
==Examples==
;Example 1:
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (''City in a Garden''), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | accessdate = August 1, 2012}}</ref>
| area_magnitude = 1 E+8
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | accessdate = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |accessdate = April 12, 2011}}</ref>
| population_as_of = [[2010 United States Census|2010]]
| population_total = 2,695,598
| pop_est_as_of = 2011
| population_est = 2,707,120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_code = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|423587}}, {{GNIS4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite GNIS|428803|City of Chicago|April 12, 2011}}</ref>
}}
<source lang="xml" style="overflow:auto; white-space: pre-wrap;">
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (''City in a Garden''), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | accessdate = August 1, 2012}}</ref>
| area_magnitude = 1 E+8
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_as_of = [[2010 United States Census|2010]]
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | accessdate = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |accessdate = April 12, 2011}}</ref>
| population_total = 2,695,598
| pop_est_as_of = 2011
| population_est = 2,707,120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_code = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|423587}}, {{GNIS4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite GNIS|428803|City of Chicago|April 12, 2011}}</ref>
}}
</source>
;References
{{reflist|close=1}}
{{clear}}
----
;Example 2:
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| official_name = City of Detroit
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit.svg
| image_seal = Seal of Detroit (B&W).svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[Contiguous United States|contiguous United States of America]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = {{flag|Michigan}}
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor-council government|Mayor-Council]]
| leader_title = [[List of mayors of Detroit, Michigan|Mayor]]
| leader_name = [[Dave Bing]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_magnitude =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_as_of = 2011
| population_footnotes =
| population_total = 706,585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3,863,924
| population_metro = 4,285,832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5,207,434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_note =
| population_demonym = Detroiter
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|1617959}}, {{GNIS4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
<source lang="html" style="overflow:auto; white-space: pre-wrap;">
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| official_name = City of Detroit
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit, Michigan.svg
| image_seal = Seal of Detroit, Michigan.svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[Contiguous United States|contiguous United States of America]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = {{flagu|United States of America}}
| subdivision_type1 = State
| subdivision_name1 = {{flag|Michigan}}
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor-council government|Mayor-Council]]
| leader_title = [[List of mayors of Detroit, Michigan|Mayor]]
| leader_name = [[Dave Bing]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_magnitude =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_as_of = 2011
| population_footnotes =
| population_total = 706,585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3,863,924
| population_metro = 4,285,832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5,207,434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_demonym = Detroiter
| population_note =
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|1617959}}, {{GNIS4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
</source>
{{clear}}
==Redirects and calls==
At least {{PAGESINCATEGORY:Templates calling Infobox settlement}} other [[:Category:Templates calling Infobox settlement|templates call this one]] and [{{fullurl:Special:WhatLinksHere/Template:Infobox_settlement|namespace=10&hidetrans=1&hidelinks=1}} many templates redirect here].
==Supporting templates==
The following is a list of sub-templates used by Infobox settlement. See the [{{fullurl:Special:PrefixIndex|prefix=Infobox+settlement%2F&namespace=10&hideredirects=1}} current list of all sub-templates] for documentation, sandboxes, testcases, etc.
# {{tl|Infobox settlement/areadisp}}
# {{tl|Infobox settlement/densdisp}}
# {{tl|Infobox settlement/dunam}}
# {{tl|Infobox settlement/dunam/mag}}
# {{tl|Infobox settlement/impus}}
# {{tl|Infobox settlement/impus/mag}}
# {{tl|Infobox settlement/lengthdisp}}
# {{tl|Infobox settlement/link}}
# {{tl|Infobox settlement/metric}}
# {{tl|Infobox settlement/metric/mag}}
# {{tl|Infobox settlement/pref}}
==Microformat==
{{UF-hcard-geo}}
{{collapse top|TemplateData}}
{{TemplateData header}}
<templatedata>
{
"description": "an Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etcetera",
"params": {
"name": {
"label": "name",
"description": "This is the usual name in English. If it's not specified, the infobox will use the 'official_name' as a title unless this too is missing, in which case the page name will be used.",
"type": "string",
"required": false
},
"official_name": {
"label": "official_name",
"description": "The official name in English if different from 'name'",
"type": "string",
"required": false
},
"native_name": {
"label": "native_name",
"description": "This will display under the name/official name",
"type": "string",
"required": false
},
"native_name_lang": {
"label": "native_name_lang",
"description": "Use ISO 639-2 code, e.g. 'fr' for French. If there is more than one native name, in different languages, enter those names using {{lang}}, instead.",
"type": "string",
"required": false
},
"other_name": {
"label": "other_name",
"description": "For places with a former or more common name like Bombay or Saigon",
"type": "string",
"required": false
},
"settlement_type": {
"label": "settlement_type",
"description": "Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names, provided that either 'name' or 'official_name' is filled in. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless 'total_type' is set).",
"type": "string",
"required": false
},
"translit_lang1": {
"label": "translit_lang1",
"description": "Will place the entry before the word 'transliteration(s)'. Can be used to specify a particular language like in Dêlêg or one may just enter 'Other', like in Gaza's article.",
"type": "string",
"required": false
},
"translit_lang1_type": {
"label": "translit_lang1_type",
"description": "Parameters translit_lang2_type1, ... translit_lang2_type6 are also available but not documented here",
"type": "string",
"required": false
},
"translit_lang1_info": {
"label": "translit_lang1_info",
"description": "Parameters translit_lang2_info1, ... translit_lang2_info6 are also available but not documented here",
"type": "string",
"required": false
},
"translit_lang2": {
"label": "translit_lang2",
"description": "Will place a second transliteration. See Dêlêg",
"type": "string",
"required": false
},
"image_skyline": {
"label": "image_skyline",
"description": "Despite the name it can be any image that an editor wishes.",
"type": "wiki-file-name",
"required": false
},
"imagesize": {
"label": "imagesize",
"description": "Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, 'px' must be specified; default size is 250px.",
"type": "string",
"required": false
},
"image_alt": {
"label": "image_alt",
"description": "Alt text for the image, used by visually impaired readers who cannot see the image.",
"type": "string",
"required": false
},
"image_caption": {
"label": "image_caption",
"description": "Will place a caption under the image_skyline (if present)",
"type": "string",
"required": false
},
"image_flag": {
"label": "image_flag",
"description": "Used for a flag.",
"type": "string",
"required": false
},
"flag_size": {
"label": "flag_size",
"description": "Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"flag_alt": {
"label": "flag_alt",
"description": "Alt text for the flag.",
"type": "string",
"required": false
},
"flag_border": {
"label": "flag_border",
"description": "Set to no to remove the border from the flag",
"type": "string",
"required": false
},
"flag_link": {
"label": "flag_link",
"type": "string",
"required": false
},
"image_seal": {
"label": "image_seal",
"description": "If the place has an official seal.",
"type": "string",
"required": false
},
"seal_size": {
"label": "seal_size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"seal_alt": {
"label": "seal_alt",
"description": "Alt text for the seal.",
"type": "string",
"required": false
},
"seal_link": {
"label": "seal_link",
"type": "string",
"required": false
},
"image_shield": {
"label": "image_shield",
"description": "Can be used for a place with a coat of arms.",
"type": "string",
"required": false
},
"shield_size": {
"label": "shield_size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"shield_alt": {
"label": "shield_alt",
"description": "Alt text for the shield.",
"type": "string",
"required": false
},
"shield_link": {
"label": "shield_link",
"description": "Can be used if a wiki article if known but is not automatically linked by the template. See Coquitlam, British Columbia's infobox for an example.",
"type": "string",
"required": false
},
"image_blank_emblem": {
"label": "image_blank_emblem",
"description": "Can be used if a place has an official logo, crest, emblem, etc. Logo is the default type. See Kingston upon Hull's infobox for an example.",
"type": "string",
"required": false
},
"blank_emblem_type": {
"label": "blank_emblem_type",
"description": "To specify what type of emblem 'image_blank_emblem' is. The default is Logo.",
"type": "string",
"required": false
},
"blank_emblem_size": {
"label": "blank_emblem_size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"blank_emblem_alt": {
"label": "blank_emblem_alt",
"description": "Alt text for blank emblem.",
"type": "string",
"required": false
},
"blank_emblem_link": {
"label": "blank_emblem_link",
"type": "string",
"required": false
},
"nickname": {
"label": "nickname",
"description": "well-known nickname(s)",
"type": "string",
"required": false
},
"motto": {
"label": "motto",
"description": "Will place the motto under the nicknames",
"type": "string",
"required": false
},
"anthem": {
"label": "anthem",
"description": "Will place the anthem (song) under the nicknames",
"type": "string",
"required": false
},
"image_map": {
"label": "image_map",
"type": "string",
"required": false
},
"mapsize": {
"label": "mapsize",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"required": false
},
"map_alt": {
"label": "map_alt",
"description": "Alt text for map.",
"type": "string",
"required": false
},
"map_caption": {
"label": "map_caption",
"type": "string",
"required": false
},
"image_map1": {
"label": "image_map1",
"description": "A secondary map image. The field 'image_map' must be filled in first. Example see: Bloomsburg, Pennsylvania.",
"type": "string",
"required": false
},
"mapsize1": {
"label": "mapsize1",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"required": false
},
"map_alt1": {
"label": "map_alt1",
"description": "Alt text for secondary map.",
"type": "string",
"required": false
},
"map_caption1": {
"label": "map_caption1",
"type": "string",
"required": false
},
"pushpin_map": {
"label": "pushpin_map",
"description": "The name of a location map (e.g. 'Indonesia' or 'Russia'). The coordinates information (from the coordinates parameter) position a pushpin coordinate marker and label on the map 'automatically'. Example see: Padang, Indonesia",
"type": "string",
"required": false
},
"pushpin_label_position": {
"label": "pushpin_label_position",
"description": "The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.",
"type": "string",
"required": false
},
"pushpin_map_alt": {
"label": "pushpin_map_alt",
"description": "Alt text for pushpin map.",
"type": "string",
"required": false
},
"pushpin_mapsize": {
"label": "pushpin_mapsize",
"description": "Must be entered as only a number—do not use px. The default value is 250.",
"type": "number",
"required": false
},
"pushpin_map_caption": {
"label": "pushpin_map_caption",
"description": "Fill out if a different caption from ''map_caption'' is desired.",
"type": "string",
"required": false
},
"pushpin_relief": {
"label": "pushpin_relief",
"description": "Set this to 'y' or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).",
"type": "string",
"required": false
},
"pushpin_overlay": {
"label": "pushpin_overlay",
"description": "Can be used to specify an image to be superimposed on the regular pushpin map.",
"type": "string",
"required": false
},
"coordinates": {
"label": "Coordinates",
"description": "Latitude and longitude. Use {{Coord}}. See the documentation for {{Coord}} for more details on usage.",
"type": "wiki-template-name",
"required": false,
"example": "{{coord|41|50|15|N|87|40|55|W}}"
},
"coor_pinpoint": {
"label": "coor_pinpoint",
"description": "If needed, to specify more exactly where (or what) coordinates are given (e.g. 'Town Hall') or a specific place in a larger area (e.g. a city in a county). Example: Masovian Voivodeship",
"type": "string",
"required": false
},
"coordinates_footnotes": {
"label": "coordinates_footnotes",
"description": "Reference(s) for coordinates, placed within <ref> </ref> tags, possibly using the citing format at {{Cite web}}",
"type": "string",
"required": false
},
"subdivision_type": {
"label": "subdivision_type",
"description": "almost always 'Country'",
"type": "string",
"required": false
},
"subdivision_name": {
"label": "subdivision_name",
"description": "Depends on the subdivision_type—use the name in text form, sample: 'United States' or 'United States', flag icons or flag templates can be used in this field.",
"type": "string",
"required": false
},
"subdivision_type1": {
"label": "subdivision_type1",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type2": {
"label": "subdivision_type2",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type3": {
"label": "subdivision_type3",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type4": {
"label": "subdivision_type4",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type5": {
"label": "subdivision_type5",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type6": {
"label": "subdivision_type6",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_name1": {
"label": "subdivision_name1",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG.",
"type": "string",
"required": false
},
"subdivision_name2": {
"label": "subdivision_name2",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name3": {
"label": "subdivision_name3",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name4": {
"label": "subdivision_name4",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name5": {
"label": "subdivision_name5",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name6": {
"label": "subdivision_name6",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"established_title": {
"label": "established_title",
"description": "Example: First settled",
"type": "string",
"required": false
},
"established_date": {
"label": "established_date",
"type": "string",
"required": false
},
"established_title1": {
"label": "established_title1",
"description": "Example: Incorporated (town)",
"type": "string",
"required": false
},
"established_date1": {
"label": "established_date1",
"type": "string",
"required": false
},
"established_title2": {
"label": "established_title2",
"description": "Example: Incorporated (city)",
"type": "string",
"required": false
},
"established_date2": {
"label": "established_date2",
"type": "string",
"required": false
},
"established_title3": {
"label": "established_title3",
"type": "string",
"required": false
},
"established_date3": {
"label": "established_date3",
"type": "string",
"required": false
},
"extinct_title": {
"label": "extinct_title",
"description": "For when a settlement ceases to exist",
"type": "string",
"required": false
},
"extinct_date": {
"label": "extinct_date",
"type": "string",
"required": false
},
"founder": {
"label": "founder",
"description": "Who the settlement was founded by",
"type": "string",
"required": false
},
"named_for": {
"label": "named_for",
"description": "The source of the name of the settlement (a person, a place, et cetera)",
"type": "string",
"required": false
},
"seat_type": {
"label": "seat_type",
"description": "The label for the seat of government (defaults to 'Seat').",
"type": "string",
"required": false
},
"seat": {
"label": "seat",
"description": "The seat of government.",
"type": "string",
"required": false
},
"parts_type": {
"label": "parts_type",
"description": "The label for the smaller subdivisions (defaults to 'Boroughs').",
"type": "string",
"required": false
},
"parts_style": {
"label": "parts_style",
"description": "Set to 'list' to display as a collapsible list, 'coll' as a collapsed list, or 'para' to use paragraph style. Default is 'list' for up to 5 items, otherwise 'coll'.",
"type": "string",
"required": false
},
"parts": {
"label": "parts",
"description": "Text or header of the list of smaller subdivisions.",
"type": "string",
"required": false
},
"p1": {
"label": "p1",
"description": "The smaller subdivisions to be listed. Parameters 'p1' to 'p50' can also be used.",
"type": "string",
"required": false
},
"government_footnotes": {
"label": "government_footnotes",
"description": "References for government, placed within <ref> </ref> tags, possibly using the citing format at {{Cite web}}",
"type": "string",
"required": false
},
"government_type": {
"label": "government_type",
"description": "Example: '[[Mayor-council government]]'",
"type": "string",
"required": false
},
"governing_body": {
"label": "governing_body",
"description": "Name of the place's governing body",
"type": "string",
"required": false
},
"leader_party": {
"label": "leader_party",
"description": "Political party of the place's leader",
"type": "string",
"required": false
},
"leader_title": {
"label": "leader_title",
"description": "First title of the place's leader, e.g. Mayor",
"type": "string",
"required": false
},
"leader_name": {
"label": "leader_name",
"description": "Name of the place's leader",
"type": "string",
"required": false
},
"leader_title1": {
"label": "leader_title1",
"description": "First title of the place's leader, e.g. Mayor",
"type": "string",
"required": false
},
"leader_name1": {
"label": "leader_name1",
"description": "Additional names for leaders. Parameters 'leader_name1' .. 'leader_name4' are available. For long lists use {{Collapsible list}}.",
"type": "string",
"required": false
},
"total_type": {
"label": "total_type",
"description": "Specifies what total area and population figure refer to, e.g. 'Greater London'. This overrides other labels for total population/area. To make the total area and population display on the same line as the words Area and Population, with no Total or similar label, set the value of this parameter to ' '.",
"type": "string",
"required": false
},
"unit_pref": {
"label": "unit_pref",
"description": "To change the unit order to 'imperial (metric)', enter 'imperial'. The default display style is 'metric (imperial)'. However, the template will swap the order automatically if the 'subdivision_name' equals some variation of the USA or the UK. For the middle east, a unit preference of dunam can be entered (only affects total area). All values must be entered in a raw format: no commas, spaces, or unit symbols. The template will format them automatically.",
"type": "string",
"required": false
},
"area_footnotes": {
"label": "area_footnotes",
"description": "Reference(s) for area, placed within <ref> </ref> tags, possibly using the citing format at {Cite web}",
"type": "string",
"required": false
},
"area_magnitude": {
"label": "area_magnitude",
"description": "Setting this to any non-empty value will create a link to the appropriate order of magnitude of area page (e.g. [[1 E+6 m²]]).",
"type": "string",
"required": false
},
"dunam_link": {
"label": "dunam_link",
"description": "If dunams are used, the default is to link the word 'dunams' in the total area section. This can be changed by setting 'dunam_link' to another measure (e.g. 'dunam_link=water'). Linking can also be turned off by setting the parameter to something else (e.g. 'dunam_link=none' or 'dunam_link=off').",
"type": "string",
"required": false
},
"area_total_km2": {
"label": "area_total_km2",
"description": "Total area in square kilometers—symbol: km². Value must be entered in raw format, no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.",
"type": "string",
"required": false
},
"area_total_ha": {
"label": "area_total_ha",
"description": "Total area in hectares—symbol: ha. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.",
"type": "string",
"required": false
},
"area_total_sq_mi": {
"label": "area_total_sq_mi",
"description": "Total area in square miles—symbol: sq mi. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.",
"type": "string",
"required": false
},
"area_total_acre": {
"label": "area_total_acre",
"description": "Total area in acres. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display hectares if 'area_total_ha' is empty.",
"type": "number",
"required": false
},
"area_total_dunam": {
"label": "area_total_dunam",
"description": "Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: Gaza and Ramallah",
"type": "number",
"required": false
},
"area_land_km2": {
"label": "area_land_km2",
"description": "Land area in square kilometers—symbol: km^2. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square miles if 'area_land_sq_mi' is empty.",
"type": "number",
"required": false
},
"area_land_sq_mi": {
"label": "area_land_sq_mi",
"description": "Land area in square miles—symbol: sq mi. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers if 'area_land_km2' is empty.",
"type": "number",
"required": false
},
"area_land_ha": {
"label": "area_land_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_land_dunam": {
"label": "area_land_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_land_acre": {
"label": "area_land_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_water_km2": {
"label": "area_water_km2",
"description": "Water area in square kilometers symbol: km^2. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square miles if 'area_water_sq_mi' is empty.",
"type": "number",
"required": false
},
"area_water_sq_mi": {
"label": "area_water_sq_mi",
"description": "Water area in square miles symbol: sq mi. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers if 'area_water_km2' is empty.",
"type": "number",
"required": false
},
"area_water_ha": {
"label": "area_water_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_water_dunam": {
"label": "area_water_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_water_acre": {
"label": "area_water_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_water_percent": {
"label": "area_water_percent",
"description": "percent of water without the %.",
"type": "number",
"required": false
},
"area_urban_km2": {
"label": "area_urban_km2",
"type": "number",
"required": false
},
"area_urban_sq_mi": {
"label": "area_urban_sq_mi",
"type": "number",
"required": false
},
"area_urban_ha": {
"label": "area_urban_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_urban_dunam": {
"label": "area_urban_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_urban_acre": {
"label": "area_urban_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_rural_km2": {
"label": "area_rural_km2",
"type": "number",
"required": false
},
"area_rural_sq_mi": {
"label": "area_rural_sq_mi",
"type": "number",
"required": false
},
"area_rural_ha": {
"label": "area_rural_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_rural_dunam": {
"label": "area_rural_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_rural_acre": {
"label": "area_rural_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_metro_km2": {
"label": "area_metro_km2",
"type": "number",
"required": false
},
"area_metro_sq_mi": {
"label": "area_metro_sq_mi",
"type": "number",
"required": false
},
"area_metro_ha": {
"label": "area_metro_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_metro_dunam": {
"label": "area_metro_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_metro_acre": {
"label": "area_metro_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_rank": {
"label": "area_rank",
"description": "The settlement's area, as ranked within its parent sub-division",
"type": "string",
"required": false
},
"area_blank1_title": {
"label": "area_blank1_title",
"description": "Example see London",
"type": "string",
"required": false
},
"area_blank1_km2": {
"label": "area_blank1_km2",
"type": "number",
"required": false
},
"area_blank1_sq_mi": {
"label": "area_blank1_sq_mi",
"type": "number",
"required": false
},
"area_blank1_ha": {
"label": "area_blank1_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_blank1_dunam": {
"label": "area_blank1_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_blank1_acre": {
"label": "area_blank1_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_blank2_title": {
"label": "area_blank2_title",
"type": "string",
"required": false
},
"area_blank2_km2": {
"label": "area_blank2_km2",
"type": "number",
"required": false
},
"area_blank2_sq_mi": {
"label": "area_blank2_sq_mi",
"type": "number",
"required": false
},
"area_blank2_ha": {
"label": "area_blank2_ha",
"description": "Similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_blank2_dunam": {
"label": "area_blank2_dunam",
"description": "Similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_blank2_acre": {
"label": "area_blank2_acre",
"description": "Similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_note": {
"label": "area_note",
"description": "A place for additional information such as the name of the source.",
"type": "string",
"required": false
},
"dimensions_footnotes": {
"label": "dimensions_footnotes",
"description": "Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"length_km": {
"label": "length_km",
"description": "Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.",
"type": "string",
"required": false
},
"length_mi": {
"label": "length_mi",
"description": "Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.",
"type": "string",
"required": false
},
"width_km": {
"label": "width_km",
"description": "Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.",
"type": "number",
"required": false
},
"width_mi": {
"label": "width_mi",
"description": "Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.",
"type": "number",
"required": false
},
"elevation_footnotes": {
"label": "elevation_footnotes",
"description": "Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"elevation_m": {
"label": "elevation_m",
"description": "Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the 'max' and 'min' fields below",
"type": "number",
"required": false
},
"elevation_ft": {
"label": "elevation_ft",
"description": "Raw number, entered in feet. Will automatically convert to display the average elevation in meters if 'elevation_m' field is empty. However, if a range in elevation (i.e. 50–500 ft ) is desired, use the 'max' and 'min' fields below",
"type": "number",
"required": false
},
"elevation_min_m": {
"label": "elevation_min_m",
"type": "number",
"required": false
},
"elevation_min_ft": {
"label": "elevation_min_ft",
"type": "number",
"required": false
},
"elevation_max_footnotes": {
"label": "elevation_max_footnotes",
"type": "string",
"required": false
},
"elevation_min_footnotes": {
"label": "elevation_min_footnotes",
"type": "string",
"required": false
},
"population_total": {
"label": "population_total",
"description": "Actual population (see below for estimates) preferably consisting of digits only (without any commas)",
"type": "string",
"required": false
},
"population_as_of": {
"label": "population_as_of",
"description": "The year for the population total (usually a census year)",
"type": "string",
"required": false
},
"population_footnotes": {
"label": "population_footnotes",
"description": "Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_km2": {
"label": "population_density_km2",
"type": "number",
"required": false
},
"population_density_sq_mi": {
"label": "population_density_sq_mi",
"type": "number",
"required": false
},
"population_est": {
"label": "population_est",
"description": "Population estimate.",
"type": "number",
"required": false
},
"pop_est_as_of": {
"label": "pop_est_as_of",
"description": "The year or month & year of the population estimate",
"type": "string",
"required": false
},
"pop_est_footnotes": {
"label": "pop_est_footnotes",
"description": "Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_urban": {
"label": "population_urban",
"type": "string",
"required": false
},
"population_urban_footnotes": {
"label": "population_urban_footnotes",
"description": "Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_urban_km2": {
"label": "population_density_urban_km2",
"type": "number",
"required": false
},
"population_density_urban_sq_mi": {
"label": "population_density_urban_sq_mi",
"type": "number",
"required": false
},
"population_rural": {
"label": "population_rural",
"type": "string",
"required": false
},
"population_rural_footnotes": {
"label": "population_rural_footnotes",
"description": "Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_rural_km2": {
"label": "population_density_rural_km2",
"type": "number",
"required": false
},
"population_density_rural_sq_mi": {
"label": "population_density_rural_sq_mi",
"type": "number",
"required": false
},
"population_metro": {
"label": "population_metro",
"type": "string",
"required": false
},
"population_metro_footnotes": {
"label": "population_metro_footnotes",
"description": "Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_metro_km2": {
"label": "population_density_metro_km2",
"type": "number",
"required": false
},
"population_density_metro_sq_mi": {
"label": "population_density_metro_sq_mi",
"type": "number",
"required": false
},
"population_rank": {
"label": "population_rank",
"description": "The settlement's population, as ranked within its parent sub-division",
"type": "string",
"required": false
},
"population_density_rank": {
"label": "population_density_rank",
"description": "The settlement's population density, as ranked within its parent sub-division",
"type": "string",
"required": false
},
"population_blank1_title": {
"label": "population_blank1_title",
"description": "Can be used for estimates. Example: Windsor, Ontario",
"type": "string",
"required": false
},
"population_blank1": {
"label": "population_blank1",
"description": "The population value for blank1_title",
"type": "string",
"required": false
},
"population_density_blank1_km2": {
"label": "population_density_blank1_km2",
"type": "string",
"required": false
},
"population_density_blank1_sq_mi": {
"label": "population_density_blank1_sq_mi",
"type": "string",
"required": false
},
"population_blank2_title": {
"label": "population_blank2_title",
"type": "string",
"required": false
},
"population_blank2": {
"label": "population_blank2",
"type": "string",
"required": false
},
"population_density_blank2_km2": {
"label": "population_density_blank2_km2",
"type": "string",
"required": false
},
"population_density_blank2_sq_mi": {
"label": "population_density_blank2_sq_mi",
"type": "string",
"required": false
},
"population_demonym": {
"label": "population_demonym",
"description": "A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example a citizen in Liverpool is known as a Liverpudlian.",
"type": "string",
"required": false
},
"population_note": {
"label": "population_note",
"description": "A place for additional information such as the name of the source. See Windsor, Ontario for example.",
"type": "string",
"required": false
},
"demographics_type1": {
"label": "demographics_type1",
"description": "Section Header. For example: Ethnicity",
"type": "string",
"required": false
},
"demographics1_footnotes": {
"label": "demographics1_footnotes",
"description": "Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"demographics1_title1": {
"label": "demographics1_title1",
"description": "Titles related to demographics_type1. For example: White, Black, Hispanic... Additional rows 'demographics1_title1' to 'demographics1_title5' are also available",
"type": "string",
"required": false
},
"demographics1_info5": {
"label": "demographics1_info5",
"description": "Information related to the titles. For example: 50%, 25%, 10%... Additional rows 'demographics1_info1' to 'demographics1_info5' are also available",
"type": "string",
"required": false
},
"demographics_type2": {
"label": "demographics_type2",
"description": "A second section header. For example: Languages",
"type": "string",
"required": false
},
"demographics2_footnotes": {
"label": "demographics2_footnotes",
"description": "Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"demographics2_title1": {
"label": "demographics2_title1",
"description": "Titles related to demographics_type1. For example: English, French, Arabic... Additional rows 'demographics2_title2' to 'demographics1_title5' are also available",
"type": "string",
"required": false
},
"demographics2_info1": {
"label": "demographics2_info1",
"description": "Information related to the titles. For example: 50%, 25%, 10%... Additional rows 'demographics2_info2' to 'demographics2_info5' are also available",
"type": "string",
"required": false
},
"timezone1": {
"label": "timezone1",
"type": "string",
"required": false
},
"utc_offset1": {
"label": "utc_offset1",
"type": "string",
"required": false
},
"timezone1_DST": {
"label": "timezone1_DST",
"type": "string",
"required": false
},
"utc_offset1_DST": {
"label": "utc_offset1_DST",
"type": "string",
"required": false
},
"timezone2": {
"label": "timezone2",
"description": "A second timezone field for larger areas such as a Province.",
"type": "string",
"required": false
},
"utc_offset2": {
"label": "utc_offset2",
"type": "string",
"required": false
},
"timezone2_DST": {
"label": "timezone2_DST",
"type": "string",
"required": false
},
"utc_offset2_DST": {
"label": "utc_offset2_DST",
"type": "string",
"required": false
},
"postal_code_type": {
"label": "postal_code_type",
"description": "Label used for postal code info, e.g. 'ZIP Code'. Defaults to 'Postal code'.",
"type": "string",
"required": false
},
"postal_code": {
"label": "postal_code",
"description": "Postal code/zip code",
"type": "string",
"required": false
},
"postal2_code_type": {
"label": "postal2_code_type",
"type": "string",
"required": false
},
"postal2_code": {
"label": "postal2_code",
"type": "string",
"required": false
},
"area_code": {
"label": "area_code",
"description": "Telephone area code.",
"type": "string",
"required": false
},
"area_code_type": {
"label": "area_code_type",
"description": "If left blank/not used template will default to 'Area code(s)'",
"type": "string",
"required": false
},
"geocode": {
"label": "geocode",
"description": "See Geocode",
"type": "string",
"required": false
},
"iso_code": {
"label": "iso_code",
"description": "See ISO 3166",
"type": "string",
"required": false
},
"registration_plate": {
"label": "registration_plate",
"description": "See Vehicle registration plate",
"type": "string",
"required": false
},
"blank_name_sec1": {
"label": "blank_name_sec1",
"description": "Fields used to display other information. The name is displayed in bold on the left side of the infobox.",
"type": "string",
"required": false
},
"blank_info_sec1": {
"label": "blank_info_sec1",
"description": "The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]",
"type": "string",
"required": false
},
"blank1_name_sec1": {
"label": "blank1_name_sec1",
"description": "Up to 7 additional fields 'blank1_name_sec1' ... 'blank7_name_sec1' can be specified",
"type": "string",
"required": false
},
"blank1_info_sec1": {
"label": "blank1_info_sec1",
"description": "Up to 7 additional fields 'blank1_info_sec1' ... 'blank7_info_sec1' can be specified",
"type": "string",
"required": false
},
"blank_name_sec2": {
"label": "blank_name_sec2",
"description": "For a second section of blank fields",
"type": "string",
"required": false
},
"blank_info_sec2": {
"label": "blank_info_sec2",
"description": "Example: Beijing",
"type": "string",
"required": false
},
"blank1_name_sec2": {
"label": "blank1_name_sec2",
"description": "Up to 7 additional fields 'blank1_name_sec2' ... 'blank7_name_sec2' can be specified",
"type": "string",
"required": false
},
"blank1_info_sec2": {
"label": "blank1_info_sec2",
"description": "Up to 7 additional fields 'blank1_info_sec2' ... 'blank7_info_sec2' can be specified",
"type": "string",
"required": false
},
"website": {
"label": "website",
"description": "External link to official website, Use the {{URL}} template, thus: {{URL|example.com}}",
"type": "string",
"required": false
},
"footnotes": {
"label": "footnotes",
"description": "Text to be displayed at the bottom of the infobox.",
"type": "string",
"required": false
}
},
"format": "{{_\n| _______________________________ = _\n}}\n",
"paramOrder": [
"name",
"official_name",
"native_name",
"native_name_lang",
"other_name",
"settlement_type",
"translit_lang1",
"translit_lang1_type",
"translit_lang1_info",
"translit_lang2",
"image_skyline",
"imagesize",
"image_alt",
"image_caption",
"image_flag",
"flag_size",
"flag_alt",
"flag_border",
"flag_link",
"image_seal",
"seal_size",
"seal_alt",
"seal_link",
"image_shield",
"shield_size",
"shield_alt",
"shield_link",
"image_blank_emblem",
"blank_emblem_type",
"blank_emblem_size",
"blank_emblem_alt",
"blank_emblem_link",
"nickname",
"motto",
"anthem",
"image_map",
"mapsize",
"map_alt",
"map_caption",
"image_map1",
"mapsize1",
"map_alt1",
"map_caption1",
"pushpin_map",
"pushpin_label_position",
"pushpin_map_alt",
"pushpin_mapsize",
"pushpin_map_caption",
"pushpin_relief",
"pushpin_overlay",
"coordinates",
"coor_pinpoint",
"coordinates_footnotes",
"subdivision_type",
"subdivision_name",
"subdivision_type1",
"subdivision_type2",
"subdivision_type3",
"subdivision_type4",
"subdivision_type5",
"subdivision_type6",
"subdivision_name1",
"subdivision_name2",
"subdivision_name3",
"subdivision_name4",
"subdivision_name5",
"subdivision_name6",
"established_title",
"established_date",
"established_title1",
"established_date1",
"established_title2",
"established_date2",
"established_title3",
"established_date3",
"extinct_title",
"extinct_date",
"founder",
"named_for",
"seat_type",
"seat",
"parts_type",
"parts_style",
"parts",
"p1",
"government_footnotes",
"government_type",
"governing_body",
"leader_party",
"leader_title",
"leader_name",
"leader_title1",
"leader_name1",
"total_type",
"unit_pref",
"area_footnotes",
"area_magnitude",
"dunam_link",
"area_total_km2",
"area_total_ha",
"area_total_sq_mi",
"area_total_acre",
"area_total_dunam",
"area_land_km2",
"area_land_sq_mi",
"area_land_ha",
"area_land_dunam",
"area_land_acre",
"area_water_km2",
"area_water_sq_mi",
"area_water_ha",
"area_water_dunam",
"area_water_acre",
"area_water_percent",
"area_urban_km2",
"area_urban_sq_mi",
"area_urban_ha",
"area_urban_dunam",
"area_urban_acre",
"area_rural_km2",
"area_rural_sq_mi",
"area_rural_ha",
"area_rural_dunam",
"area_rural_acre",
"area_metro_km2",
"area_metro_sq_mi",
"area_metro_ha",
"area_metro_dunam",
"area_metro_acre",
"area_rank",
"area_blank1_title",
"area_blank1_km2",
"area_blank1_sq_mi",
"area_blank1_ha",
"area_blank1_dunam",
"area_blank1_acre",
"area_blank2_title",
"area_blank2_km2",
"area_blank2_sq_mi",
"area_blank2_ha",
"area_blank2_dunam",
"area_blank2_acre",
"area_note",
"dimensions_footnotes",
"length_km",
"length_mi",
"width_km",
"width_mi",
"elevation_footnotes",
"elevation_m",
"elevation_ft",
"elevation_min_m",
"elevation_min_ft",
"elevation_max_footnotes",
"elevation_min_footnotes",
"population_total",
"population_as_of",
"population_footnotes",
"population_density_km2",
"population_density_sq_mi",
"population_est",
"pop_est_as_of",
"pop_est_footnotes",
"population_urban",
"population_urban_footnotes",
"population_density_urban_km2",
"population_density_urban_sq_mi",
"population_rural",
"population_rural_footnotes",
"population_density_rural_km2",
"population_density_rural_sq_mi",
"population_metro",
"population_metro_footnotes",
"population_density_metro_km2",
"population_density_metro_sq_mi",
"population_rank",
"population_density_rank",
"population_blank1_title",
"population_blank1",
"population_density_blank1_km2",
"population_density_blank1_sq_mi",
"population_blank2_title",
"population_blank2",
"population_density_blank2_km2",
"population_density_blank2_sq_mi",
"population_demonym",
"population_note",
"demographics_type1",
"demographics1_footnotes",
"demographics1_title1",
"demographics1_info5",
"demographics_type2",
"demographics2_footnotes",
"demographics2_title1",
"demographics2_info1",
"timezone1",
"utc_offset1",
"timezone1_DST",
"utc_offset1_DST",
"timezone2",
"utc_offset2",
"timezone2_DST",
"utc_offset2_DST",
"postal_code_type",
"postal_code",
"postal2_code_type",
"postal2_code",
"area_code",
"area_code_type",
"geocode",
"iso_code",
"registration_plate",
"blank_name_sec1",
"blank_info_sec1",
"blank1_name_sec1",
"blank1_info_sec1",
"blank_name_sec2",
"blank_info_sec2",
"blank1_name_sec2",
"blank1_info_sec2",
"website",
"footnotes"
]
}
</templatedata>
{{collapse bottom}}
== Tracking categories ==
* {{clc|Settlement articles requiring maintenance}}
* {{clc|Infobox settlement uses with imprecise region codes}}
* {{clc|Pages using infobox settlement with a dot map}}
* {{clc|Pages using infobox settlement with the image parameter}}
* {{clc|Pages using infobox settlement with unknown parameters}}
* {{clc|Pages using infobox settlement with the wikidata parameter}}
* {{clc|Infobox settlement pages with bad settlement type}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:City infobox templates|Settlement]]
[[Category:Geography infobox templates|Settlement]]
[[Category:Infobox templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
51d307c3b4975e22a2f278ae87075c1fba0aad51
Template:Infobox settlement/impus
10
53
104
2021-06-05T23:18:17Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/impus]]
wikitext
text/x-wiki
<includeonly>{{formatnum:{{{impv}}}{{{s| }}}{{{impu|ft}}}{{#ifeq:{{{impv|0}}}|1||{{#ifeq:{{{s}}}|/||{{#ifeq:{{{impu}}}|acre|s}}}}}} ({{{metv}}}{{{s| }}}{{{metu|m}}})}}</includeonly><noinclude>
{{documentation}}
</noinclude>
dda38e109b88a534c8c1e05229f03ba2025505bb
Template:Infobox settlement/impus/mag
10
54
106
2021-06-05T23:18:17Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/impus/mag]]
wikitext
text/x-wiki
<includeonly>{{formatnum:[[1 E+{{order of magnitude|({{{metv|1}}}E{{#ifeq:{{{metu}}}|ha|4|6}})}}_m²|{{{impv}}}{{{s| }}}{{{impu|ft}}}{{#ifeq:{{{impv|0}}}|1||{{#ifeq:{{{s}}}|/||{{#ifeq:{{{impu}}}|acre|s}}}}}}]] ({{{metv}}}{{{s| }}}{{{metu|m}}})}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8da7df52cbe6d9ab4d42df8f735aa5f59ce0620a
Template:Infobox settlement/link
10
25
48
2021-06-05T23:18:18Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/link]]
wikitext
text/x-wiki
{{#if:{{{link|}}}<!--
-->|[[{{{link}}}|{{{type}}}]]<!--
-->|{{#ifexist:{{{type}}} of {{PAGENAME}}<!--
-->|[[{{{type}}} of {{PAGENAME}}|{{{type|}}}]]<!--
-->|{{#if:{{{name|}}}<!--
-->|{{#ifexist:{{{type}}} of {{{name}}}<!--
-->|[[{{{type}}} of {{{name}}}|{{{type|}}}]]<!--
-->|{{{type}}}<!--
-->}}<!--
-->|{{{type}}}<!--
-->}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
7f1193f6be51d8bf296df176cd7c49b5d819202e
Template:Infobox settlement/lengthdisp
10
55
108
2021-06-05T23:18:18Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/lengthdisp]]
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#if:{{{km|}}}{{{m|}}}
|{{{km|}}}{{{m|}}}
|{{#if:{{{mi|}}}
|{{rnd
|{{#expr:{{formatnum:{{{mi}}}|R}}*1.609344}}
|{{precision|{{formatnum:{{{mi}}}|R}}}}
}}
|{{rnd
|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}
|{{max/2
|{{precision|{{formatnum:{{{ft}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}}}
}}
}}
}}
}}
|metu={{#if:{{{km|}}}{{{mi|}}}|k}}m
|impv={{#if:{{{mi|}}}{{{ft|}}}
|{{{mi|}}}{{{ft|}}}
|{{#if:{{{km|}}}
|{{rnd
|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}
|{{max/2
|{{precision|{{formatnum:{{{km}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}}}
}}
}}
|{{rnd
|{{#expr:{{formatnum:{{{m}}}|R}}/0.3048}}
|{{precision|{{formatnum:{{{m}}}|R}}}}
}}
}}
}}
|impu={{#if:{{{km|}}}{{{mi|}}}|mi|ft}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
ead48cdb9b6be6cff9f0957b80c5b3bc81f5cba4
Template:Infobox settlement/pref
10
56
110
2021-06-05T23:18:18Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_settlement/pref]]
wikitext
text/x-wiki
<includeonly>{{#switch:{{ucfirst:{{{1}}}}}
|Imperial
|English
|UK|US|U.S.
|US Customary|U.S. Customary
|Standard = impus
|{{#switch:{{{2}}}
|[[United Kingdom]]|United Kingdom
|[[United States]]|United States
|[[United States of America]]|United States of America
|[[United States|United States of America]]
|[[Image:Flag of the United States.svg|20px]] [[United States]] = impus
|{{#ifeq:{{{3}}}_{{lc:{{{1}}}}}|area_dunam|dunam|metric}}
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
7f7165e08b34afaaf9f84a31965beb8f3e8a21b8
Template:Intricate template
10
57
112
2021-06-05T23:18:19Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Intricate_template]]
wikitext
text/x-wiki
{{ombox
| type = style
| image = [[Image:Ambox warning yellow.svg|40x40px|alt=|link=]]
| text =
'''This {{{namespace|template}}} employs intricate features of template syntax.'''
<div style="padding-bottom:2px;">You are encouraged to familiarise yourself with its setup and [[m:Help:Parser function|parser functions]] before editing the template. If your edit causes unexpected problems, please [[Help:Reverting#Undo|undo]] it quickly, as this template may appear on a large number of pages.<br/>
You can conduct experiments, and should test all major changes, in either <span class="nowraplinks">[[{{#ifexist:{{FULLPAGENAME}}/Sandbox|/Sandbox|{{#ifexist:{{FULLPAGENAME}}/test sandbox|/test sandbox|{{#ifexist:{{FULLPAGENAME}}/Test sandbox|/Test sandbox|{{#ifexist:{{FULLPAGENAME}}/test|/test|{{#ifexist:{{FULLPAGENAME}}/Test|/Test|/sandbox}}}}}}}}}}|this template's sandbox]]</span>, the [[Template:Template sandbox|general template sandbox]], or your user space before changing anything here.</div>
}}<includeonly>{{#ifeq: {{PAGENAME}} | {{BASEPAGENAME}} | [[Category:Intricate templates]] }}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
591b77da2109625af171ef6249f7550e7728f835
Template:Lang-fr
10
58
114
2021-06-05T23:18:19Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Lang-fr]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=fr
}}</includeonly><noinclude>
{{documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates]]
{{En-WP attribution notice|Template:Lang-fr}}
</noinclude>
14cf10941463c55598f55c6b732b59970e7b9be1
Template:Lang-la
10
59
116
2021-06-05T23:18:19Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Lang-la]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=la
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates|Lang-la]]
</noinclude>
857a9546fa526081f76dedb413402ec3abe57e3f
Template:Lang-mia
10
60
118
2021-06-05T23:18:19Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Lang-mia]]
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=mia
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Native American multilingual support templates]]
</noinclude>
62c4605b15908cf267b9bdcd26e7ef179a9d2f35
Template:Max
10
63
124
2021-06-05T23:18:21Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Max]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|max}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
f052e3a9b5b08740be624045e49f31d86e09f0ad
Template:Max/2
10
64
126
2021-06-05T23:18:21Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Max/2]]
wikitext
text/x-wiki
#redirect [[Template:Max]]
20f0291b77f878e1754f580aab1804aca4fe429f
Template:Ombox
10
66
130
2021-06-05T23:18:22Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Ombox]]
wikitext
text/x-wiki
{{#invoke:Message box|ombox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
0e54065432d540737b9e56c4e3a8e7f74d4534ea
Template:Order of magnitude
10
67
132
2021-06-05T23:18:22Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Order_of_magnitude]]
wikitext
text/x-wiki
<includeonly>{{{{{|safesubst:}}}#ifexpr:{{{1|0}}}=0
|{{{{{|safesubst:}}}#ifexpr:abs{{{1|0}}}1=1
|0
|{{{{{|safesubst:}}}#expr:floor((ln(abs{{{1}}}1)/ln10)+1)}}
}}
|{{#expr:floor((ln(abs({{{1|0}}}) )/ln 10)+1E((abs{{{1|0}}}>1E100 or abs{{{1|0}}}<1E-100)-14))}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
cdfaf15a862b5c629573701fb54acfb4ebf6e9d5
Template:Polparty
10
68
134
2021-06-05T23:18:23Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Polparty]]
wikitext
text/x-wiki
{{#switch: {{ucfirst:{{{1}}}}}
| AT | Austria | [[Austria]] = {{#switch: {{uc:{{{2}}}}}
| SPÖ = [[Social Democratic Party of Austria|SPÖ]]
| ÖVP = [[Austrian People's Party|ÖVP]]
| FPÖ = [[Freedom Party of Austria|FPÖ]]
| BZÖ = [[Alliance for the Future of Austria|BZÖ]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| AU | Australia | [[Australia]] = {{#switch: {{uc:{{{2}}}}}
| ALP = [[Australian Labor Party|ALP]]
| CLP = [[Country Liberal Party|CLP]]
| LP = [[Liberal Party of Australia|Lib.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrats | Dem = [[Australian Democrats|Dem.]]
| Greens | Green = [[Australian Greens|Greens]]
| Labor | Lab = [[Australian Labor Party|ALP]]
| Liberal | Lib = [[Liberal Party of Australia|Lib.]]
| National | Nat = [[National Party of Australia|Nat.]]
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| CA | Canada | [[Canada]] = {{#switch: {{uc:{{{2}}}}}
| BQ = [[Bloc Québécois|BQ]]
| CPC = [[Conservative Party of Canada|CPC]]
| LPC = [[Liberal Party of Canada|LPC]]
| NDP = [[New Democratic Party|NDP]]
| GPC = [[Green Party of Canada|Green]]
| FPNP = [[First Peoples National Party of Canada|FPNP]]
| CHP = [[Christian Heritage Party of Canada|CHP]]
| WBP = [[Western Block Party|WBP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| CZ | Czechia | [[Czechia]] | [[Czech Republic]] | Czech Republic = {{#switch: {{uc:{{{2}}}}}
| ODS = [[Civic Democratic Party|ODS]]
| CSSD = [[Czech Social Democratic Party|ČSSD]]
| KSCM = [[Communist Party of Bohemia and Moravia|KSČM]]
| KDU-CSL = [[Christian and Democratic Union – Czechoslovak People's Party|KDU-ČSL]]
| SZ = [[Green Party (Czech Republic)|Greens]]
| US-DEU = [[Freedom Union–Democratic Union|US-DEU]]
| LIRA = [[Liberal Reform Party|LIRA]]
| SNK = [[SNK European Democrats|SNK ED]]
| NEZDEM = [[Independent Democrats (Czech Republic)|Ind. Dem.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| DE | Germany | [[Germany]] = {{#switch: {{uc:{{{2}}}}}
| CDU = [[Christian Democratic Union (Germany)|CDU]]
| CSU = [[Christian Social Union of Bavaria|CSU]]
| SPD = [[Social Democratic Party of Germany|SPD]]
| FDP = [[Free Democratic Party (Germany)|FDP]]
| PDS = [[The Left (Germany)|Left]]
| FW |FWG = [[Freie Wähler|FW]]
| DDP = [[German Democratic Party|DDP]]
| NS | NSDAP = [[Nazi Party|NSDAP]]
| ODP | ÖDP = [[Ecological Democratic Party|ÖDP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Left | Linke | The Left = [[The Left (Germany)|Left]]
| Green | Greens | Grün | Grüne | Bündnis 90/Die Grünen = [[Alliance '90/The Greens|Greens]]
| Freie Wähler | Freie wähler = [[Freie Wähler|FW]]
| Centre | Zentrum = [[Centre Party (Germany)|Centre]]
| Nazi = [[Nazi Party|NSDAP]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| NL | Netherlands | [[Netherlands]] | The Netherlands | [[The Netherlands]] | Holland | NL = {{#switch: {{uc:{{{2}}}}}
| CDA = [[Christian Democratic Appeal|CDA]]
| CU = [[ChristianUnion|CU]]
| D66 = [[Democrats 66|D66]]
| GL = [[GreenLeft|GL]]
| PVV = [[Party for Freedom|PVV]]
| SGP = [[Reformed Political Party|SGP]]
| SP = [[Socialist Party (Netherlands)|SP]]
| VVD = [[People's Party for Freedom and Democracy|VVD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Groen = [[GreenLeft|GL]]
| PvdA | Pvda = [[Labour Party (Netherlands)|PvdA]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| CH | Switzerland | [[Switzerland]] = {{#switch: {{uc:{{{2}}}}}
| FDP | PRD | RAD | FDP/PRD = [[Free Democratic Party of Switzerland|FDP/PRD]]
| PLR = [[Free Democratic Party of Switzerland|FDP/PRD/PLR]]
| PLC = [[Free Democratic Party of Switzerland|FDP/PRD/PLC]]
| SPS | PSS | SP | PS | SP/PS | SPS/PSS | SOC = [[Social Democratic Party of Switzerland|SPS/PSS]]
| SVP | UDC | SVP/UDC = [[Swiss People's Party|SVP/UDC]]
| PPS = [[Swiss People's Party|SVP/UDC/PPS]]
| CVP | PDC | CVP/PDC = [[Christian Democratic People's Party of Switzerland|CVP/PDC]]
| PPD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PPD]]
| PCD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PCD]]
| GPS | PES = [[Green Party of Switzerland|GPS/PES]]
| GLP = [[Green Liberal Party of Switzerland|GLP]]
| PLS | LPS | LIB = [[Liberal Party of Switzerland|LPS/PLS]]
| EVP | PEV = [[Evangelical People's Party of Switzerland|EVP/PEV]]
| Ticino League | Lega = [[Ticino League]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green = [[Green Party of Switzerland|GPS]]
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = [[List of political parties in Switzerland|{{{2}}}]] }}
}}
| US | United States | [[United States]] | USA | [[USA]] = {{#switch: {{uc:{{{2}}}}}
| D = [[Democratic Party (United States)|D]]
| R = [[Republican Party (United States)|R]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrat = [[Democratic Party (United States)|D]]
| Republican = [[Republican Party (United States)|R]]
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| ZA | South Africa | [[South Africa]] = {{#switch: {{uc:{{{2}}}}}
| ANC | African National Congress = [[African National Congress|ANC]]
| DA | Democratic Alliance = [[Democratic Alliance (South Africa)|DA]]
| IFP | Inkatha Freedom Party = [[Inkatha Freedom Party|IFP]]
| NFP | National Freedom Party = [[National Freedom Party|NFP]]
| COPE | Congress of the People = [[Congress of the People (South African political party)|COPE]]
| FF+ | Freedom Front Plus = [[Freedom Front Plus]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| Independent | [[Independent]] | Ind | Ind. | Neutral = [[Independent (politician)|Ind.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2|{{{1|}}}}}} }}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
8c1c0927009300f0af978af00757aa82a1c90103
Template:Precision
10
69
136
2021-06-05T23:18:23Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Precision]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|precision|{{{1|0}}}|check_fraction=true}}</includeonly><noinclude>
{{documentation}}
</noinclude>
944a0e5e6c5ace1e2a418c7969c645313b30395a
Template:Rnd
10
72
142
2021-06-05T23:18:24Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Rnd]]
wikitext
text/x-wiki
<includeonly>{{#iferror:{{#expr:{{{2|0}}}}} |
[[Category:Pages with bad rounding precision]]{{hid|Bad rounding here}}<!--
-->{{#invoke:Math|precision_format| {{{1}}} | 1-{{order of magnitude|{{{1}}}}} }}|
{{#invoke:Math|precision_format| {{{1}}} | {{{2|0}}}}}}}</includeonly><noinclude>
{{documentation}}
</noinclude>
eeffdb0228ab9358f619fbdd6639bbcc43095edf
Template:Sandbox other
10
73
144
2021-06-05T23:18:24Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Sandbox_other]]
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Template other
10
8
14
2021-06-05T23:18:26Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Template_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:UF-hcard-geo
10
81
160
2021-06-05T23:18:27Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:UF-hcard-geo]]
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard| hCard microformat]], which makes the place-name and location [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to an address book. Within the hCard is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[Geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
If the place or venue has an "established", "founded", "opened" or similar date, use {{tl|start date}} [[Wikipedia:WikiProject Microformats/dates|unless the date is before 1583 CE]].
If it has a URL, use {{tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist/microformat|
*adr
*agent
*category
*county-name
*extended-address
*fn
*label
*locality
*nickname
*note
*org
*region
*street-address
*uid
*url
*vcard
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist/microformat|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''
=== Precision ===
When giving coordinates, '''please use an [[Wikipedia:WikiProject Geographical coordinates#Precision|appropriate level of precision]]'''. Do '''not''' use {{tl|coord}}'s {{para|name}} parameter.<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |
[[Category:Templates with coordinates fields]]
[[Category:Templates generating hCards and Geo]]
}}</includeonly><noinclude>
[[Category:Microformat (uF) message templates]]
</noinclude>
==TemplateData==
{{TemplateData header}}
251bb76dc03ed2c0527a8506372cbe12f0e286a3
Template:Uses Wikidata
10
83
164
2021-06-05T23:18:28Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Uses_Wikidata]]
wikitext
text/x-wiki
{{Sister project
| position = {{{position|}}}
| project = data
| text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see [[#{{{section}}}|§ {{{section}}}]] for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}:
{{#invoke:Uses Wikidata|usesProperty}}
}}}}{{#switch:{{SUBPAGENAME}}
|sandbox |testcases |doc= <!--no category-->
|#default={{#ifeq:{{PAGENAME}} |Uses Wikidata ||{{module other |[[Category:Modules using data from Wikidata]] |{{template other |[[Category:Templates using data from Wikidata]]}} }} }}
}}<!--
--><noinclude>{{documentation}}</noinclude>
4b6f6f2ef4c6d4b84fa8aab733189b440b156a3f
Module:Citation/CS1
828
85
168
2021-06-05T23:18:29Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local dates, year_date_check, reformat_dates, date_hyphen_to_dash, -- functions in Module:Citation/CS1/Date_validation
date_name_xlate
local is_set, in_array, substitute, error_comment, set_error, select_one, -- functions in Module:Citation/CS1/Utilities
add_maint_cat, wrap_style, safe_for_italics, is_wikilink, make_wikilink,
strip_apostrophe_markup;
local z ={}; -- tables in Module:Citation/CS1/Utilities
local extract_ids, extract_id_access_levels, build_id_list, is_embargoed; -- functions in Module:Citation/CS1/Identifiers
local make_coins_title, get_coins_pages, COinS; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
delare variables here that have page-wide scope that are not brought in from other modules; thatare created here
and used here
]]
local added_deprecated_cat; -- boolean flag so that the category is added only once
local added_prop_cats = {}; -- list of property categories that have been added to z.properties_cats
local added_vanc_errs; -- boolean flag so we only emit one Vancouver error / category
local Frame; -- holds the module's frame table
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.properties_cats using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local function add_prop_cat (key, arguments)
if not added_prop_cats [key] then
added_prop_cats [key] = true; -- note that we've added this category
key = key:gsub ('(foreign_lang_source_?2?)%a%a%a?[%a%-]*', '%1'); -- strip lang code from keyname
table.insert( z.properties_cats, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a boolean declared in page scope variables above
]]
local function add_vanc_error (source)
if not added_vanc_errs then
added_vanc_errs = true; -- note that we've added this category
table.insert( z.message_tail, { set_error( 'vancouver', {source}, true ) } );
end
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a uri scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of tlds: https://www.iana.org/domains/root/db
rfc952 (modified by rfc 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the tld. tld
is two or more alpha characters. Any preceding '//' (from splitting a url with a scheme) will be stripped
here. Perhaps not necessary but retained incase it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ascii characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the tld) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and tld or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at wikisource
return false;
end
local patterns = { -- patterns that look like urls
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and cctld (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and tld
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a url is a url
end
end
for _, d in ipairs ({'cash', 'company', 'today', 'org'}) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a url appear to be a valid url; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when url is protocol relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a url into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following tld) (if any) and any path(/), query(?) or fragment(#).
If protocol relative url, return nil scheme and domain else return nil for both scheme and domain.
When not protocol relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol relative url
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link= etc for properly formatted content: no wikilinks, no urls
Link parameters are to hold the title of a wikipedia article so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki urls and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid url (the
|<param>-link= parameter is ok); else false when value appears to be a valid url (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from url;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid url
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wikilinked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
end
end
if is_set (orig) then
table.insert( z.message_tail, { set_error( 'bad_paramlink', orig)}); -- url or wikilink in |title= with |title-link=;
end
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the url into scheme and domain
portions, or for protocol relative (//example.com) urls, just the domain. Use is_url() to validate the two
portions of the url. If both are valid, or for protocol relative if domain is valid, return true, else false.
Because it is different from a standard url, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper url
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from url;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid url
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a url. The test will also find external wikilinks
that use protocol relative urls. Also finds bare urls.
The frontier pattern prevents a match on interwiki links which are similar to scheme:path urls. The tests that
find bracketed urls are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol relative ext wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare url with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol relative bare url: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a url
end
return is_url (scheme, domain); -- return true if value appears to be a valid url
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list)
local error_message = '';
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a url add an error message
if is_set(error_message) then -- once we've added the first portion of the error message ...
error_message=error_message .. ", "; -- ... add a comma space separator
end
error_message=error_message .. "|" .. k .. "="; -- add the failed parameter
end
end
if is_set (error_message) then -- done looping, if there is an error message, display it
table.insert( z.message_tail, { set_error( 'param_has_ext_link', {error_message}, true ) } );
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
table.insert( z.message_tail, { set_error( 'wikilink_in_url', {}, true ) } );
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link( URL, label, source, access)
local error_str = "";
local domain;
local path;
local base_url;
if not is_set( label ) then
label = URL;
if is_set( source ) then
error_str = set_error( 'bare_url_missing_title', { wrap_style ('parameter', source) }, false, " " );
else
error( cfg.messages["bare_url_no_origin"] );
end
end
if not check_url( URL ) then
error_str = set_error( 'bad_url', {wrap_style ('parameter', source)}, false, " " ) .. error_str;
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the url into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['[']='%5b',[']']='%5d'}); -- replace '[' and ']' with their percent encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wikimarkup url
if is_set (access) then -- access level (subscription, registration, limited)
base_url = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return table.concat ({base_url, error_str});
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
table.insert( z.message_tail, { set_error( 'deprecated_params', {name}, true ) } ); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the Module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wikimarkup) are not kerned.
Replaces unicode quotemarks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc; not for book titles.
]=]
local function kern_quotes (str)
local cap='';
local cap2='';
local wl_type, label, link;
wl_type, label, link = is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = substitute (cfg.presentation['kern-wl-both'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = substitute (cfg.presentation['kern-wl-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = substitute (cfg.presentation['kern-wl-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label= mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label= mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap, cap2 = mw.ustring.match (label, "^([\"\'])([^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if is_set (cap) then
label = substitute (cfg.presentation['kern-left'], {cap, cap2});
end
cap, cap2 = mw.ustring.match (label, "^(.+[^\'])([\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if is_set (cap) then
label = substitute (cfg.presentation['kern-right'], {cap, cap2});
end
if 2 == wl_type then
str = make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate rtl languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
-- if script_value:match('^%l%l%s*:') then -- if first 3 non-space characters are script language prefix
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
-- lang = script_value:match('^(%l%l)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not is_set (lang) then
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'missing title part'}, true ) } ); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_code_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if is_set (name) then -- is prefix a proper ISO 639-1 language code?
-- script_value = script_value:gsub ('^%l%l%s*:%s*', ''); -- strip prefix from script
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if in_array (lang, cfg.script_lang_codes) then
add_prop_cat ('script_with_name', {name, lang})
else
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'unknown language code'}, true ) } ); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'invalid language code'}, true ) } ); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'missing prefix'}, true ) } ); -- no language code prefix; add error message
end
script_value = substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is rtl
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script value has been
wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang atribute, categorization, etc; returns empty string on error
if is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not is_set( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return substitute( msg, str ); -- including template text
else
return substitute( cfg.messages[key], str );
end
end
--[[--------------------------< W I K I S O U R C E _ U R L _ M A K E >----------------------------------------
makes a wikisource url from wikisource interwiki link. returns the url and appropriate label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
wl_type, D, L = is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if is_set (str) then
ws_url = table.concat ({ -- build a wikisource url
'https://en.wikisource.org/wiki/', -- prefix
str, -- article title
});
ws_label = str; -- label for the url
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if is_set (str) then
ws_url = table.concat ({ -- build a wikisource url
'https://en.wikisource.org/wiki/', -- prefix
str, -- article title
});
ws_label = str; -- label for the url
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a wikisource url
'https://en.wikisource.org/wiki/', -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable url
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent encoding of anchor
end
return ws_url, ws_label, L or D; -- return proper url or nil and a label or nil
end
--[[--------------------------< F O R M A T _ P E R I O D I C A L >--------------------------------------------
Format the four periodical parameters: |script-<periodical>=, |<periodical>=, and |trans-<periodical>= into a single Periodical meta-
parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
local periodical_error = '';
if not is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
if is_set (trans_periodical) then
trans_periodical = wrap_style ('trans-italic-title', trans_periodical);
if is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when transchapter without chapter or script-chapter
periodical = trans_periodical;
periodical_error = ' ' .. set_error ('trans_missing_title', {'periodical'});
end
end
return periodical .. periodical_error;
end
--[[--------------------------< F O R M A T _ C H A P T E R _ T I T L E >--------------------------------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=, and |chapter-url= into a single Chapter meta-
parameter (chapter_url_source used for error messages).
]]
local function format_chapter_title (scriptchapter, script_chapter_source, chapter, transchapter, chapterurl, chapter_url_source, no_quotes, access)
local chapter_error = '';
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource url and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ''); -- replace underscore separaters with space characters
chapter = ws_label;
end
if not is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from Module provided quote marks
chapter = wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, scriptchapter, script_chapter_source); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
if is_set (chapterurl) then
chapter = external_link (chapterurl, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if is_set (transchapter) then
transchapter = wrap_style ('trans-quoted-title', transchapter);
if is_set (chapter) then
chapter = chapter .. ' ' .. transchapter;
else -- here when transchapter without chapter or script-chapter
chapter = transchapter;
chapter_error = ' ' .. set_error ('trans_missing_title', {'chapter'});
end
end
-- if is_set (chapterurl) then
-- chapter = external_link (chapterurl, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
-- end
return chapter .. chapter_error;
end
--[[--------------------------< H A S _ I N V I S I B L E _ C H A R S >----------------------------------------
This function searches a parameter's value for nonprintable or invisible characters. The search stops at the
first match.
This function will detect the visible replacement character when it is part of the wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers (gallery, math, pre, ref)
and identifies them with a slightly different error message. See also coins_cleanup().
Output of this function is an error message that identifies the character or the Unicode group, or the stripmarker
that was detected along with its position (or, for multi-byte characters, the position of its first byte) in the
parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local dummy; -- end of matching string; not used but required to hold end position when a capture is returned
local capture; -- used by stripmarker detection to hold name of the stripmarker
local i=1;
local stripmarker, apostrophe;
capture = string.match (v, '[%w%p ]*'); -- Test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no unicode characters
return;
end
while cfg.invisible_chars[i] do
local char=cfg.invisible_chars[i][1] -- the character or group name
local pattern=cfg.invisible_chars[i][2] -- the pattern used to find it
position, dummy, capture = mw.ustring.find (v, pattern) -- see if the parameter value contains characters that match the pattern
if position and (char == 'zero width joiner') then -- if we found a zero width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- its ok if one of the indic scripts
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and 'delete' == char then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture then
err_msg = capture .. ' ' .. char;
else
err_msg = char .. ' ' .. 'character';
end
table.insert( z.message_tail, { set_error( 'invisible_char', {err_msg, wrap_style ('parameter', param), position}, true ) } ); -- add error message
return; -- and done with this parameter
end
end
i=i+1; -- bump our index
end
end
--[[--------------------------< A R G U M E N T _ W R A P P E R >----------------------------------------------
Argument wrapper. This function provides support for argument mapping defined in the configuration file so that
multiple names can be transparently aliased to single internal variable.
]]
local function argument_wrapper( args )
local origin = {};
return setmetatable({
ORIGIN = function( self, k )
local dummy = self[k]; --force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = select_one( args, list, 'redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = cfg.defaults[k] or '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >--------------------------------------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>. When date is DD MMMM YYYY or is
MMMM DD, YYYY then wrap in nowrap span: <span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap='';
local cap2='';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >----------------------------------------------------
This function sets default title types (equivalent to the citation including |type=<default value>) for those templates that have defaults.
Also handles the special case where it is desirable to omit the title type from the rendered citation (|type=none).
]]
local function set_titletype (cite_class, title_type)
if is_set(title_type) then
if "none" == title_type then
title_type = ""; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate like items; unlike items are
returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash( str )
if not is_set (str) then
return str;
end
str, count = str:gsub ('^%(%((.+)%)%)$', '%1'); -- remove accept-this-as-written markup when it wraps all of str
if 0 ~= count then -- non-zero when markup removed; zero else
return str; -- nothing to do, we're done
end
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace html numeric entity with hyphen character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
if mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous white space
end
end
item = item:gsub ('^%(%((.+)%)%)$', '%1'); -- remove the accept-this-as-written markup
table.insert (out, item); -- add the (possibly modified) item to the output table
end
return table.concat (out, ', '); -- concatenate the output table into a comma separated string
end
--[[--------------------------< S A F E _ J O I N >------------------------------------------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'dupicate character'
if 1 == #duplicate_char then -- for single byte ascii characters use the string library functions
f.gsub=string.gsub
f.match=string.match
f.sub=string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub=mw.ustring.gsub
f.match=mw.ustring.match
f.sub=mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1,1) == '<' then -- Special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove html markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1,1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc?
trim = false;
end_chr = f.sub(str, -1,-1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr.. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1,-2); -- remove it
elseif end_chr == "'" then -- if it might be wikimarkup
if f.sub(str, -3,-1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5,-1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4,-1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wikimarkup
if f.sub(str, -3,-1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3,-1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2,-1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4,-1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2,-1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1,-3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains html markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows html markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; --add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >------------------------------------------------------------
returns true is suffix is properly formed Jr, Sr, or ordinal in the range 2–9. Puncutation not allowed.
]]
local function is_suffix (suffix)
if in_array (suffix, {'Jr', 'Sr', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------------< I S _ G O O D _ V A N C _ N A M E >--------------------------------------------
For Vancouver Style, author/editor names are supposed to be rendered in Latin (read ASCII) characters. When a name
uses characters that contain diacritical marks, those characters are to converted to the corresponding Latin character.
When a name is written using a non-Latin alphabet or logogram, that name is to be transliterated into Latin characters.
These things are not currently possible in this module so are left to the editor to do.
This test allows |first= and |last= names to contain any of the letters defined in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes. (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$") or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written ouside of the code editor and pasted here because the code editor gets confused between character insertion point and cursor position.
The test has been rewritten to use decimal character escape sequence for the individual bytes of the unicode characters so that it is not necessary
to use an external editor to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first)
local first, suffix = first:match ('(.-),?%s*([%dJS][%drndth]+)%.?$') or first; -- if first has something that looks like a generational suffix, get it
if is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error ('suffix');
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error ('non-Latin character');
return false; -- not a string of latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-format=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc) to be rendered as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just intials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error ('suffix'); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and names[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = names[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i],1,1)); -- insert the intial at end of initials table
end
i = i+1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< L I S T _ P E O P L E >-------------------------------------------------------
Formats a list of people (e.g. authors / editors)
]]
local function list_people(control, people, etal)
local sep;
local namesep;
local format = control.format
local maximum = control.maximum
local lastauthoramp = control.lastauthoramp;
local text = {}
if 'vanc' == format then -- Vancouver-like author/editor name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between authors is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
lastauthoramp = nil; -- unset because isn't used by Vancouver style
else
sep = cfg.presentation['sep_nl']; -- name-list separator between authors is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub(-1,-1) ~= " " then sep = sep .. " " end
if is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for authors
for i,person in ipairs(people) do
if is_set(person.last) then
local mask = person.mask
local one
local sep_one = sep;
if is_set (maximum) and i > maximum then
etal = true;
break;
elseif (mask ~= nil) then
local n = tonumber(mask)
if (n ~= nil) then
one = string.rep("—",n)
else
one = mask;
sep_one = " ";
end
else
one = person.last
local first = person.first
if is_set(first) then
if ( "vanc" == format ) then -- if vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials(first) -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
if is_set(person.link) and person.link ~= control.page_name then
one = make_wikilink (person.link, one); -- link author/editor if this page is not the author's/editor's page
end
end
table.insert( text, one )
table.insert( text, sep_one )
end
end
local count = #text / 2; -- (number of names + number of separators) divided by 2
if count > 0 then
if count > 1 and is_set(lastauthoramp) and not etal then
text[#text-2] = " & "; -- replace last separator with ampersand text
end
text[#text] = nil; -- erase the last separator
end
local result = table.concat(text) -- construct list
if etal and is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. ' ' .. cfg.messages['et al']; -- we've go a last-first list and etal so add et al.
end
return result, count
end
--[[--------------------------< A N C H O R _ I D >------------------------------------------------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that order. year is Year or anchor_year.
]]
local function anchor_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< N A M E _ H A S _ E T A L >----------------------------------------------------
Evaluates the content of name parameters (author, editor, etc) for variations on the theme of et al. If found,
the et al. is removed, a flag is set to true and the function returns the modified name and the flag.
This function never sets the flag to false but returns it's previous state because it may have been set by
previous passes through this function or by the associated |display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; --get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
table.insert( z.message_tail, {set_error ('etal', {param})}); -- and set an error if not added
end
end
end
end
return name, etal; --
end
--[[--------------------------< N A M E _ H A S _ E D _ M A R K U P >------------------------------------------
Evaluates the content of author and editor parameters for extranious editor annotations: ed, ed., eds, (Ed.), etc.
These annotation do not belong in author parameters and are redundant in editor parameters. If found, the function
adds the editor markup maintenance category.
]]
local function name_has_ed_markup (name, list_name)
local _, pattern;
local patterns = cfg.editor_markup_patterns; -- get patterns from configuration
if is_set (name) then
for _, pattern in ipairs (patterns) do -- spin through patterns table and
if name:match (pattern) then
add_maint_cat ('extra_text_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
break;
end
end
end
return name; -- and done
end
--[[--------------------------< N A M E _ H A S _ M U L T _ N A M E S >----------------------------------------
Evaluates the content of author and editor (surnames only) parameters for multiple names. Multiple names are
indicated if there is more than one comma and or semicolon. If found, the function adds the multiple name
(author or editor) maintenance category.
]]
local function name_has_mult_names (name, list_name)
local count, _;
if is_set (name) then
_, count = name:gsub ('[;,]', ''); -- count the number of separator-like characters
if 1 < count then -- param could be |author= or |editor= so one separator character is acceptable
add_maint_cat ('mult_names', cfg.special_case_translation [list_name]); -- more than one separator indicates multiple names so add a maint cat for this template
end
end
return name; -- and done
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding
parameters.
]]
local function name_checks (last, first, list_name)
if is_set (last) then
if last:match ('^%(%(.*%)%)$') then -- if wrapped in doubled parentheses, accept as written
last = last:match ('^%(%((.*)%)%)$'); -- strip parens
else
last = name_has_mult_names (last, list_name); -- check for multiple names in the parameter (last only)
last = name_has_ed_markup (last, list_name); -- check for extraneous 'editor' annotation
end
end
if is_set (first) then
if first:match ('^%(%(.*%)%)$') then -- if wrapped in doubled parentheses, accept as written
first = first:match ('^%(%((.*)%)%)$'); -- strip parens
else
first = name_has_ed_markup (first, list_name); -- check for extraneous 'editor' annotation
end
end
return last, first; -- done
end
--[[--------------------------< E X T R A C T _ N A M E S >----------------------------------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters (or their aliases), and their matching link and mask parameters.
Stops searching when both |lastn= and |firstn= are not found in args after two sequential attempts: found |last1=, |last2=, and |last3= but doesn't
find |last4= and |last5= then the search is done.
This function emits an error message when there is a |firstn= without a matching |lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.' is stripped from the parameter and a flag (etal) returned
that will cause list_people() to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps 'et al.' out of the
template's metadata. When this occurs, the page is added to a maintenance category.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal=false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = select_one( args, cfg.aliases[list_name .. '-Last'], 'redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = select_one( args, cfg.aliases[list_name .. '-First'], 'redundant_parameters', i );
link = select_one( args, cfg.aliases[list_name .. '-Link'], 'redundant_parameters', i );
mask = select_one( args, cfg.aliases[list_name .. '-Mask'], 'redundant_parameters', i );
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first= name_checks (last, first, list_name); -- multiple names, extraneous annotation, etc checks
if first and not last then -- if there is a firstn without a matching lastn
table.insert( z.message_tail, { set_error( 'first_missing_last', {first_alias, first_alias:gsub('first', 'last')}, true ) } ); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
link_title_ok (link, list_name:match ("(%w+)List"):lower() .. '-link' .. i, last, list_name:match ("(%w+)List"):lower() .. '-last' .. i); -- check for improper wikimarkup
names[n] = {last = last, first = first, link = link, mask = mask, corporate=false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
table.insert( z.message_tail, { set_error( 'missing_name', {list_name:match ("(%w+)List"):lower(), i-1}, true ) } ); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< G E T _ I S O 6 3 9 _ C O D E >------------------------------------------------
Validates language names provided in |language= parameter if not an ISO639-1 or 639-2 code.
Returns the language name and associated two- or three-character code. Because case of the source may be incorrect
or different from the case that WikiMedia uses, the name comparisons are done in lower case and when a match is
found, the Wikimedia version (assumed to be correct) is returned along with the code. When there is no match, we
return the original language name string.
mw.language.fetchLanguageNames(<local wiki language>, 'all') returns a list of languages that in some cases may include
extensions. For example, code 'cbk-zam' and its associated name 'Chavacano de Zamboanga' (MediaWiki does not support
code 'cbk' or name 'Chavacano'. Most (all?) of these languages are not used a 'language' codes per se, rather they
are used as sub-domain names: cbk-zam.wikipedia.org. A list of language names and codes supported by fetchLanguageNames()
can be found at Template:Citation Style documentation/language/doc
Names that are included in the list will be found if that name is provided in the |language= parameter. For example,
if |language=Chavacano de Zamboanga, that name will be found with the associated code 'cbk-zam'. When names are found
and the associated code is not two or three characters, this function returns only the WikiMedia language name.
Some language names have multiple entries under different codes:
Aromanian has code rup and code roa-rup
When this occurs, this function returns the language name and the 2- or 3-character code
Adapted from code taken from Module:Check ISO 639-1.
]]
local function get_iso639_code (lang, this_wiki_code)
if cfg.lang_name_remap[lang:lower()] then -- if there is a remapped name (because MediaWiki uses something that we don't think is correct)
return cfg.lang_name_remap[lang:lower()][1], cfg.lang_name_remap[lang:lower()][2]; -- for this language 'name', return a possibly new name and appropriate code
end
local ietf_code; -- because some languages have both ietf-like codes and iso 639-like codes
local ietf_name;
local languages = mw.language.fetchLanguageNames(this_wiki_code, 'all') -- get a list of language names known to Wikimedia
-- ('all' is required for North Ndebele, South Ndebele, and Ojibwa)
local langlc = mw.ustring.lower(lang); -- lower case version for comparisons
for code, name in pairs(languages) do -- scan the list to see if we can find our language
if langlc == mw.ustring.lower(name) then
if 2 == code:len() or 3 == code:len() then -- two- or three-character codes only; extensions not supported
return name, code; -- so return the name and the code
end
ietf_code = code; -- remember that we found an ietf-like code and save its name
ietf_name = name; -- but keep looking for a 2- or 3-char code
end
end
-- didn't find name with 2- or 3-char code; if ietf-like code found return
return ietf_code and ietf_name or lang; -- associated name; return original language text else
end
--[[--------------------------< L A N G U A G E _ P A R A M E T E R >------------------------------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code is recognized by MediaWiki,
use the returned name; if not, then use the value that was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is assigned to the category for
that code: Category:Norwegian-language sources (no). For valid three-character code languages, the page is assigned
to the single category for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does not recognize three-character
equivalents of two-character codes: code 'ar' is recognized bit code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th where the language names or codes are
separated from each other by commas.
]]
local function language_parameter (lang)
local code; -- the two- or three-character language code
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_table = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName(cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_table = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_table) do -- reuse lang
name = cfg.lang_code_remap[lang:lower()]; -- first see if this is a code that is not supported by MediaWiki but is in remap
if name then -- there was a remapped code so
if not lang:match ('^%a%a%a?%-x%-%a+$') then -- if not a private ietf tag
lang = lang:gsub ('^(%a%a%a?)%-.*', '%1'); -- strip ietf tags from code
end
else
if lang:match ('^%a%a%-') then -- strip ietf tags from code; TODO: is there a need to support 3-char with tag?
lang = lang:match ('(%a%a)%-') -- keep only 639-1 code portion to lang; TODO: do something with 3166 alpha 2 country code?
end
if 2 == lang:len() or 3 == lang:len() then -- if two-or three-character code
name = mw.language.fetchLanguageName (lang:lower(), cfg.this_wiki_code); -- get language name if |language= is a proper code
end
end
if is_set (name) then -- if |language= specified a valid code
code = lang:lower(); -- save it
else
name, code = get_iso639_code (lang, cfg.this_wiki_code); -- attempt to get code from name (assign name here so that we are sure of proper capitalization)
end
if is_set (code) then -- only 2- or 3-character codes
name = cfg.lang_code_remap[code] or name; -- override wikimedia when they misuse language codes/names
if cfg.this_wiki_code ~= code then -- when the language is not the same as this wiki's language
if 2 == code:len() then -- and is a two-character code
add_prop_cat ('foreign_lang_source' .. code, {name, code}); -- categorize it; code appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character code)
add_prop_cat ('foreign_lang_source_2' .. code, {code}); -- categorize it differently TODO: support mutliple three-character code categories per cs1|2 template
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
add_prop_cat ('local_lang_source', {name, code}); -- categorize it
end
else
add_maint_cat ('unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
code = #language_list -- reuse code as number of languages in the list
if 2 >= code then
name = table.concat (language_list, cfg.messages['parameter-pair-separator']) -- insert '<space>and<space>' between two language names
elseif 2 < code then
name = table.concat (language_list, ', '); -- and concatenate with '<comma><space>' separators
name = name:gsub (', ([^,]+)$', cfg.messages['parameter-final-separator'] .. '%1'); -- replace last '<comma><space>' separator with '<comma><space>and<space>' separator
end
if this_wiki_name == name then
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[--------------------------< S E T _ C S 1 _ S T Y L E >----------------------------------------------------
Set style settings for CS1 citation templates. Returns separator and postscript settings
At en.wiki, for cs1:
ps gets: '.'
sep gets: '.'
]]
local function set_cs1_style (ps)
if not is_set (ps) then -- unless explicitely set to something
ps = cfg.presentation['ps_cs1']; -- terminate the rendered citation
end
return cfg.presentation['sep_cs1'], ps; -- element separator
end
--[[--------------------------< S E T _ C S 2 _ S T Y L E >----------------------------------------------------
Set style settings for CS2 citation templates. Returns separator, postscript, ref settings
At en.wiki, for cs2:
ps gets: '' (empty string - no terminal punctuation)
sep gets: ','
]]
local function set_cs2_style (ps, ref)
if not is_set (ps) then -- if |postscript= has not been set, set cs2 default
ps = cfg.presentation['ps_cs2']; -- terminate the rendered citation
end
if not is_set (ref) then -- if |ref= is not set
ref = "harv"; -- set default |ref=harv
end
return cfg.presentation['sep_cs2'], ps, ref; -- element separator
end
--[[--------------------------< G E T _ S E T T I N G S _ F R O M _ C I T E _ C L A S S >----------------------
When |mode= is not set or when its value is invalid, use config.CitationClass and parameter values to establish
rendered style.
]]
local function get_settings_from_cite_class (ps, ref, cite_class)
local sep;
if (cite_class == "citation") then -- for citation templates (CS2)
sep, ps, ref = set_cs2_style (ps, ref);
else -- not a citation template so CS1
sep, ps = set_cs1_style (ps);
end
return sep, ps, ref -- return them all
end
--[[--------------------------< S E T _ S T Y L E >------------------------------------------------------------
Establish basic style settings to be used when rendering the citation. Uses |mode= if set and valid or uses
config.CitationClass from the template's #invoke: to establish style.
]]
local function set_style (mode, ps, ref, cite_class)
local sep;
if 'cs2' == mode then -- if this template is to be rendered in CS2 (citation) style
sep, ps, ref = set_cs2_style (ps, ref);
elseif 'cs1' == mode then -- if this template is to be rendered in CS1 (cite xxx) style
sep, ps = set_cs1_style (ps);
else -- anything but cs1 or cs2
sep, ps, ref = get_settings_from_cite_class (ps, ref, cite_class); -- get settings based on the template's CitationClass
end
if 'none' == ps:lower() then -- if assigned value is 'none' then
ps = ''; -- set to empty string
end
return sep, ps, ref
end
--[=[-------------------------< I S _ P D F >------------------------------------------------------------------
Determines if a url has the file extension that is one of the pdf file extensions used by [[MediaWiki:Common.css]] when
applying the pdf icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >------------------------------------------------------
Applies css style to |format=, |chapter-format=, etc. Also emits an error message if the format parameter does
not have a matching url parameter. If the format parameter is not set and the url contains a file extension that
is recognized as a pdf document by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if is_set (format) then
format = wrap_style ('format', format); -- add leading space, parentheses, resize
if not is_set (url) then
format = format .. set_error( 'format_missing_url', {fmt_param, url_param} ); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if url is a pdf file then
format = wrap_style ('format', 'PDF'); -- set format to pdf
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[--------------------------< G E T _ D I S P L A Y _ N A M E S >--------------------------------------------
Returns a number that defines the number of names displayed for author and editor name lists and a boolean flag
to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero, return the number and
the previous state of the 'etal' flag (false by default but may have been set to true if the name list contains
some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number that is one greater than the
number of authors in the list and set the 'etal' flag true. This will cause the list_people() to display all of
the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors']; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
]]
local function get_display_names (max, count, list_name, etal)
if is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
add_maint_cat ('disp_name', cfg.special_case_translation [list_name]);
end
else -- not a valid keyword or number
table.insert( z.message_tail, { set_error( 'invalid_param_val', {'display-' .. list_name, max}, true ) } ); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[--------------------------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >------------------------------
Adds page to Category:CS1 maint: extra text if |page= or |pages= has what appears to be some form of p. or pp.
abbreviation in the first characters of the parameter content.
check Page and Pages for extraneous p, p., pp, and pp. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when |page(s)= begins PX or P# but not Px where x and X are letters and # is a dgiit
bad pattern: '^[Pp][Pp]' matches matches when |page(s)= begins pp or pP or Pp or PP
]]
local function extra_text_in_page_check (page)
local good_pattern = '^P[^%.Pp]'; -- ok to begin with uppercase P: P7 (pg 7 of section P) but not p123 (page 123) TODO: add Gg for PG or Pg?
local bad_pattern = '^[Pp]?[Pp]%.?[ %d]';
if not page:match (good_pattern) and (page:match (bad_pattern) or page:match ('^[Pp]ages?')) then
add_maint_cat ('extra_text');
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parnetheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a place holder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parens
local name = name_table[i];
i=i+1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parens
break; -- and done reassembling so
end
i=i+1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i+1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled paranethese ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the vancouver error when a reqired comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
if v_name:match ('^%(%(.+%)%)$') then -- corporate authors are wrapped in doubled parentheses to supress vanc formatting and error detection
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
last = v_name:match ('^%(%((.+)%)%)$') -- remove doubled parntheses
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error ('punctuation');
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be author intials
if is_suffix (first) then -- if a valid suffix
suffix = first -- save it as a suffix and
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end -- no suffix error message here because letter combination may be result of Romanization; check for digits?
last = table.concat(lastfirstTable, " ") -- returns a string that is the concatenation of all other names that are not initials
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error ('missing comma'); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error ('name'); -- matches a space between two intiials
end
else
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error ('initials'); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first); -- check first and last before restoring the suffix which may have a non-Latin digit
if is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '');
end
end
link = select_one( args, cfg.aliases[list_name .. '-Link'], 'redundant_parameters', i ) or v_link_table[i];
mask = select_one( args, cfg.aliases[list_name .. '-Mask'], 'redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate=corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editors=, |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest and
similarly, |editorn= (and aliases) highest and |editors= lowest
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors or editors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if select_one( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice incase we have a |first1= without a |last1=; this ...
select_one( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
select_one( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
select_one( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst=true;
end
if (is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(is_set (vxxxxors) and is_set (xxxxors)) or
(true == lastfirst and is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
table.insert( z.message_tail, { set_error( 'redundant_parameters',
{err_name .. '-name-list parameters'}, true ) } ); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if is_set (vxxxxors) then return 2 end;
if is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
]]
local function is_valid_parameter_value (value, name, possible, ret_val)
if not is_set (value) then
return ret_val; -- an empty parameter is ok
elseif in_array (value, possible) then
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
else
table.insert( z.message_tail, { set_error( 'invalid_param_val', {name, value}, true ) } ); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list,-3,-1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list,-1,-1) == sepc) or (string.sub (name_list,-3,-1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terninate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >----------------------------------------
returns the concatenation of the formatted volume and issue parameters as a single string; or formatted volume
or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, cite_class, origin, sepc, lower)
if not is_set (volume) and not is_set (issue) then
return '';
end
if 'magazine' == cite_class or (in_array (cite_class, {'citation', 'map'}) and 'magazine' == origin) then
if is_set (volume) and is_set (issue) then
return wrap_msg ('vol-no', {sepc, volume, issue}, lower);
elseif is_set (volume) then
return wrap_msg ('vol', {sepc, volume}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
if 'podcast' == cite_class and is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
local vol = ''; -- here for all cites except magazine
if is_set (volume) then
if volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')then -- volume value is all digits or all uppercase roman numerals
vol = substitute (cfg.presentation['vol-bold'], {sepc, hyphen_to_dash(volume)}); -- render in bold face
elseif (4 < mw.ustring.len(volume)) then -- not all digits or roman numerals and longer than 4 characters
vol = substitute (cfg.messages['j-vol'], {sepc, volume}); -- not bold
add_prop_cat ('long_vol');
else -- four or less characters
vol = substitute (cfg.presentation['vol-bold'], {sepc, hyphen_to_dash(volume)}); -- bold
end
end
if is_set (issue) then
return vol .. substitute (cfg.messages['j-issue'], issue);
end
return vol;
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if is_set (page) then
if is_journal then
return substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif is_set(pages) then
if is_journal then
return substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to wikisource, returns the label portion of the interwikilink as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki link to and external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, pages, at)
local ws_url, ws_label, coins_pages, L; -- for wikisource interwikilinks; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if is_set (page) then
if is_set (pages) or is_set(at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page); -- add this page to maint cat if |page= value begins with what looks like p. or pp.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws url from |page= interwiki link; link portion L becomes tool tip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif is_set (pages) then
if is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages); -- add this page to maint cat if |pages= value begins with what looks like p. or pp.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws url from |pages= interwiki link; link portion L becomes tool tip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws url from |at= interwiki link; link portion L becomes tool tip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org urls to make sure they at least look like they are pointing at valid archives and not to the
save snapshot url or to calendar pages. When the archive url is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the url. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org url does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command url
|archive-url= is an archive.org url that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org urls:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this funct may return a modified
archive url:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the url unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.or url
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine url
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command url, we don't want to allow saving of the target page
err_msg = 'save command';
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = 'liveweb';
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the url parts for evaluation
if not is_set(timestamp) or 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = 'timestamp';
if '*' ~= flag then
url=url:gsub ('(//web%.archive%.org/[^%d]*%d?%d?%d?%d?%d?%d?)[^/]*', '%1*', 1) -- for preview, modify ts to be yearmo* max (0-6 digits plus splat)
end
elseif is_set(path) and 'web/' ~= path then -- older archive urls do not have the extra 'web/' path element
err_msg = 'path';
elseif is_set (flag) and not is_set (path) then -- flag not allowed with the old form url (without the 'web/' path element)
err_msg = 'flag';
elseif is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = 'flag';
else
return url, date; -- return archiveURL and ArchiveDate
end
end
-- if here, something not right so
table.insert( z.message_tail, { set_error( 'archive_url', {err_msg}, true ) } ); -- add error message and
if is_set (Frame:preprocess('{{REVISIONID}}')) then
return '', ''; -- return empty strings for archiveURL and ArchiveDate
else
return url, date; -- preview mode so return archiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors mis-use location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
add_maint_cat ('location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args)
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListFormat = is_valid_parameter_value (A['NameListFormat'], A:ORIGIN('NameListFormat'), cfg.keywords_lists['name-list-format'], '');
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListFormat = 'vanc'; -- override whatever |name-list-format= might be
a, author_etal = parse_vauthors_veditors (args, args.vauthors, 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
add_maint_cat ('authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local Others = A['Others'];
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
local Editors;
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], A['Editors'], args, 'EditorList');
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListFormat = 'vanc'; -- override whatever |name-list-format= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
elseif 3 == selected then
Editors = A['Editors']; -- use content of |editors=
add_maint_cat ('editors'); -- but add a maint cat because use of this parameter is discouraged
end
end
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
local Translators; -- assembled translators name list
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local interviewer_etal;
local interviewers_list = {};
local Interviewers; -- used later
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local contributor_etal;
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
local Contributors; -- assembled contributors name list
local Contribution = A['Contribution'];
if in_array(config.CitationClass, {"book","citation"}) and not is_set(A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not is_set (Contribution) then -- |contributor= requires |contribution=
table.insert( z.message_tail, { set_error( 'contributor_missing_required_param', 'contribution')}); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
table.insert( z.message_tail, { set_error( 'contributor_missing_required_param', 'author')}); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if select_one (args, cfg.aliases['ContributorList-Last'], 'redundant_parameters', 1 ) then -- are there contributor name list parameters?
table.insert( z.message_tail, { set_error( 'contributor_ignored')}); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
if is_set (Others) then
if 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
add_maint_cat ('others');
end
end
local Year = A['Year'];
local PublicationDate = A['PublicationDate'];
local OrigYear = A['OrigYear'];
local Date = A['Date'];
local LayDate = A['LayDate'];
------------------------------------------------- Get title data
local Title = A['Title'];
local ScriptTitle = A['ScriptTitle'];
local BookTitle = A['BookTitle'];
local Conference = A['Conference'];
local TransTitle = A['TransTitle'];
local TitleNote = A['TitleNote'];
local TitleLink = A['TitleLink'];
link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wikimarkup in |title-link= or wikimarkup in |title= when |title-link= is set
local Chapter = A['Chapter'];
local ScriptChapter = A['ScriptChapter'];
local ScriptChapterOrigin = A:ORIGIN ('ScriptChapter');
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local TransChapter = A['TransChapter'];
local TitleType = A['TitleType'];
local Degree = A['Degree'];
local Docket = A['Docket'];
local ArchiveFormat = A['ArchiveFormat'];
local ArchiveDate;
local ArchiveURL;
ArchiveURL, ArchiveDate = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local URL = A['URL']
local URLorigin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL = A['ChapterURL'];
local ChapterURLorigin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
local ConferenceURLorigin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
local Periodical = A['Periodical'];
local Periodical_origin = '';
if is_set (Periodical) then
Periodical_origin = A:ORIGIN('Periodical'); -- get the name of the periodical parameter
local i;
Periodical, i = strip_apostrophe_markup (Periodical); -- strip appostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
table.insert( z.message_tail, {set_error ('apostrophe_markup', {Periodical_origin}, true)});
end
end
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (is_set (Periodical) or is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
table.insert( z.message_tail, {set_error ('missing_periodical', {config.CitationClass, p[config.CitationClass]}, true)});
end
end
local TransPeriodical = A['TransPeriodical'];
local Series = A['Series'];
local Volume;
local Issue;
local Page;
local Pages;
local At;
if 'citation' == config.CitationClass then
if is_set (Periodical) then
if not in_array (Periodical_origin, {'website', 'mailinglist'}) then -- {{citation}} does not render volume for these 'periodicals'
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
if 'citation' == config.CitationClass then
if is_set (Periodical) and in_array (Periodical_origin, {'journal', 'magazine', 'newspaper', 'periodical', 'work'}) or -- {{citation}} renders issue for these 'periodicals'
is_set (ScriptPeriodical) and in_array (ScriptPeriodical_origin, {'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-work'}) then -- and these 'script-periodicals'
Issue = hyphen_to_dash (A['Issue']);
end
elseif in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (is_set (Periodical) or is_set (ScriptPeriodical))) then
Issue = hyphen_to_dash (A['Issue']);
end
end
local Position = '';
if not in_array (config.CitationClass, cfg.templates_not_using_page) then
Page = A['Page'];
Pages = hyphen_to_dash (A['Pages']);
At = A['At'];
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if is_set (PublisherName) then
local i=0;
PublisherName, i = strip_apostrophe_markup (PublisherName); -- strip appostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i then -- non-zero when markup was stripped so emit an error message
table.insert( z.message_tail, {set_error ('apostrophe_markup', {PublisherName_origin}, true)});
end
end
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not is_set(URL) and is_set(UrlAccess) then
UrlAccess = nil;
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {'url'}, true ) } );
end
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not is_set(ChapterURL) and is_set(ChapterUrlAccess) then
ChapterUrlAccess = nil;
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')}, true ) } );
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not is_set(A['MapURL']) and is_set(MapUrlAccess) then
MapUrlAccess = nil;
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {'map-url'}, true ) } );
end
local Via = A['Via'];
local AccessDate = A['AccessDate'];
local Agency = A['Agency'];
local Language = A['Language'];
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local DoiBroken = A['DoiBroken'];
local ID = A['ID'];
local ASINTLD = A['ASINTLD'];
local IgnoreISBN = is_valid_parameter_value (A['IgnoreISBN'], A:ORIGIN('IgnoreISBN'), cfg.keywords_lists['yes_true_y'], nil);
local Embargo = A['Embargo'];
local Class = A['Class']; -- arxiv class identifier
local ID_list = extract_ids( args );
if is_set (DoiBroken) and not ID_list['DOI'] then
table.insert( z.message_tail, { set_error( 'doibroken_missing_doi', A:ORIGIN('DoiBroken'))});
end
local ID_access_levels = extract_id_access_levels( args, ID_list );
local Quote = A['Quote'];
local LayFormat = A['LayFormat'];
local LayURL = A['LayURL'];
local LaySource = A['LaySource'];
local Transcript = A['Transcript'];
local TranscriptFormat = A['TranscriptFormat'];
local TranscriptURL = A['TranscriptURL']
local TranscriptURLorigin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
local LastAuthorAmp = is_valid_parameter_value (A['LastAuthorAmp'], A:ORIGIN('LastAuthorAmp'), cfg.keywords_lists['yes_true_y'], nil);
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
--local variables that are not cs1 parameters
local use_lowercase; -- controls capitalization of certain static text
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local anchor_year; -- used in the CITEREF identifier
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not is_set (DF) then
DF = cfg.global_df; -- local df if present overrides global df set by {{use xxx date}} template
end
local sepc; -- separator between citation elements for CS1 a period, for CS2, a comma
local PostScript;
local Ref;
sepc, PostScript, Ref = set_style (Mode:lower(), A['PostScript'], A['Ref'], config.CitationClass);
use_lowercase = ( sepc == ',' ); -- used to control capitalization for certain static text
--check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if in_array (this_page.nsText, cfg.uncategorized_namespaces) then
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _,v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
select_one( args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'redundant_parameters' ); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, Pages, At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if is_set (PublicationPlace) and is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
add_prop_cat ('location test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not is_set (PublicationPlace) and is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
-- if not is_set(PublicationPlace) and is_set(Place) then -- both |publication-place= and |place= (|location=) allowed if different
-- PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
-- end
--
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia and |title then map |title to |article and |encyclopedia to |title
|encyclopedia and |article then map |encyclopedia to |title
|trans-title maps to |trans-chapter when |title is re-mapped
|url maps to |chapterurl when |title is remapped
All other combinations of |encyclopedia, |title, and |article are not modified
]]
local Encyclopedia = A['Encyclopedia'];
if ( config.CitationClass == "encyclopaedia" ) or ( config.CitationClass == "citation" and is_set (Encyclopedia)) then -- test code for citation
if is_set (Periodical) then -- Periodical is set when |encyclopedia is set
if is_set(Title) or is_set (ScriptTitle) then
if not is_set(Chapter) then
Chapter = Title; -- |encyclopedia and |title are set so map |title to |article and |encyclopedia to |title
ScriptChapter = ScriptTitle;
ScriptChapterOrigin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
if not is_set (ChapterURL) and is_set (TitleLink) then
Chapter = make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif is_set (Chapter) then -- |title not set
Title = Periodical; -- |encyclopedia set and |article set so map |encyclopedia to |title
Periodical = ''; -- redundant so unset
end
end
end
-- Special case for cite techreport.
if (config.CitationClass == "techreport") then -- special case for cite techreport
if is_set(A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not is_set(ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
table.insert( z.message_tail, { set_error('redundant_parameters', {wrap_style ('parameter', 'id') .. ' and ' .. wrap_style ('parameter', 'number')}, true )});
end
end
end
-- special case for cite mailing list
if (config.CitationClass == "mailinglist") then
Periodical = A ['MailingList'];
elseif 'mailinglist' == Periodical_origin then
Periodical = ''; -- unset because mailing list is only used for cite mailing list
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
if 'conference' == config.CitationClass then
if is_set(BookTitle) then
Chapter = Title;
-- ChapterLink = TitleLink; -- |chapterlink= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURLorigin = URLorigin;
URLorigin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
Chapter = A['Map'];
ChapterURL = A['MapURL'];
ChapterURLorigin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapterOrigin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if is_set( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if is_set( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local AirDate = A['AirDate'];
local SeriesLink = A['SeriesLink'];
link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wikimarkup in |series-link= or wikimarkup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if is_set(Network) then table.insert(n, Network); end
if is_set(Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if not is_set (Date) and is_set (AirDate) then -- promote airdate to date
Date = AirDate;
end
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if is_set (Season) and is_set (SeriesNumber) then -- these are mutually exclusive so if both are set
table.insert( z.message_tail, { set_error( 'redundant_parameters', {wrap_style ('parameter', 'season') .. ' and ' .. wrap_style ('parameter', 'seriesno')}, true ) } ); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if is_set(Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if is_set(SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if is_set(Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
-- ScriptChapterOrigin = 'title';
ScriptChapterOrigin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias episodelink
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURLorigin = A:ORIGIN('URL');
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if is_set (ChapterLink) and not is_set (ChapterURL) then -- link but not URL
Chapter = make_wikilink (ChapterLink, Chapter);
elseif is_set (ChapterLink) and is_set (ChapterURL) then -- if both are set, URL links episode;
Series = make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if is_set (Series) and is_set (SeriesLink) then
Series = make_wikilink (SeriesLink, Series);
end
Series = wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite ssrn}}, before generation of COinS data.
do
if in_array (config.CitationClass, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then
if not is_set (ID_list[config.CitationClass:upper()]) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv= & |citeseerx= required for their templates
table.insert( z.message_tail, { set_error( config.CitationClass .. '_missing', {}, true ) } ); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
end
-- handle type parameter for those CS1 citations that have default values
if in_array(config.CitationClass, {"AV-media-notes", "interview", "mailinglist", "map", "podcast", "pressrelease", "report", "techreport", "thesis"}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if is_set(Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if is_set(TitleType) then -- if type parameter is specified
TitleType = substitute( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
if not is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not is_set (Date) and is_set(PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val=AccessDate, name=A:ORIGIN ('AccessDate')},
['archive-date'] = {val=ArchiveDate, name=A:ORIGIN ('ArchiveDate')},
['date'] = {val=Date, name=Date_origin},
['doi-broken-date'] = {val=DoiBroken, name=A:ORIGIN ('DoiBroken')},
['embargo'] = {val=Embargo, name=A:ORIGIN ('Embargo')},
['lay-date'] = {val=LayDate, name=A:ORIGIN ('LayDate')},
['publication-date'] ={val=PublicationDate, name=A:ORIGIN ('PublicationDate')},
['year'] = {val=Year, name=A:ORIGIN ('Year')},
};
anchor_year, Embargo, error_message = dates(date_parameters_list, COinS_date);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
add_prop_cat ('jul_greg_uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if is_set (Year) and is_set (Date) then -- both |date= and |year= not normally needed;
local mismatch = year_date_check (Year, Date)
if 0 == mismatch then -- |year= does not match a year-value in |date=
if is_set (error_message) then -- if there is already an error message
error_message = error_message .. ', '; -- tack on this additional message
end
error_message = error_message .. '|year= / |date= mismatch';
elseif 1 == mismatch then -- |year= matches year-value in |date=
add_maint_cat ('date_year');
end
end
if not is_set(error_message) then -- error free dates only
local modified = false; -- flag
if is_set (DF) then -- if we need to reformat dates
modified = reformat_dates (date_parameters_list, DF, false); -- reformat to DF format, use long month names if appropriate
end
if true == date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
add_maint_cat ('date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language,
-- uncomment these three lines. Not supported by en.wiki (for obvious reasons)
-- set date_name_xlate() second argument to true to translate English digits to local digits (will translate ymd dates)
-- if date_name_xlate (date_parameters_list, false) then
-- modified = true;
-- end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
else
table.insert( z.message_tail, { set_error( 'bad_date', {error_message}, true ) } ); -- add this error message
end
end -- end of do
-- Account for the oddity that is {{cite journal}} with |pmc= set and |url= not set. Do this after date check but before COInS.
-- Here we unset Embargo if PMC not embargoed (|embargo= not set in the citation) or if the embargo time has expired. Otherwise, holds embargo date
Embargo = is_embargoed (Embargo);
if config.CitationClass == "journal" and not is_set(URL) and is_set(ID_list['PMC']) then
if not is_set (Embargo) then -- if not embargoed or embargo has expired
URL=cfg.id_handlers['PMC'].prefix .. ID_list['PMC']; -- set url to be the same as the PMC external link if not embargoed
URLorigin = cfg.id_handlers['PMC'].parameters[1]; -- set URLorigin to parameter name for use in error message if citation is missing a |title=
if is_set(AccessDate) then -- access date requires |url=; pmc created url is not |url=
table.insert( z.message_tail, { set_error( 'accessdate_missing_url', {}, true ) } );
AccessDate = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not is_set(Title) and
not is_set(TransTitle) and
not is_set(ScriptTitle) then
if 'episode' == config.CitationClass then -- special case for cite episode; TODO: is there a better way to do this?
table.insert( z.message_tail, { set_error( 'citation_missing_title', {'series'}, true ) } );
else
table.insert( z.message_tail, { set_error( 'citation_missing_title', {'title'}, true ) } );
end
end
if 'none' == Title and
in_array (config.CitationClass, {'journal', 'citation'}) and
(is_set (Periodical) or is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
add_maint_cat ('untitled');
end
check_for_url ({ -- add error message when any of these parameters hold a URL
['title']=Title,
[A:ORIGIN('Chapter')]=Chapter,
[Periodical_origin] = Periodical,
[PublisherName_origin] = PublisherName
});
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and is_set (Encyclopedia)) then
if is_set (Chapter) and is_set (Title) and is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = COinS({
['Periodical'] = strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = strip_apostrophe_markup (Encyclopedia),
['Chapter'] = make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic wikimarkup
['Degree'] = Degree; -- cite thesis only
['Title'] = make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic wikimarkup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date has correctly formatted date if Date is valid;
['Season'] = COinS_date.rftssn,
['Chron'] = COinS_date.rftchron or (not COinS_date.rftdate and Date) or '', -- chron but if not set and invalid date format use Date; keep this last bit?
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['Pages'] = coins_pages or get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At}, 5)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName, -- any apostrophe markup already removed
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, and {{cite ssrn}} AFTER generation of COinS data.
if in_array (config.CitationClass, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass then
if is_set (PublisherName) then
PublisherName = substitute (cfg.messages['newsgroup'], external_link( 'news:' .. PublisherName, PublisherName, PublisherName_origin, nil ));
end
end
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
do
local last_first_list;
local control = {
format = NameListFormat, -- empty string or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
lastauthoramp = LastAuthorAmp,
page_name = this_page.text, -- get current page name so that we don't wikilink to it via editorlinkn
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal);
last_first_list, EditorCount = list_people(control, e, editor_etal);
if is_set (Editors) then
Editors, editor_etal = name_has_etal (Editors, editor_etal, false, 'editors'); -- find and remove variations on et al.
if editor_etal then
Editors = Editors .. ' ' .. cfg.messages['et al']; -- add et al. to editors parameter beause |display-editors=etal
EditorCount = 2; -- with et al., |editors= is multiple names; spoof to display (eds.) annotation
else
EditorCount = 2; -- we don't know but assume |editors= is multiple names; spoof to display (eds.) annotation
end
else
Editors = last_first_list; -- either an author name list or an empty string
end
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
control.maximum , interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal);
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
control.maximum , translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal);
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
control.maximum , contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal);
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
control.maximum , author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal);
last_first_list = list_people(control, a, author_etal);
if is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if is_set (Authors) and is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
-- apply |[xx-]format= styling; at the end, these parameters hold correctly styled format annotation,
-- an error message if the associated url is not set, or an empty string for concatenation
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
-- special case for chapter format so no error message or cat when chapter not supported
if not (in_array(config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical)) and not is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not is_set(URL) then
if in_array(config.CitationClass, {"web","podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
table.insert( z.message_tail, { set_error( 'cite_web_url', {}, true ) } );
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if is_set(AccessDate) and not is_set(ChapterURL)then -- ChapterURL may be set when URL is not set;
table.insert( z.message_tail, { set_error( 'accessdate_missing_url', {}, true ) } );
AccessDate = '';
end
end
local OriginalURL, OriginalURLorigin, OriginalFormat, OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if is_set( ArchiveURL ) then
if is_set (ChapterURL) then -- if chapter-url is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURLorigin = ChapterURLorigin; -- name of chapter-url parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's url
ChapterURLorigin = A:ORIGIN('ArchiveURL') -- name of archive-url parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived urls
end
elseif is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURLorigin = URLorigin; -- name of url parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then archive-url applies to it
URL = ArchiveURL -- swap-in the archive's url
URLorigin = A:ORIGIN('ArchiveURL') -- name of archive url parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived urls
end
end
end
if in_array(config.CitationClass, {'web','news','journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical)) and not is_set (Encyclopedia)) then
local chap_param;
if is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif is_set (ScriptChapter) then
chap_param = ScriptChapterOrigin;
else is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if is_set (chap_param) then -- if we found one
table.insert( z.message_tail, { set_error( 'chapter_ignored', {chap_param}, true ) } ); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapterOrigin, Chapter, TransChapter, ChapterURL, ChapterURLorigin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter.. sepc .. ' ';
elseif is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title.
if is_set (ArchiveURL) and mw.ustring.match (mw.ustring.lower(Title), cfg.special_case_translation['archived_copy']) then -- if title is 'Archived copy' (place holder added by bots that can't find proper title)
add_maint_cat ('archived_copy'); -- add maintenance category before we modify the content of Title
end
if Title:match ('^%(%(.*%)%)$') then -- if keep as written markup:
Title= Title:gsub ('^%(%((.*)%)%)$', '%1') -- remove the markup
else
if '...' == Title:sub (-3) then -- if elipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%'..sepc..'$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
end
if in_array(config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical)) and not is_set (Encyclopedia)) or
('map' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from Module provided quote marks
Title = wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle= wrap_style ('trans-quoted-title', TransTitle );
elseif 'report' == config.CitationClass then -- no styling for cite report
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle= wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle = wrap_style ('trans-italic-title', TransTitle);
end
local TransError = "";
if is_set(TransTitle) then
if is_set(Title) then
TransTitle = " " .. TransTitle;
else
TransError = " " .. set_error( 'trans_missing_title', {'title'} );
end
end
if is_set(Title) then
if not is_set (TitleLink) and is_set (URL) then
Title = external_link (URL, Title, URLorigin, UrlAccess) .. TransTitle .. TransError .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif is_set (TitleLink) and not is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle .. TransError;
else
Title = make_wikilink (TitleLink, Title) .. TransTitle .. TransError;
end
else
local ws_url, ws_label;
ws_url, ws_label, L = wikisource_url_make (Title); -- make ws url from |title= interwiki link; link portion L becomes tool tip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle .. TransError;
else
Title = Title .. TransTitle .. TransError;
end
end
else
Title = TransTitle .. TransError;
end
if is_set(Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
if is_set (Conference) then
if is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURLorigin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif is_set(ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURLorigin, nil );
end
if not is_set(Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if is_set(Minutes) then
if is_set (Time) then
table.insert( z.message_tail, { set_error( 'redundant_parameters', {wrap_style ('parameter', 'minutes') .. ' and ' .. wrap_style ('parameter', 'time')}, true ) } );
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if is_set(Time) then
local TimeCaption = A['TimeCaption']
if not is_set(TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = is_set(At) and (sepc .. " " .. At) or "";
Position = is_set(Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Section = A['Section'];
local Sections = A['Sections'];
local Inset = A['Inset'];
if is_set( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if is_set( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif is_set( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
if is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc
else
Language=""; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
Others = is_set(Others) and (sepc .. " " .. Others) or "";
if is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
TitleNote = is_set(TitleNote) and (sepc .. " " .. TitleNote) or "";
if is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%.?$') or Edition:match ('%f[%a][Ee]dition$') then
add_maint_cat ('extra_text', 'edition');
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
OrigYear = is_set (OrigYear) and wrap_msg ('origyear', OrigYear) or '';
Agency = is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, config.CitationClass, Periodical_origin, sepc, use_lowercase);
------------------------------------ totally unrelated data
Via = is_set (Via) and wrap_msg ('via', Via) or '';
if is_set(AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if is_set(ID) then ID = sepc .." ".. ID; end
if "thesis" == config.CitationClass and is_set(Docket) then
ID = sepc .." Docket ".. Docket .. ID;
end
if "report" == config.CitationClass and is_set(Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
ID_list = build_id_list( ID_list, {IdAccessLevels=ID_access_levels, DoiBroken = DoiBroken, ASINTLD = ASINTLD, IgnoreISBN = IgnoreISBN, Embargo=Embargo, Class = Class} );
if is_set(URL) then
URL = " " .. external_link( URL, nil, URLorigin, UrlAccess );
end
if is_set(Quote) then
if Quote:sub(1,1) == '"' and Quote:sub(-1,-1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2,-2); -- strip them off
end
Quote = sepc .." " .. wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
local Archived
if is_set(ArchiveURL) then
local arch_text;
if not is_set(ArchiveDate) then
ArchiveDate = set_error('archive_missing_date');
end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. substitute( cfg.messages['archived-live'],
{ external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil ) .. ArchiveFormat, ArchiveDate } );
if not is_set (OriginalURL) then
Archived = Archived .. " " .. set_error('archive_missing_url');
end
elseif is_set(OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
add_maint_cat ('bot:_unknown'); -- and add a category if not already added
else
add_maint_cat ('unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. substitute( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURLorigin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
end
else -- OriginalUrl not set
arch_text = cfg.messages['archived-missing'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. substitute( arch_text,
{ set_error('archive_missing_url'), ArchiveDate } );
end
elseif is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = ""
end
local Lay = '';
if is_set(LayURL) then
if is_set(LayDate) then LayDate = " (" .. LayDate .. ")" end
if is_set(LaySource) then
LaySource = " – ''" .. safe_for_italics(LaySource) .. "''";
else
LaySource = "";
end
if sepc == '.' then
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
else
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
end
elseif is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
end
if is_set(Transcript) then
if is_set(TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURLorigin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif is_set(TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURLorigin, nil );
end
local Publisher;
if is_set(PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if is_set(PublisherName) then
if is_set(PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif is_set(PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (is_set (Periodical) or is_set (ScriptPeriodical) or is_set (TransPeriodical)) then
if is_set(Title) or is_set(TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical);
end
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = " (Speech)"; -- annotate the citation
if is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if in_array(config.CitationClass, {"journal","citation"}) and is_set(Periodical) then
if is_set(Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif in_array(config.CitationClass, {"book","citation"}) and not is_set(Periodical) then -- special cases for book cites
if is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
if is_set(Date) then
if is_set (Authors) or is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date ..")" .. OrigYear .. sepc .. " "; -- in paranetheses
else -- neither of authors and editors set
if (string.sub(tcommon,-1,-1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigYear; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigYear; -- Date begins with sepc
end
end
end
if is_set(Authors) then
if (not is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if is_set(Editors) then
local in_text = " ";
local post_text = "";
if is_set(Chapter) and 0 == #c then
in_text = in_text .. cfg.messages['in'] .. " "
if (sepc ~= '.') then
in_text = in_text:lower() -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = " (" .. cfg.messages['editor'] .. ")"; -- be consistent with no-author, no-date case
else
post_text = " (" .. cfg.messages['editors'] .. ")";
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if is_set (Contributors) then -- book cite and we're citing the intro, preface, etc
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if is_set (Editors) and is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif is_set(Editors) then
if is_set(Date) then
if EditorCount <= 1 then
Editors = Editors .. ", " .. cfg.messages['editor'];
else
Editors = Editors .. ", " .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if in_array(config.CitationClass, {"journal","citation"}) and is_set(Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if is_set(PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); --Deals with italics, spaces, etc.
text = text:sub(1,-sepc:len()-1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite/> element
local options = {};
if is_set(config.CitationClass) and config.CitationClass ~= "citation" then
options.class = config.CitationClass;
options.class = "citation " .. config.CitationClass; -- class=citation required for blue highlight when used with |ref=
else
options.class = "citation";
end
if is_set(Ref) and Ref:lower() ~= "none" then -- set reference anchor if appropriate
local id = Ref
if ('harv' == Ref ) then
local namelist = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist = c; -- select it
elseif #a > 0 then -- or an author list
namelist = a;
elseif #e > 0 then -- or an editor list
namelist = e;
end
if #namelist > 0 then -- if there are names in namelist
id = anchor_id (namelist, year); -- go make the CITEREF anchor
else
id = ''; -- unset
end
end
options.id = id;
end
if string.len(text:gsub("<span[^>/]*>(.-)</span>", "%1"):gsub("%b<>","")) <= 2 then -- remove <span> tags and other html-like markup; then get length of what remains
z.error_categories = {};
text = set_error('empty_citation');
z.message_tail = {};
end
local render = {}; -- here we collect the final bits for concatenation into the rendered citation
if is_set(options.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render, substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options.id), mw.text.nowiki(options.class), text})); -- when |ref= is set
else
table.insert (render, substitute (cfg.presentation['cite'], {mw.text.nowiki(options.class), text})); -- all other cases
end
table.insert (render, substitute (cfg.presentation['ocins'], {OCinSoutput})); -- append metadata to the citation
if 0 ~= #z.message_tail then
table.insert (render, ' ');
for i,v in ipairs( z.message_tail ) do
if is_set(v[1]) then
if i == #z.message_tail then
table.insert (render, error_comment( v[1], v[2] ));
else
table.insert (render, error_comment( v[1] .. "; ", v[2] ));
end
end
end
end
if 0 ~= #z.maintenance_cats then
local maint_msgs = {}; -- here we collect all of the maint messages
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
local maint = {}; -- here we assemble a maintenence message
table.insert (maint, v); -- maint msg is the category name
table.insert (maint, ' ('); -- open the link text
table.insert (maint, make_wikilink (':Category:' .. v, 'link')); -- add the link
table.insert (maint, ')'); -- and close it
table.insert (maint_msgs, table.concat (maint)); -- assemble new maint message and add it to the maint_msgs table
end
table.insert (render, substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs, ' '))); -- wrap the group of maint message with proper presentation and save
end
-- no_tracking_cats = no_tracking_cats:lower();
-- if in_array(no_tracking_cats, {"", "no", "false", "n"}) then
if not no_tracking_cats then
for _, v in ipairs( z.error_categories ) do
table.insert (render, make_wikilink ('Category:' .. v));
end
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
table.insert (render, make_wikilink ('Category:' .. v));
end
for _, v in ipairs( z.properties_cats ) do -- append properties categories
table.insert (render, make_wikilink ('Category:' .. v));
end
end
return table.concat (render);
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class)
local name = tostring (name);
local state;
if in_array (cite_class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- limited parameter sets allowed for these templates
state = whitelist.limited_basic_arguments[name];
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
state = whitelist[cite_class .. '_basic_arguments'][name]; -- look in the parameter-list for the template identified by cite_class
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
-- limited enumerated parameters list
name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.limited_numbered_arguments[name];
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
state = whitelist.basic_arguments[name]; -- all other templates; all normal parameters allowed
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
-- all enumerated parameters allowed
name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.numbered_arguments[name];
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
return false; -- not supported because not found or name is set to nil
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe:
{{cite ... |title=Title access-date=2016-03-17}}
cs1|2 shares some parameter names with xml/html atributes: class=, title=, etc. To prevent false positives xml/html
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove xml/html tags because attributes: class=, title=, etc
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
table.insert( z.message_tail, {set_error ('missing_pipe',parameter)});
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
add_maint_cat ('extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy incase we need to display an error message in preview mode
local pframe = frame:getParent()
local validation, utilities, identifiers, metadata, styles;
if nil ~= string.find (frame:getTitle(), 'sandbox', 1, true) then -- did the {{#invoke:}} use sandbox version?
cfg = mw.loadData ('Module:Citation/CS1/Configuration/sandbox'); -- load sandbox versions of support modules
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist/sandbox');
utilities = require ('Module:Citation/CS1/Utilities/sandbox');
validation = require ('Module:Citation/CS1/Date_validation/sandbox');
identifiers = require ('Module:Citation/CS1/Identifiers/sandbox');
metadata = require ('Module:Citation/CS1/COinS/sandbox');
styles = 'Module:Citation/CS1/sandbox/styles.css';
else -- otherwise
cfg = mw.loadData ('Module:Citation/CS1/Configuration'); -- load live versions of support modules
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist');
utilities = require ('Module:Citation/CS1/Utilities');
validation = require ('Module:Citation/CS1/Date_validation');
identifiers = require ('Module:Citation/CS1/Identifiers');
metadata = require ('Module:Citation/CS1/COinS');
styles = 'Module:Citation/CS1/styles.css';
end
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
dates = validation.dates; -- imported functions from Module:Citation/CS1/Date validation
year_date_check = validation.year_date_check;
reformat_dates = validation.reformat_dates;
date_hyphen_to_dash = validation.date_hyphen_to_dash;
date_name_xlate = validation.date_name_xlate;
is_set = utilities.is_set; -- imported functions from Module:Citation/CS1/Utilities
in_array = utilities.in_array;
substitute = utilities.substitute;
error_comment = utilities.error_comment;
set_error = utilities.set_error;
select_one = utilities.select_one;
add_maint_cat = utilities.add_maint_cat;
wrap_style = utilities.wrap_style;
safe_for_italics = utilities.safe_for_italics;
is_wikilink = utilities.is_wikilink;
make_wikilink = utilities.make_wikilink;
strip_apostrophe_markup = utilities.strip_apostrophe_markup;
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
extract_ids = identifiers.extract_ids; -- imported functions from Module:Citation/CS1/Identifiers
build_id_list = identifiers.build_id_list;
is_embargoed = identifiers.is_embargoed;
extract_id_access_levels = identifiers.extract_id_access_levels;
make_coins_title = metadata.make_coins_title; -- imported functions from Module:Citation/CS1/COinS
get_coins_pages = metadata.get_coins_pages;
COinS = metadata.COinS;
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text, error_state;
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do
config[k] = v;
-- args[k] = v; -- debug tool that allows us to render a citation from module {{#invoke:}}
end
local capture; -- the single supported capture when matching unknown parameters using patterns
for k, v in pairs( pframe.args ) do
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
error_text = "";
if type( k ) ~= 'string' then
-- Exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text, error_state = set_error( 'text_ignored', {v}, true );
end
elseif validate( k:lower(), config.CitationClass ) then
error_text, error_state = set_error( 'parameter_ignored_suggest', {k, k:lower()}, true ); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
if nil ~= string.find (frame:getTitle(), 'sandbox', 1, true) then -- did the {{#invoke:}} use sandbox version?
suggestions = mw.loadData( 'Module:Citation/CS1/Suggestions/sandbox' ); -- use the sandbox version
else
suggestions = mw.loadData( 'Module:Citation/CS1/Suggestions' ); -- use the live version
end
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no caputre in pattern else the capture if a match
if capture then -- if the pattern matches
param = substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text, error_state = set_error ('parameter_ignored_suggest', {k, param}, true); -- set the suggestion error message
else
error_text, error_state = set_error( 'parameter_ignored', {param}, true ); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not is_set (error_text) then -- couldn't match with a pattern, is there an expicit suggestion?
if suggestions.suggestions[ k:lower() ] ~= nil then
error_text, error_state = set_error( 'parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]}, true );
else
error_text, error_state = set_error( 'parameter_ignored', {k}, true );
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
if error_text ~= '' then
table.insert( z.message_tail, {error_text, error_state} );
end
end
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
-- TODO: is this the best place for this translation?
args[k] = v;
elseif args[k] ~= nil or (k == 'postscript') then -- here when v is empty string
args[k] = v; -- why do we do this? we don't support 'empty' parameters
end
end
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v);
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
end
end
return table.concat ({citation0( config, args), frame:extensionTag ('templatestyles', '', {src=styles})});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
a5feb2cf853a747bb079162056a94b701cdc2518
Module:Citation/CS1/COinS
828
86
170
2021-06-05T23:18:29Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1/COinS]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title=''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script=''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the url and following space(s): "[url "
if nil == pattern then break; end -- no more urls
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace html entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with html and css which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous html/css markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the intital
value. To replace multipe equations it is necesary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain html entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013]', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn', 'journal', 'news', 'magazine'}) or (in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else --{'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif id then -- when cfg.id_handlers[k].COinS is not nil
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v }; -- others; provide a url
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki strip markers, non-printing or invisible characers
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
--table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
is_set = utilities_page_ptr.is_set; -- import functions from selected Module:Citation/CS1/Utilities module
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
b5ddcb88ee3e52bb23321d231c25c7886747b1be
Module:Citation/CS1/Configuration
828
87
172
2021-06-05T23:18:30Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1/Configuration]]
Scribunto
text/plain
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
List of namespaces that should not be included in citation error categories. Same as setting notracking = true by default
Note: Namespace names should use underscores instead of spaces.
]]
local uncategorized_namespaces = { 'User', 'Talk', 'User_talk', 'Wikipedia_talk', 'File_talk', 'Template_talk', 'Help_talk', 'Category_talk', 'Portal_talk', 'Book_talk', 'Draft_talk', 'Education_Program_talk', 'Module_talk', 'MediaWiki_talk' };
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases'}; -- list of Lua patterns found in page names of pages we should not categorize
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
]]
local messages = {
['agency'] = '$1 $2', -- $1 is sepc, $2 is agency
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-missing'] = 'Archived from the original$1 on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['lay summary'] = 'Lay summary',
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1',
['original'] = 'the original',
['origyear'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',
['vol'] = '$1 Vol. $2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol. $2 no. $3', -- sepc, volume, issue
['issue'] = '$1 No. $2', -- $1 is sepc
['j-vol'] = '$1 $2', -- sepc, volume; bold journal volume is in presentation{}
['j-issue'] = ' ($1)',
['nopp'] = '$1 $2'; -- page(s) without prefix; $1 is sepc
['p-prefix'] = "$1 p. $2", -- $1 is sepc
['pp-prefix'] = "$1 pp. $2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages
['sheet'] = '$1 Sheet $2', -- $1 is sepc
['sheets'] = '$1 Sheets $2', -- $1 is sepc
['j-sheet'] = ': Sheet $1',
['j-sheets'] = ': Sheets $1',
['language'] = '(in $1)',
['via'] = " – via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
['parameter-separator'] = ', ',
['parameter-final-separator'] = ', and ',
['parameter-pair-separator'] = ' and ',
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',
-- Internal errors (should only occur if configuration is bad)
['undefined_error'] = 'Called with an undefined error condition',
['unknown_manual_ID'] = 'Unrecognized manual ID mode',
['unknown_ID_mode'] = 'Unrecognized ID mode',
['unknown_argument_map'] = 'Argument map not defined for this variable',
['bare_url_no_origin'] = 'Bare url found but origin indicator is nil or empty',
}
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
]=]
local et_al_patterns = {
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.\"']*$", -- variations on the 'et al' theme
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][Aa][%.\"']*$", -- variations on the 'et alia' theme
"[;,]? *%f[%a]and [Oo]thers", -- and alternate to et al.
"%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]", -- a wikilinked form
"[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]", -- a bracketed form
}
--[[--------------------------< E D I T O R _ M A R K U P _ P A T T E R N S >----------------------------------
This table provides Lua patterns for the phrase "ed" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the
'extra_text_names' message. (It is not the only series of patterns for this message.)
]]
local editor_markup_patterns = { -- these patterns match annotations at end of name
'%f[%(%[][%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]?$', -- (ed) or (eds): leading '(', case insensitive 'ed', optional 's', '.' and/or ')'
'[,%.%s]%f[e]eds?%.?$', -- ed or eds: without '('or ')'; case sensitive (ED could be initials Ed could be name)
'%f[%(%[][%(%[]%s*[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%.?%s*[%)%]]?$', -- (editor) or (editors): leading '(', case insensitive, optional '.' and/or ')'
'[,%.%s]%f[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%.?$', -- editor or editors: without '('or ')'; case insensitive
-- these patterns match annotations at beginning of name
'^eds?[%.,;]', -- ed. or eds.: lower case only, optional 's', requires '.'
'^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]', -- (ed) or (eds): also sqare brackets, case insensitive, optional 's', '.'
'^[%(%[]?%s*[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%A', -- (editor or (editors: also sq brackets, case insensitive, optional brackets, 's'
'^[%(%[]?%s*[Ee][Dd][Ii][Tt][Ee][Dd]%A', -- (edited: also sq brackets, case insensitive, optional brackets
-- these patterns match annotations that are the 'name'
'^[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%.?$', -- editor or editors; case insensitive
}
--[[--------------------------< P R E S E N T A T I O N >------------------------------------------------------
Fixed presentation markup. Originally part of citation_config.messages it has been moved into its own, more semantically
correct place.
]]
local presentation =
{
-- Error output
-- .error class is specified at https://git.wikimedia.org/blob/mediawiki%2Fcore.git/9553bd02a5595da05c184f7521721fb1b79b3935/skins%2Fcommon%2Fshared.css#L538
-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
['hidden-error'] = '<span class="cs1-hidden-error error citation-comment">$1</span>',
['visible-error'] = '<span class="cs1-visible-error error citation-comment">$1</span>',
['hidden-maint'] = '<span class="cs1-maint citation-comment">$1</span>',
['accessdate'] = '<span class="reference-accessdate">$1$2</span>', -- to allow editors to hide accessdate using personal css
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['cite'] = '<cite class="$1">$2</cite>'; -- |ref= not set so no id="..." attribute
['cite-id'] = '<cite id="$1" class="$2">$3</cite>'; -- for use when |ref= is set
['format'] = ' <span class="cs1-format">($1)</span>', -- for |format=, |chapter-format=, etc
-- various access levels, for |access=, |doi-access=, |arxiv=, ...
-- narrow no-break space   may work better than nowrap css. Or not? browser support?
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon
['free'] = {class='cs1-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css
['registration'] = {class='cs1-lock-registration', title='Free registration required'},
['limited'] = {class='cs1-lock-limited', title='Free access subject to limited trial, subscription normally required'},
['subscription'] = {class='cs1-lock-subscription', title='Paid subscription required'},
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>',
['class-wikisource'] = 'cs1-ws-icon',
['italic-title'] = "''$1''",
['kern-left'] = '<span class="cs1-kern-left">$1</span>$2', -- spacing to use when title contains leading single or double quote mark
['kern-right'] = '$1<span class="cs1-kern-right">$2</span>', -- spacing to use when title contains trailing single or double quote mark
-- these for simple wikilinked titles [["text]], [[text"]] and [["text"]]
-- span wraps entire wikilink
['kern-wl-left'] = '<span class="cs1-kern-wl-left">$1</span>', -- when title contains leading single or double quote mark
['kern-wl-right'] = '<span class="cs1-kern-wl-left">$1</span>', -- when title contains trailing single or double quote mark
['kern-wl-both'] = '<span class="cs1-kern-wl-left cs1-kern-wl-right">$1</span>', -- when title contains leading and trailing single or double quote marks
['nowrap1'] = '<span class="nowrap">$1</span>', -- for nowrapping an item: <span ...>yyyy-mm-dd</span>
['nowrap2'] = '<span class="nowrap">$1</span> $2', -- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
['ocins'] = '<span title="$1" class="Z3988"></span>',
['parameter'] = '<code class="cs1-code">|$1=</code>',
['ps_cs1'] = '.'; -- cs1 style postscript (terminal) character
['ps_cs2'] = ''; -- cs2 style postscript (terminal) character (empty string)
['quoted-text'] = '<q>$1</q>', -- for wrapping |quote= content
['quoted-title'] = '"$1"',
['sep_cs1'] = '.', -- cs1 element separator
['sep_cs2'] = ',', -- cs2 separator
['sep_nl'] = ';', -- cs1|2 style name-list separator between authors is a semicolon
['sep_name'] = ', ', -- cs1|2 style last/first separator is <comma><space>
['sep_nl_vanc'] = ',', -- Vancouver style name-list separator between authors is a comma
['sep_name_vanc'] = ' ', -- Vancouver style last/first separator is a space
['trans-italic-title'] = "[''$1'']",
['trans-quoted-title'] = "[$1]",
['vol-bold'] = '$1 <b>$2</b>', -- sepc, volume; for bold journal cites; for other cites ['vol'] in messages{}
}
--[[--------------------------< A L I A S E S >----------------------------------------------------------------
Aliases table for commonly passed parameters
]]
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'}, -- (Used by InternetArchiveBot)
['Agency'] = 'agency',
['AirDate'] = {'air-date', 'airdate'},
['ArchiveDate'] = {'archive-date', 'archivedate'}, -- (Used by InternetArchiveBot)
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'}, -- (Used by InternetArchiveBot)
['ASINTLD'] = 'asin-tld',
['At'] = 'at', -- (Used by InternetArchiveBot)
['Authors'] = {'authors', 'people', 'credits'},
['BookTitle'] = {'book-title', 'booktitle'},
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'entry-format', 'article-format', 'section-format'};
['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'entry-url', 'article-url', 'section-url', 'sectionurl'}, -- (Used by InternetArchiveBot)
['ChapterUrlAccess'] = {'chapter-url-access', 'contribution-url-access', 'entry-url-access', 'article-url-access', 'section-url-access'}, -- (Used by InternetArchiveBot)
['Class'] = 'class', -- cite arxiv and arxiv identifiers
['Collaboration'] = 'collaboration',
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = {'conference-format', 'event-format'},
['ConferenceURL'] = {'conference-url', 'conferenceurl', 'event-url', 'eventurl'}, -- (Used by InternetArchiveBot)
['Contribution'] = 'contribution', -- introduction, foreword, afterword, etc; required when |contributor= set
['Date'] = 'date',
['Degree'] = 'degree',
['DF'] = 'df',
['DisplayAuthors'] = {'display-authors', 'displayauthors'},
['DisplayContributors'] = 'display-contributors',
['DisplayEditors'] = {'display-editors', 'displayeditors'},
['DisplayInterviewers'] = 'display-interviewers',
['DisplayTranslators'] = 'display-translators',
['Docket'] = 'docket',
['DoiBroken'] = {'doi-broken', 'doi-broken-date', 'doi-inactive-date'},
['Edition'] = 'edition',
['Editors'] = 'editors',
['Embargo'] = 'embargo',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia'}, -- this one only used by citation
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['IgnoreISBN'] = {'ignore-isbn-error', 'ignoreisbnerror'},
['Inset'] = 'inset',
['Issue'] = {'issue', 'number'},
['Language'] = {'language', 'lang'},
['LastAuthorAmp'] = {'last-author-amp', 'lastauthoramp'},
['LayDate'] = {'lay-date', 'laydate'},
['LayFormat'] = 'lay-format',
['LaySource'] = {'lay-source', 'laysource'},
['LayURL'] = {'lay-url', 'layurl'}, -- (Used by InternetArchiveBot)
['MailingList'] = {'mailinglist', 'mailing-list'}, -- cite mailing list only
['Map'] = 'map', -- cite map only
['MapFormat'] = 'map-format', -- cite map only
['MapURL'] = {'mapurl', 'map-url'}, -- cite map only -- (Used by InternetArchiveBot)
['MapUrlAccess'] = 'map-url-access', -- cite map only -- (Used by InternetArchiveBot)
['MessageID'] = 'message-id',
['Minutes'] = 'minutes',
['Mode'] = 'mode',
['NameListFormat'] = 'name-list-format',
['Network'] = 'network',
['NoPP'] = {'no-pp', 'nopp'},
['NoTracking'] = {'template-doc-demo', 'no-cat', 'nocat',
'no-tracking', 'notracking'},
['Number'] = 'number', -- this case only for cite techreport
['OrigYear'] = {'orig-year', 'origyear'},
['Others'] = 'others',
['Page'] = {'p', 'page'}, -- (Used by InternetArchiveBot)
['Pages'] = {'pp', 'pages'}, -- (Used by InternetArchiveBot)
['Periodical'] = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work',
'encyclopedia', 'encyclopaedia', 'dictionary', 'mailinglist'}, -- these masquerade as periodicals but aren't TODO: find a better way to handle these?
['Place'] = {'place', 'location'},
['PostScript'] = 'postscript',
['PublicationDate'] = {'publicationdate', 'publication-date'},
['PublicationPlace'] = {'publication-place', 'publicationplace'},
['PublisherName'] = {'publisher', 'institution', 'newsgroup'},
['Quote'] = {'quote', 'quotation'},
['Ref'] = 'ref',
['Scale'] = 'scale',
['ScriptChapter'] = {'script-chapter', 'script-contribution', 'script-entry', 'script-article', 'script-section'},
['ScriptMap'] = 'script-map',
['ScriptPeriodical'] = {'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-website', 'script-work'},
['ScriptTitle'] = 'script-title', -- (Used by InternetArchiveBot)
['Section'] = 'section',
['Season'] = 'season',
['Sections'] = 'sections', -- cite map only
['Series'] = {'series', 'version'},
['SeriesSeparator'] = 'series-separator',
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no', 'seriesnumber', 'seriesno'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Time'] = 'time',
['TimeCaption'] = {'time-caption', 'timecaption'},
['Title'] = 'title', -- (Used by InternetArchiveBot)
['TitleLink'] = {'title-link', 'episode-link', 'titlelink', 'episodelink'}, -- (Used by InternetArchiveBot)
['TitleNote'] = 'department',
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-article', 'trans-chapter', 'trans-contribution', 'trans-entry', 'trans-section'},
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = {'transcript-url', 'transcripturl'}, -- (Used by InternetArchiveBot)
['TransMap'] = 'trans-map', -- cite map only
['TransPeriodical'] = {'trans-journal', 'trans-magazine', 'trans-newspaper', 'trans-periodical', 'trans-website', 'trans-work'},
['TransTitle'] = 'trans-title', -- (Used by InternetArchiveBot)
['URL'] = {'url', 'URL'}, -- (Used by InternetArchiveBot)
['UrlAccess'] = {'url-access'}, -- (Used by InternetArchiveBot)
['UrlStatus'] = 'url-status', -- (Used by InternetArchiveBot)
['Vauthors'] = 'vauthors',
['Veditors'] = 'veditors',
['Via'] = 'via',
['Volume'] = 'volume',
['Year'] = 'year',
['AuthorList-First'] = {"first#", "given#", "author-first#", "author#-first"},
['AuthorList-Last'] = {"last#", "author#", "surname#", "author-last#", "author#-last", "subject#", 'host#'},
['AuthorList-Link'] = {"authorlink#", "author-link#", "author#-link", "subjectlink#", "author#link", "subject-link#", "subject#-link", "subject#link"},
['AuthorList-Mask'] = {"author-mask#", "authormask#", "author#mask", "author#-mask"},
['ContributorList-First'] = {'contributor-first#', 'contributor#-first', 'contributor-given#', 'contributor#-given'},
['ContributorList-Last'] = {'contributor#', 'contributor-last#', 'contributor#-last', 'contributor-surname#', 'contributor#-surname'},
['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
['EditorList-Last'] = {"editor#", "editor-last#", "editor#-last", "editor-surname#", "editor#-surname"},
['EditorList-Link'] = {"editor-link#", "editor#-link", "editorlink#", "editor#link"},
['EditorList-Mask'] = {"editor-mask#", "editor#-mask", "editormask#", "editor#mask"},
['InterviewerList-First'] = {'interviewer-first#', 'interviewer#-first'},
['InterviewerList-Last'] = {'interviewer#', 'interviewer-last#', 'interviewer#-last'},
['InterviewerList-Link'] = {'interviewer-link#', 'interviewer#-link'},
['InterviewerList-Mask'] = {'interviewer-mask#', 'interviewer#-mask'},
['TranslatorList-First'] = {'translator-first#', 'translator#-first', 'translator-given#', 'translator#-given'},
['TranslatorList-Last'] = {'translator#', 'translator-last#', 'translator#-last', 'translator-surname#', 'translator#-surname'},
['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
}
--[[--------------------------< P U N C T _ S K I P >----------------------------------------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
]]
local punct_skip = {};
local meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters
'PostScript', 'Quote', -- miscellaneous
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'LayURL', 'MapURL', 'TranscriptURL', 'URL', -- url-holding parameters
}
for _, meta_param in ipairs (meta_params) do -- for each meta parameter key
local params = aliases[meta_param]; -- get the parameter or the table of parameters associated with the meta parameter name
if 'string' == type (params) then
punct_skip[params] = 1; -- just a single parameter
else
for _, param in ipairs (params) do -- get the parameter name
punct_skip[param] = 1; -- add the parameter name to the skip table
end
end
end
--[[--------------------------< S P E C I A L C A S E T R A N S L A T I O N S >----------------------------
This table is primarily here to support internationalization. Translations in this table are used, for example,
when an error message, category name, etc is extracted from the English alias key. There may be other cases where
this translation table may be useful.
]]
local special_case_translation = {
['AuthorList'] = 'authors list', -- these for multiple names maint categories
['ContributorList'] = 'contributors list',
['EditorList'] = 'editors list',
['InterviewerList'] = 'interviewers list',
['TranslatorList'] = 'translators list',
['authors'] = 'authors', -- used in get_display_names()
['contributors'] = 'contributors',
['editors'] = 'editors',
['interviewers'] = 'interviewers',
['translators'] = 'translators',
['archived_copy'] = '^archived?%s+copy$', -- lua pattern to match pseudo title used by Internet Archive bot and others as place holder for unknown |title= value
-- used with CS1 maint: Archived copy as title
}
--[[--------------------------< D E F A U L T S >--------------------------------------------------------------
Default parameter values
TODO: keep this? Only one default?
]]
local defaults = {
['UrlStatus'] = 'dead', -- (Used by InternetArchiveBot)
}
--[[--------------------------< D A T E _ N A M E S >----------------------------------------------------------
This table of tables lists local language date names and fallback English date names. The code in Date_validation
will look first in the local table for valid date names. If date names are not found in the local table, the code
will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is required when the date-name translation
function date_name_xlate() is used.
In these tables, season numbering is defined by ISO DIS 8601:2016 part 2 §4.7 'Divisions of a year'. The standard
defines various divisions using numbers 21-41. cs1|2 only supports generic seasons. ISO DIS 8601:2016 does support
the distinction between north and south hemispere seasons but cs1|2 has no way to make that distinction.
The standard does not address 'named' dates so, for the purposes of cs1|2, Christmas is defined here as 99, which
should be out of the ISO DIS 8601:2016 range of uses for a while.
]]
local date_names = {
['en'] = { -- English
['long'] = {['January']=1, ['February']=2, ['March']=3, ['April']=4, ['May']=5, ['June']=6, ['July']=7, ['August']=8, ['September']=9, ['October']=10, ['November']=11, ['December']=12},
['short'] = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12},
['season'] = {['Winter']=24, ['Spring']=21, ['Summer']=22, ['Fall']=23, ['Autumn']=23},
['named'] = {['Christmas']=99},
},
['local'] = { -- replace these English date names with the local language equivalents
['long'] = {['January']=1, ['February']=2, ['March']=3, ['April']=4, ['May']=5, ['June']=6, ['July']=7, ['August']=8, ['September']=9, ['October']=10, ['November']=11, ['December']=12},
['short'] = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12},
['season'] = {['Winter']=24, ['Spring']=21, ['Summer']=22, ['Fall']=23, ['Autumn']=23},
['named'] = {['Christmas']=99},
},
['inv_local_l'] = {}, -- used in date reformatting; copy of date_names['local'].long where k/v are inverted: [1]='<local name>' etc
['inv_local_s'] = {}, -- used in date reformatting; copy of date_names['local'].short where k/v are inverted: [1]='<local name>' etc
['local_digits'] = {['0'] = '0', ['1'] = '1', ['2'] = '2', ['3'] = '3', ['4'] = '4', ['5'] = '5', ['6'] = '6', ['7'] = '7', ['8'] = '8', ['9'] = '9'}, -- used to convert local language digits to Western 0-9
['xlate_digits'] = {},
}
for name, i in pairs (date_names['local'].long) do -- this table is ['name'] = i
date_names['inv_local_l'][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
for name, i in pairs (date_names['local'].short) do -- this table is ['name'] = i
date_names['inv_local_s'][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
for ld, ed in pairs (date_names.local_digits) do -- make a digit translation table for simple date translation from en to local language using local_digits table
date_names.xlate_digits [ed] = ld; -- en digit becomes index with local digit as the value
end
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
'{{ *[Uu]se (dmy) dates *[|}]', -- 915k -- sorted by approximate transclusion count
'{{ *[Uu]se *(mdy) *dates *[|}]', -- 161k
'{{ *[Uu]se (DMY) dates *[|}]', -- 2929
'{{ *[Uu]se *(dmy) *[|}]', -- 250 + 34
'{{ *([Dd]my) *[|}]', -- 272
'{{ *[Uu]se (MDY) dates *[|}]', -- 173
'{{ *[Uu]se *(mdy) *[|}]', -- 59 + 12
'{{ *([Mm]dy) *[|}]', -- 9
'{{ *[Uu]se (MDY) *[|}]', -- 3
'{{ *([Dd]MY) *[|}]', -- 2
'{{ *([Mm]DY) *[|}]', -- 0
-- '{{ *[Uu]se(mdy) *[|}]',
-- '{{ *[Uu]se(mdy)dates *[|}]',
-- '{{ *[Uu]se(dmy) *[|}]',
}
local function get_date_format ()
local content = mw.title.getCurrentTitle():getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
if match then
content = content:match ('%b{}', start); -- get the whole template
if content:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
return match:lower() .. '-' .. content:match ('| *cs1%-dates *= *([lsy][sy]?)');
else
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
end
end
end
end
local global_df = get_date_format ();
--[[--------------------------< V O L U M E , I S S U E , P A G E S >----------------------------------------
These tables hold cite class values (from the template invocation) and identify those templates that support
|volume=, |issue=, and |page(s)= parameters. Cite conference and cite map require further qualification which
is handled in the main module.
]]
local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport', 'thesis'}
local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news', 'podcast'}
local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
--[[--------------------------< K E Y W O R D S >--------------------------------------------------------------
These tables hold keywords for those parameters that have defined sets of acceptible keywords.
]]
--[[--------------------------< M A K E _ K E Y W O R D S _ L I S T >------------------------------------------
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.
keywords_lists{}, is a table of tables from keywords{}
]]
local function make_keywords_list (keywords_lists)
local out_table = {}; -- output goes here
for _, keyword_list in ipairs (keywords_lists) do -- spin through keywords_lists{} and get a table of keywords
for _, keyword in ipairs (keyword_list) do -- spin through keyword_list{} and add each keyword, ...
table.insert (out_table, keyword); -- ... as plain text, to the output list
end
end
return out_table;
end
--[[--------------------------< K E Y W O R D S T A B L E >--------------------------------------------------
this is a list of keywords; each key in the list is associated with a table of synonymous keywords possibly from
different languages.
for i18n: add local-language keywords to value table; do not change the key. For example, adding the German keyword 'ja':
['affirmative'] = {'yes', 'true', 'y', 'ja'},
Because cs1|2 templates from en.wiki articles are often copied to other local wikis, it is recommended that the English
keywords remain in these tables.
]]
local keywords = {
['affirmative'] = {'yes', 'true', 'y'}, -- ignore-isbn-error, last-author-amp, no-tracking, nopp -- (Used by InternetArchiveBot)
['afterword'] = {'afterword'}, -- contribution
['bot: unknown'] = {'bot: unknown'}, -- url-status -- (Used by InternetArchiveBot)
['cs1'] = {'cs1'}, -- mode
['cs2'] = {'cs2'}, -- mode
['dead'] = {'dead'}, -- url-status -- (Used by InternetArchiveBot)
['dmy'] = {'dmy'}, -- df
['dmy-all'] = {'dmy-all'}, -- df
['foreword'] = {'foreword'}, -- contribution
['free'] = {'free'}, -- url-access -- (Used by InternetArchiveBot)
['introduction'] = {'introduction'}, -- contribution
['limited'] = {'limited'}, -- url-access -- (Used by InternetArchiveBot)
['live'] = {'live'}, -- url-status -- (Used by InternetArchiveBot)
['mdy'] = {'mdy'}, -- df
['mdy-all'] = {'mdy-all'}, -- df
['preface'] = {'preface'}, -- contribution
['registration'] = {'registration'}, -- url-access -- (Used by InternetArchiveBot)
['subscription'] = {'subscription'}, -- url-access -- (Used by InternetArchiveBot)
['unfit'] = {'unfit'}, -- url-status -- (Used by InternetArchiveBot)
['usurped'] = {'usurped'}, -- url-status -- (Used by InternetArchiveBot)
['vanc'] = {'vanc'}, -- name-list-format
['ymd'] = {'ymd'}, -- df
['ymd-all'] = {'ymd-all'}, -- df
-- ['yMd'] = {'yMd'}, -- df; not supported at en.wiki
-- ['yMd-all'] = {'yMd-all'}, -- df; not supported at en.wiki
}
--[[--------------------------< X L A T E _ K E Y W O R D S >--------------------------------------------------
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:
['affirmative'] = {'yes', 'true', 'y'}, -- in keywords{}
becomes
['yes'] = 'affirmative', -- in keywords_xlate{}
['true'] = 'affirmative',
['y'] = 'affirmative',
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent
that may be used in other modules of this suite
]]
local function xlate_keywords ()
local out_table = {}; -- output goes here
for k, keywords_t in pairs (keywords) do -- spin through the keywords table
for _, keyword in ipairs (keywords_t) do -- for each keyword
out_table[keyword] = k; -- create an entry in the output table where keyword is the key
end
end
return out_table;
end
local keywords_xlate = xlate_keywords (); -- the list of translated keywords
--[[--------------------------< K E Y W O R D S _ L I S T S >--------------------------------------------------
this is a list of lists of valid keywords for the various parameters in [key]. Generally the keys in this table
are the canonical en.wiki parameter names though some are contrived because of use in multiple differently named
parameters: ['yes_true_y'], ['id-access'].
The function make_keywords_list() extracts the individual keywords from the appropriate list in keywords{}.
The lists in this table are used to validate the keyword assignment for the parameters named in this table's keys.
]]
local keywords_lists = {
['yes_true_y'] = make_keywords_list ({keywords.affirmative}),
['contribution'] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),
['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all']}),
-- ['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all'], keywords.yMd, keywords['yMd-all']}), -- not supported at en.wiki
['mode'] = make_keywords_list ({keywords.cs1, keywords.cs2}),
['name-list-format'] = make_keywords_list ({keywords.vanc}),
['url-access'] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),
['url-status'] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords['bot: unknown']}),
['id-access'] = make_keywords_list ({keywords.free}),
}
--[[--------------------------< S T R I P M A R K E R S >------------------------------------------------------
Common pattern definition location for stripmarkers so that we don't have to go hunting for them if (when)
MediaWiki changes their form.
]]
local stripmarkers = {
['any'] = '\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127', -- capture returns name of stripmarker
['math'] = '\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127' -- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()
}
--[[--------------------------< I N V I S I B L E _ C H A R A C T E R S >--------------------------------------
This table holds non-printing or invisible characters indexed either by name or by Unicode group. Values are decimal
representations of UTF-8 codes. The table is organized as a table of tables because the lua pairs keyword returns
table data in an arbitrary order. Here, we want to process the table from top to bottom because the entries at
the top of the table are also found in the ranges specified by the entries at the bottom of the table.
Also here is a pattern that recognizes stripmarkers that begin and end with the delete characters. The nowiki
stripmarker is not an error but some others are because the parameter values that include them become part of the
template's metadata before stripmarker replacement.
]]
local invisible_chars = {
{'replacement', '\239\191\189'}, -- U+FFFD, EF BF BD
{'zero width joiner', '\226\128\141'}, -- U+200D, E2 80 8D
{'zero width space', '\226\128\139'}, -- U+200B, E2 80 8B
{'hair space', '\226\128\138'}, -- U+200A, E2 80 8A
{'soft hyphen', '\194\173'}, -- U+00AD, C2 AD
{'horizontal tab', '\009'}, -- U+0009 (HT), 09
{'line feed', '\010'}, -- U+000A (LF), 0A
{'carriage return', '\013'}, -- U+000D (CR), 0D
{'stripmarker', stripmarkers.any}, -- stripmarker; may or may not be an error; capture returns the stripmaker type
{'delete', '\127'}, -- U+007F (DEL), 7F; must be done after stripmarker test
{'C0 control', '[\000-\008\011\012\014-\031]'}, -- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
{'C1 control', '[\194\128-\194\159]'}, -- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
-- {'Specials', '[\239\191\185-\239\191\191]'}, -- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
-- {'Private use area', '[\238\128\128-\239\163\191]'}, -- U+E000–U+F8FF, EE 80 80 – EF A3 BF
-- {'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'}, -- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
-- {'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'}, -- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
}
--[[
Indic script makes use of zero width joiner as a character modifier so zwj characters must be left in. This
pattern covers all of the unicode characters for these languages:
Devanagari 0900–097F – https://unicode.org/charts/PDF/U0900.pdf
Devanagari extended A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf
Bengali 0980–09FF – https://unicode.org/charts/PDF/U0980.pdf
Gurmukhi 0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf
Gujarati 0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf
Oriya 0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf
Tamil 0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf
Telugu 0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf
Kannada 0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf
Malayalam 0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf
plus the not-necessarily Indic scripts for Sinhala and Burmese:
Sinhala 0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf
Myanmar 1000-109F - https://unicode.org/charts/PDF/U1000.pdf
Myanmar extended A AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf
Myanmar extended B A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf
the pattern is used by has_invisible_chars() and coins_cleanup()
TODO: find a better place for this?
]]
local indic_script = '[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]';
--[[--------------------------< L A N G U A G E S U P P O R T >----------------------------------------------
These tables and constants support various language-specific functionality.
]]
local this_wiki_code = mw.getContentLanguage():getCode() -- get this wiki's language code
local local_lang_cat_enable = false; -- set to true to categorize pages where |language=<local wiki's language>
--[[--------------------------< S C R I P T _ L A N G _ C O D E S >--------------------------------------------
This table is used to hold ISO 639-1 two-character language codes that apply only to |script-title= and |script-chapter=
]]
local script_lang_codes = {
'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', -- ISO 639-1 codes only for |script-title= and |script-chapter=
'gu', 'he', 'hi', 'hy', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'ku',
'mk', 'ml', 'mn', 'mr', 'my', 'ne', 'ota', 'ps', 'ru', 'sd', 'si',
'sr', 'ta', 'tg', 'th', 'ug', 'uk', 'ur', 'uz', 'yi', 'zh'
};
--[[--------------------------< L A N G U A G E R E M A P P I N G >------------------------------------------
These tables hold language information that is different (correct) from MediaWiki's definitions
]]
local lang_code_remap = { -- used for |language= and |script-title= / |script-chapter=
['als'] = 'Tosk Albanian', -- MediaWiki returns Alemannisch
['bh'] = 'Bihari', -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri wWikipedia: bh.wikipedia.org
['bla'] = 'Blackfoot', -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['bn'] = 'Bengali', -- MediaWiki returns Bangla
['ca-valencia'] = 'Valencian', -- IETF variant of Catalan
['crh'] = 'Crimean Tatar', -- synonymous with Crimean Turkish (return value from {{#language:crh|en}})
['ilo'] = 'Ilocano', -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['ksh'] = 'Kölsch', -- MediaWiki: Colognian; use IANA/ISO 639 preferred name
['ksh-x-colog'] = 'Colognian', -- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data
['mis-x-ripuar'] = 'Ripuarian', -- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data
['nan-tw'] = 'Taiwanese Hokkien', -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name
}
local lang_name_remap = { -- used for |language=
['alemannisch'] = {'Swiss German', 'gsw'}, -- not an ISO or IANA language name; MediaWiki uses 'als' as a subdomain name for Alemannic Wikipedia: als.wikipedia.org
['bangla'] = {'Bengali', 'bn'}, -- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap
['bengali'] = {'Bengali', 'bn'}, -- MediaWiki doesn't use exonym so here we provide correct language name and 639-1 code
['bhojpuri'] = {'Bhojpuri', 'bho'}, -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bihari'] = {'Bihari', 'bh'}, -- MediaWiki replaces 'Bihari' with 'Bhojpuri' so 'Bihari' cannot be found
['blackfoot'] = {'Blackfoot', 'bla'}, -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['colognian'] = {'Colognian', 'ksh-x-colog'}, -- MediaWiki preferred name for ksh
['crimean tatar'] = {'Crimean Tatar', 'crh'}, -- MediaWiki uses 'crh' as a subdomain name for Crimean Tatar Wikipedia: crh.wikipedia.org
['ilocano'] = {'Ilocano', 'ilo'}, -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['kolsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name (use o instead of ö)
['kölsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name
['ripuarian'] = {'Ripuarian', 'mis-x-ripuar'}, -- group of dialects; no code in MediaWiki or in IANA/ISO 639
-- ['siksika'] = {'Siksika', 'bla'}, -- MediaWiki/IANA/ISO 639 preferred name: Siksika
['taiwanese hokkien'] = {'Taiwanese Hokkien', 'nan-TW'}, -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese
['tosk albanian'] = {'Tosk Albanian', 'als'}, -- MediaWiki replaces 'Tosk Albanian' with 'Alemannisch' so 'Tosk Albanian' cannot be found
['valencian'] = {'Valencian', 'ca'}, -- variant of Catalan; categorizes as Catalan
}
--[[--------------------------< M A I N T E N A N C E _ C A T E G O R I E S >----------------------------------
Here we name maintenance categories to be used in maintenance messages.
]]
local maint_cats = {
['ASIN'] = 'CS1 maint: ASIN uses ISBN',
['archived_copy'] = 'CS1 maint: archived copy as title',
['authors'] = 'CS1 maint: uses authors parameter',
['bot:_unknown'] = 'CS1 maint: BOT: original-url status unknown',
['date_format'] = 'CS1 maint: date format',
['date_year'] = 'CS1 maint: date and year',
['disp_name'] = 'CS1 maint: display-$1', -- $1 is authors, contributors, editors, interviewers, translators; gets value from special_case_translation table
['editors'] = 'CS1 maint: uses editors parameter',
['embargo'] = 'CS1 maint: PMC embargo expired',
['extra_punct'] = 'CS1 maint: extra punctuation',
['extra_text'] = 'CS1 maint: extra text',
['extra_text_names'] = 'CS1 maint: extra text: $1', -- $1 is <name>s list; gets value from special_case_translation table
['ignore_isbn_err'] = 'CS1 maint: ignored ISBN errors',
['location'] = 'CS1 maint: location',
['mult_names'] = 'CS1 maint: multiple names: $1', -- $1 is <name>s list; gets value from special_case_translation table
['others'] = 'CS1 maint: others',
['pmc_format'] = 'CS1 maint: PMC format',
['unfit'] = 'CS1 maint: unfit url',
['unknown_lang'] = 'CS1 maint: unrecognized language',
['untitled'] = 'CS1 maint: untitled periodical',
['zbl'] = 'CS1 maint: ZBL',
}
--[[--------------------------< P R O P E R T I E S _ C A T E G O R I E S >------------------------------------
Here we name properties categories
]]
local prop_cats = {
['foreign_lang_source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code
['foreign_lang_source_2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key
['local_lang_source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false
['location test'] = 'CS1 location test',
['script'] = 'CS1 uses foreign language script', -- when language specified by |script-title=xx: doesn't have its own category
['script_with_name'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
['jul_greg_uncertainty'] = 'CS1: Julian–Gregorian uncertainty', -- probably temporary cat to identify scope of template with dates 1 October 1582 – 1 January 1926
['long_vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 charachters
}
--[[--------------------------< T I T L E _ T Y P E S >--------------------------------------------------------
Here we map a template's CitationClass to TitleType (default values for |type= parameter)
]]
local title_types = {
['AV-media-notes'] = 'Media notes',
['interview'] = 'Interview',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
--[[--------------------------< E R R O R _ C O N D I T I O N S >----------------------------------------------
Error condition table
The following contains a list of IDs for various error conditions defined in the code. For each ID, we specify a
text message to display, an error category to include, and whether the error message should be wrapped as a hidden comment.
Anchor changes require identical changes to matching anchor in Help:CS1 errors
]]
local error_conditions = {
accessdate_missing_url = {
message = '<code class="cs1-code">|access-date=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'accessdate_missing_url',
category = 'Pages using citations with accessdate and no URL',
hidden = false
},
apostrophe_markup = {
message = 'Italic or bold markup not allowed in: <code class="cs1-code">|$1=</code>',
anchor = 'apostrophe_markup',
category = 'CS1 errors: markup',
hidden = false
},
archive_missing_date = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|archive-date=</code>',
anchor = 'archive_missing_date',
category = 'Pages with archiveurl citation errors',
hidden = false
},
archive_missing_url = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'archive_missing_url',
category = 'Pages with archiveurl citation errors',
hidden = false
},
archive_url = {
message = '<code class="cs1-code">|archive-url=</code> is malformed: $1',
anchor = 'archive_url',
category = 'Pages with archiveurl citation errors',
hidden = false
},
arxiv_missing = {
message = '<code class="cs1-code">|arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
arxiv_params_not_supported = {
message = 'Unsupported parameter(s) in cite arXiv',
anchor = 'arxiv_params_not_supported',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
bad_arxiv = {
message = 'Check <code class="cs1-code">|arxiv=</code> value',
anchor = 'bad_arxiv',
category = 'CS1 errors: arXiv',
hidden = false
},
bad_asin = {
message = 'Check <code class="cs1-code">|asin=</code> value',
anchor = 'bad_asin',
category ='CS1 errors: ASIN',
hidden = false
},
bad_bibcode = {
message = 'Check <code class="cs1-code">|bibcode=</code> $1',
anchor = 'bad_bibcode',
category = 'CS1 errors: bibcode',
hidden = false
},
bad_biorxiv = {
message = 'Check <code class="cs1-code">|biorxiv=</code> value',
anchor = 'bad_biorxiv',
category = 'CS1 errors: bioRxiv',
hidden = false
},
bad_citeseerx = {
message = 'Check <code class="cs1-code">|citeseerx=</code> value',
anchor = 'bad_citeseerx',
category = 'CS1 errors: citeseerx',
hidden = false
},
bad_date = {
message = 'Check date values in: <code class="cs1-code">$1</code>',
anchor = 'bad_date',
category = 'CS1 errors: dates',
hidden = false
},
bad_doi = {
message = 'Check <code class="cs1-code">|doi=</code> value',
anchor = 'bad_doi',
category = 'CS1 errors: DOI',
hidden = false
},
bad_hdl = {
message = 'Check <code class="cs1-code">|hdl=</code> value',
anchor = 'bad_hdl',
category = 'CS1 errors: HDL',
hidden = false
},
bad_isbn = {
message = 'Check <code class="cs1-code">|isbn=</code> value: $1',
anchor = 'bad_isbn',
category = 'CS1 errors: ISBN',
hidden = false
},
bad_ismn = {
message = 'Check <code class="cs1-code">|ismn=</code> value',
anchor = 'bad_ismn',
category = 'CS1 errors: ISMN',
hidden = false
},
bad_issn = {
message = 'Check <code class="cs1-code">|$1issn=</code> value',
anchor = 'bad_issn',
category = 'CS1 errors: ISSN',
hidden = false
},
bad_jfm = {
message = 'Check <code class="cs1-code">|jfm=</code> value',
anchor = 'bad_jfm',
category = 'CS1 errors: JFM',
hidden = false
},
bad_lccn = {
message = 'Check <code class="cs1-code">|lccn=</code> value',
anchor = 'bad_lccn',
category = 'CS1 errors: LCCN',
hidden = false
},
bad_usenet_id = {
message = 'Check <code class="cs1-code">|message-id=</code> value',
anchor = 'bad_message_id',
category = 'CS1 errors: message-id',
hidden = false
},
bad_mr = {
message = 'Check <code class="cs1-code">|mr=</code> value',
anchor = 'bad_mr',
category = 'CS1 errors: MR',
hidden = false
},
bad_ol = {
message = 'Check <code class="cs1-code">|ol=</code> value',
anchor = 'bad_ol',
category = 'CS1 errors: OL',
hidden = false
},
bad_paramlink = { -- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
message = 'Check <code class="cs1-code">|$1=</code> value',
anchor = 'bad_paramlink',
category = 'CS1 errors: parameter link',
hidden = false
},
bad_pmc = {
message = 'Check <code class="cs1-code">|pmc=</code> value',
anchor = 'bad_pmc',
category = 'CS1 errors: PMC',
hidden = false
},
bad_pmid = {
message = 'Check <code class="cs1-code">|pmid=</code> value',
anchor = 'bad_pmid',
category = 'CS1 errors: PMID',
hidden = false
},
bad_oclc = {
message = 'Check <code class="cs1-code">|oclc=</code> value',
anchor = 'bad_oclc',
category = 'CS1 errors: OCLC',
hidden = false
},
bad_ssrn = {
message = 'Check <code class="cs1-code">|ssrn=</code> value',
anchor = 'bad_ssrn',
category = 'CS1 errors: SSRN',
hidden = false
},
bad_url = {
message = 'Check $1 value',
anchor = 'bad_url',
category = 'Pages with URL errors',
hidden = false
},
bad_zbl = {
message = 'Check <code class="cs1-code">|zbl=</code> value',
anchor = 'bad_zbl',
category = 'CS1 errors: ZBL',
hidden = false
},
bare_url_missing_title = {
message = '$1 missing title',
anchor = 'bare_url_missing_title',
category = 'Pages with citations having bare URLs',
hidden = false
},
biorxiv_missing = {
message = '<code class="cs1-code">|biorxiv=</code> required',
anchor = 'biorxiv_missing',
category = 'CS1 errors: bioRxiv', -- same as bad bioRxiv
hidden = false
},
chapter_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored',
anchor = 'chapter_ignored',
category = 'CS1 errors: chapter ignored',
hidden = false
},
citation_missing_title = {
message = 'Missing or empty <code class="cs1-code">|$1=</code>',
anchor = 'citation_missing_title',
category = 'Pages with citations lacking titles',
hidden = false
},
citeseerx_missing = {
message = '<code class="cs1-code">|citeseerx=</code> required',
anchor = 'citeseerx_missing',
category = 'CS1 errors: citeseerx', -- same as bad citeseerx
hidden = false
},
cite_web_url = { -- this error applies to cite web and to cite podcast
message = 'Missing or empty <code class="cs1-code">|url=</code>',
anchor = 'cite_web_url',
category = 'Pages using web citations with no URL',
hidden = false
},
class_ignored = {
message = '<code class="cs1-code">|class=</code> ignored',
anchor = 'class_ignored',
category = 'CS1 errors: class',
hidden = false
},
contributor_ignored = {
message = '<code class="cs1-code">|contributor=</code> ignored',
anchor = 'contributor_ignored',
category = 'CS1 errors: contributor',
hidden = false
},
contributor_missing_required_param = {
message = '<code class="cs1-code">|contributor=</code> requires <code class="cs1-code">|$1=</code>',
anchor = 'contributor_missing_required_param',
category = 'CS1 errors: contributor',
hidden = false
},
deprecated_params = {
message = 'Cite uses deprecated parameter <code class="cs1-code">|$1=</code>',
anchor = 'deprecated_params',
category = 'CS1 errors: deprecated parameters',
hidden = false
},
doibroken_missing_doi = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|doi=</code>',
anchor = 'doibroken_missing_doi',
category = 'CS1 errors: DOI',
hidden = false
},
empty_citation = {
message = 'Empty citation',
anchor = 'empty_citation',
category = 'Pages with empty citations',
hidden = false
},
etal = {
message = 'Explicit use of et al. in: <code class="cs1-code">|$1=</code>',
anchor = 'explicit_et_al',
category = 'CS1 errors: explicit use of et al.',
hidden = false
},
first_missing_last = {
message = '<code class="cs1-code">|$1=</code> missing <code class="cs1-code">|$2=</code>', -- $1 is first alias, $2 is matching last alias
anchor = 'first_missing_last',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
format_missing_url = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|$2=</code>',
anchor = 'format_missing_url',
category = 'Pages using citations with format and no URL',
hidden = false
},
invalid_param_val = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>',
anchor = 'invalid_param_val',
category = 'CS1 errors: invalid parameter value',
hidden = false
},
invisible_char = {
message = '$1 in $2 at position $3',
anchor = 'invisible_char',
category = 'CS1 errors: invisible characters',
hidden = false
},
missing_name = {
message = 'Missing <code class="cs1-code">|$1$2=</code>', -- $1 is modified NameList; $2 is enumerator
anchor = 'missing_name',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
missing_periodical = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1
anchor = 'missing_periodical',
category = 'CS1 errors: missing periodical',
hidden = true
},
missing_pipe = {
message = 'Missing pipe in: <code class="cs1-code">|$1=</code>',
anchor = 'missing_pipe',
category = 'CS1 errors: missing pipe',
hidden = false
},
param_access_requires_param = {
message = '<code class="cs1-code">|$1-access=</code> requires <code class="cs1-code">|$1=</code>',
anchor = 'param_access_requires_param',
category = 'CS1 errors: param-access',
hidden = false
},
param_has_ext_link = {
message = 'External link in <code class="cs1-code">$1</code>',
anchor = 'param_has_ext_link',
category = 'CS1 errors: external links',
hidden = false
},
parameter_ignored = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored',
anchor = 'parameter_ignored',
category = 'Pages with citations using unsupported parameters',
hidden = false
},
parameter_ignored_suggest = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored (<code class="cs1-code">|$2=</code> suggested)',
anchor = 'parameter_ignored_suggest',
category = 'Pages with citations using unsupported parameters',
hidden = false
},
redundant_parameters = {
message = 'More than one of $1 specified',
anchor = 'redundant_parameters',
category = 'Pages with citations having redundant parameters',
hidden = false
},
script_parameter = {
message = 'Invalid <code class="cs1-code">|$1=</code>: $2',
anchor = 'script_parameter',
category = 'CS1 errors: script parameters',
hidden = false
},
ssrn_missing = {
message = '<code class="cs1-code">|ssrn=</code> required',
anchor = 'ssrn_missing',
category = 'CS1 errors: ssrn', -- same as bad arxiv
hidden = false
},
text_ignored = {
message = 'Text "$1" ignored',
anchor = 'text_ignored',
category = 'Pages with citations using unnamed parameters',
hidden = false
},
trans_missing_title = {
message = '<code class="cs1-code">|trans-$1=</code> requires <code class="cs1-code">|$1=</code>',
anchor = 'trans_missing_title',
category = 'CS1 errors: translated title',
hidden = false
},
vancouver = {
message = 'Vancouver style error: $1',
anchor = 'vancouver',
category = 'CS1 errors: Vancouver style',
hidden = false
},
wikilink_in_url = {
message = 'URL–wikilink conflict', -- uses ndash
anchor = 'wikilink_in_url',
category = 'CS1 errors: URL–wikilink conflict', -- uses ndash
hidden = false
},
}
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
The following contains a list of values for various defined identifiers. For each identifier we specify a
variety of information necessary to properly render the identifier in the citation.
parameters: a list of parameter aliases for this identifier
link: Wikipedia article name
q: wikidata q number for the identifier
label: the alternate name to apply to link
mode: 'manual' when there is a specific function in the code to handle the identifier;
'external' for identifiers that link outside of Wikipedia;
prefix: the first part of a url that will be concatenated with a second part which usually contains the identifier
encode: true if uri should be percent encoded; otherwise false
COinS: identifier link or keyword for use in COinS:
for identifiers registered at info-uri.info use: info:....
for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
for others make a url using the value in prefix, use the keyword: pre (not checked; any text other than 'info' or 'rft' works here)
set to nil to leave the identifier out of the COinS
separator: character or text between label and the identifier in the rendered citation
access: use this parameter to set the access level for all instances of this identifier.
the value must be a valid access level for an identifier (see ['id-access'] in this file).
custom_access: to enable custom access level for an identifier, set this parameter
to the parameter that should control it (normally 'id-access')
]]
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'eprint'},
link = 'arXiv',
q = 'Q118398',
label = 'arXiv',
mode = 'manual',
prefix = '//arxiv.org/abs/', -- protocol relative tested 2013-09-04
encode = false,
COinS = 'info:arxiv',
separator = ':',
access = 'free', -- free to read
},
['ASIN'] = {
parameters = { 'asin', 'ASIN' },
link = 'Amazon Standard Identification Number',
q = 'Q1753278',
label = 'ASIN',
mode = 'manual',
prefix = '//www.amazon.',
COinS = nil, -- no COinS for this id (needs thinking on implementation because |asin-tld=)
separator = ' ',
encode = false;
},
['BIBCODE'] = {
parameters = {'bibcode'},
link = 'Bibcode',
q = 'Q25754',
label = 'Bibcode',
mode = 'manual',
prefix = 'https://ui.adsabs.harvard.edu/abs/',
encode = false,
COinS = 'info:bibcode',
separator = ':',
custom_access = 'bibcode-access',
},
['BIORXIV'] = {
parameters = {'biorxiv'},
link = 'bioRxiv',
q = 'Q19835482',
label = 'bioRxiv',
mode = 'manual',
prefix = '//doi.org/10.1101/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['CITESEERX'] = {
parameters = {'citeseerx'},
link = 'CiteSeerX',
q = 'Q2715061',
label = 'CiteSeerX',
mode = 'manual', -- manual for custom validation of the "doi"
prefix = '//citeseerx.ist.psu.edu/viewdoc/summary?doi=',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['DOI'] = { -- (Used by InternetArchiveBot)
parameters = { 'doi', 'DOI' },
link = 'Digital object identifier',
q = 'Q25670',
label = 'doi',
mode = 'manual',
prefix = '//doi.org/',
COinS = 'info:doi',
separator = ':',
encode = true,
custom_access = 'doi-access',
},
['EISSN'] = {
parameters = {'eissn', 'EISSN'},
link = 'International_Standard_Serial_Number#Electronic_ISSN',
q = 'Q46339674',
label = 'eISSN',
mode = 'manual',
prefix = '//www.worldcat.org/issn/',
COinS = 'rft.eissn',
encode = false,
separator = ' ',
},
['HDL'] = {
parameters = { 'hdl', 'HDL' },
link = 'Handle System',
q = 'Q3126718',
label = 'hdl',
mode = 'manual',
prefix = '//hdl.handle.net/',
COinS = 'info:hdl',
separator = ':',
encode = true,
custom_access = 'hdl-access',
},
['ISBN'] = { -- (Used by InternetArchiveBot)
parameters = {'isbn', 'ISBN', 'isbn13', 'ISBN13'},
link = 'International Standard Book Number',
q = 'Q33057',
label = 'ISBN',
mode = 'manual',
prefix = 'Special:BookSources/',
COinS = 'rft.isbn',
separator = ' ',
},
['ISMN'] = {
parameters = {'ismn', 'ISMN'},
link = 'International Standard Music Number',
q = 'Q1666938',
label = 'ISMN',
mode = 'manual',
prefix = '', -- not currently used;
COinS = 'nil', -- nil because we can't use pre or rft or info:
separator = ' ',
},
['ISSN'] = {
parameters = {'issn', 'ISSN'},
link = 'International Standard Serial Number',
q = 'Q131276',
label = 'ISSN',
mode = 'manual',
prefix = '//www.worldcat.org/issn/',
COinS = 'rft.issn',
encode = false,
separator = ' ',
},
['JFM'] = {
parameters = {'jfm', 'JFM'},
link = 'Jahrbuch über die Fortschritte der Mathematik',
q = '',
label = 'JFM',
mode = 'manual',
prefix = '//zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['JSTOR'] = {
parameters = {'jstor', 'JSTOR'},
link = 'JSTOR',
q = 'Q1420342',
label = 'JSTOR',
mode = 'external',
prefix = '//www.jstor.org/stable/', -- protocol relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
custom_access = 'jstor-access',
},
['LCCN'] = {
parameters = {'LCCN', 'lccn'},
link = 'Library of Congress Control Number',
q = 'Q620946',
label = 'LCCN',
mode = 'manual',
prefix = '//lccn.loc.gov/', -- protocol relative tested 2015-12-28
COinS = 'info:lccn', -- use prefix value
encode = false,
separator = ' ',
},
['MR'] = {
parameters = {'MR', 'mr'},
link = 'Mathematical Reviews',
q = 'Q211172',
label = 'MR',
mode = 'manual',
prefix = '//www.ams.org/mathscinet-getitem?mr=', -- protocol relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['OCLC'] = {
parameters = {'OCLC', 'oclc'},
link = 'OCLC',
q = 'Q190593',
label = 'OCLC',
mode = 'manual',
prefix = '//www.worldcat.org/oclc/',
COinS = 'info:oclcnum',
encode = true,
separator = ' ',
},
['OL'] = {
parameters = { 'ol', 'OL' },
link = 'Open Library',
q = 'Q1201876',
label = 'OL',
mode = 'manual',
prefix = '//openlibrary.org/',
COinS = nil, -- no COinS for this id (needs thinking on implementation because /authors/books/works/OL)
separator = ' ',
encode = true,
custom_access = 'ol-access',
},
['OSTI'] = {
parameters = {'OSTI', 'osti'},
link = 'Office of Scientific and Technical Information',
q = 'Q2015776',
label = 'OSTI',
mode = 'external',
prefix = '//www.osti.gov/biblio/', -- protocol relative tested 2018-09-12
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
custom_access = 'osti-access',
},
['PMC'] = {
parameters = {'PMC', 'pmc'},
link = 'PubMed Central',
q = 'Q229883',
label = 'PMC',
mode = 'manual',
prefix = '//www.ncbi.nlm.nih.gov/pmc/articles/PMC',
suffix = " ",
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
access = 'free', -- free to read
},
['PMID'] = {
parameters = {'PMID', 'pmid'},
link = 'PubMed Identifier',
q = '',
label = 'PMID',
mode = 'manual',
-- prefix = '//www.ncbi.nlm.nih.gov/pubmed/',
prefix = '//pubmed.ncbi.nlm.nih.gov/', -- new for 2020
COinS = 'info:pmid',
encode = false,
separator = ' ',
},
['RFC'] = {
parameters = {'RFC', 'rfc'},
link = 'Request for Comments',
q = 'Q212971',
label = 'RFC',
mode = 'external',
prefix = '//tools.ietf.org/html/rfc',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
access = 'free', -- free to read
},
['SSRN'] = {
parameters = {'SSRN', 'ssrn'},
link = 'Social Science Research Network',
q = 'Q7550801',
label = 'SSRN',
mode = 'manual',
prefix = '//ssrn.com/abstract=', -- protocol relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
access = 'free', -- always free to read
},
['USENETID'] = {
parameters = {'message-id'},
link = 'Usenet',
q = 'Q193162',
label = 'Usenet:',
mode = 'manual',
prefix = 'news:',
encode = false,
COinS = 'pre', -- use prefix value
separator = ' ',
},
['ZBL'] = {
parameters = {'ZBL', 'zbl'},
link = 'Zentralblatt MATH',
q = 'Q190269',
label = 'Zbl',
mode = 'manual',
prefix = '//zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
}
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
aliases = aliases,
special_case_translation = special_case_translation,
defaults = defaults,
date_names = date_names,
error_conditions = error_conditions,
editor_markup_patterns = editor_markup_patterns,
et_al_patterns = et_al_patterns,
global_df = global_df,
id_handlers = id_handlers,
keywords_lists = keywords_lists,
keywords_xlate = keywords_xlate,
stripmarkers=stripmarkers,
invisible_chars = invisible_chars,
indic_script = indic_script,
local_lang_cat_enable = local_lang_cat_enable,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
punct_skip = punct_skip,
script_lang_codes = script_lang_codes,
lang_code_remap = lang_code_remap,
lang_name_remap = lang_name_remap,
this_wiki_code = this_wiki_code,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces,
uncategorized_subpages = uncategorized_subpages,
templates_using_volume = templates_using_volume,
templates_using_issue = templates_using_issue,
templates_not_using_page = templates_not_using_page,
}
ddf60a780d143f62224dbde9f95759a9d7bfaa03
Module:Citation/CS1/Date validation
828
88
174
2021-06-05T23:18:30Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1/Date_validation]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local is_set, in_array; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |accessdate= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-Engish date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to unix timesatmp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct. If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |embargo= is
set, the editor intended to embargo a pmc but |embargo= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match ('^%d%d%d%d%-%d%d%-%d%d$') or -- ymd
v:match ('^%d%d?%s+%a+%s+%d%d%d%d$') or -- dmy
v:match ('^%a+%s+%d%d?%s*,%s*%d%d%d%d$') then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 1 for Winter, etc. Capitalization and spelling must be correct. If not a valid season, returns 0
Uses ISO DIS 8601 2016 part 2 §4.7 Divisions of a year for hemishpere-independent seasons:
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season)
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< I S _ P R O P E R _ N A M E >--------------------------------------------------
returns a non-zero number if date contains a recognized proper name. Capitalization and spelling must be correct.
]]
local function is_proper_name (name)
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ O R _ S E A S O N >------------------------------
--returns true if month or season is valid (properly spelled, capitalized, abbreviated)
]]
local function is_valid_month_or_season (month_season)
if 0 == get_month_number (month_season) then -- if month text isn't one of the twelve months, might be a season
if 0 == get_season_number (month_season) then -- not a month, is it a season?
return false; -- return false not a month or one of the five seasons
end
end
return true;
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one year in the future are not acceptable.
]]
local function is_valid_year(year)
if not is_set(year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to numbers for the comparison;
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year(year) then -- no farther into the future than next year
return false;
end
month = tonumber(month); -- required for YYYY-MM-DD dates
if (2==month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0==(year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0==(year%4) and (0~=(year%100) or 0==(year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length=days_in_month[month];
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
There is a special test for May because it can be either short or long form.
Returns true when style for both months is the same
]]
local function is_valid_month_range_style (month1, month2)
local len1 = month1:len();
local len2 = month2:len();
if len1 == len2 then
return true; -- both months are short form so return true
elseif 'May' == month1 or 'May'== month2 then
return true; -- both months are long form so return true
elseif 3 == len1 or 3 == len2 then
return false; -- months are mixed form so return false
else
return true; -- both months are long form so return true
end
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue so ... ok
]]
local function is_valid_month_season_range(range_start, range_end)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) then
return true; -- any season pairing is accepted
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number then -- range_start is a month; does range_start precede range_end?
if is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an IS8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and propername dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
-- start temporary Julian / Gregorian calendar uncertainty detection
local year = tonumber(input.year); -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 october to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gergorian calendar uncertainty detection
if 1582 > tonumber(input.year) or 20 < tonumber(input.month) then -- Julian calendar or season so &rft.date gets year only
date = input.year;
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', tonumber(input.year), tonumber(input.year2)) -- assemble the date range
end
if 20 < tonumber(input.month) then -- if season or propername date
local season = {[24]='winter', [21]='spring', [22]='summer', [23]='fall', [99]='Christmas'}; -- seasons lowercase, no autumn; proper names use title case
if 0 == input.month2 then -- single season date
if 30 <tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper name dates
else
tCOinS_date.rftssn = season[input.month]; -- seasons
end
else -- season range with a second season specified
if input.year ~= input.year2 then -- season year – season year range or season year–year
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
if 0~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2);
end
else -- season–season year range
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range
end
end
end
tCOinS_date.rftdate = date;
return; -- done
end
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns = {
-- year-initial numerical year-month-day
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +((%d%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) *(%D-) +((%d%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^((%d%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +(%d%d%d%d) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +(%d%d%d%d) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +(%d%d%d%d) +[%-–] +(%D-) +((%d%d%d%d)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +((%d%d%d%d)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year
['My'] = {'^([^%d–]-) +((%d%d%d%d)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +(%d%d%d%d)[%-–]((%d%d%d%d)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^(%d%d%d%d?)[%-–]((%d%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^((%d%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, accessdate, embargo, archivedate, etc.)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, tCOinS_date, test_accessdate)
local year; -- assume that year2, months, and days are not used;
local year2=0; -- second year in a year range
local month=0;
local month2=0; -- second month in a month range
local day=0;
local day2=0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns['ymd'][1]) then -- year-initial numerical year month day format
year, month, day=date_string:match (patterns['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year=mw.ustring.match(date_string, patterns['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year=mw.ustring.match(date_string, patterns['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2=year;
elseif mw.ustring.match(date_string, patterns['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year=mw.ustring.match(date_string, patterns['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day=mw.ustring.match(date_string, patterns['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year=mw.ustring.match(date_string, patterns['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2=year;
elseif mw.ustring.match(date_string, patterns['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year=mw.ustring.match(date_string, patterns['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2=year;
elseif mw.ustring.match(date_string, patterns['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year=mw.ustring.match(date_string, patterns['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2=year;
elseif mw.ustring.match(date_string, patterns['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2=mw.ustring.match(date_string, patterns['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
elseif mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2=mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
elseif mw.ustring.match(date_string, patterns['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2=mw.ustring.match(date_string, patterns['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year=year..'–'..anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number (month);
elseif mw.ustring.match(date_string, patterns['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2=mw.ustring.match(date_string, patterns['Sy-y'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year=year..'–'..anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number (month); -- for metadata
elseif mw.ustring.match(date_string, patterns['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2=mw.ustring.match(date_string, patterns['My-My'][1]);
anchor_year=year..'–'..anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month) and 0 ~= get_season_number(month2) then -- both must be or season year, not mixed
month = get_season_number(month);
month2 = get_season_number(month2);
else
return false;
end
elseif mw.ustring.match(date_string, patterns['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year=mw.ustring.match(date_string, patterns['M-My'][1]);
if (not is_valid_month_season_range(month, month2)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
else
month = get_season_number(month);
month2 = get_season_number(month2);
end
year2=year;
elseif mw.ustring.match(date_string, patterns['My'][1]) then -- month/season year or proper-name year
month, anchor_year, year=mw.ustring.match(date_string, patterns['My'][1]);
if not is_valid_year(year) then return false; end
if not is_valid_month_or_season (month) and 0 == is_proper_name (month) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
elseif 0 ~= get_season_number(month) then
month = get_season_number(month);
else
month = is_proper_name (month); -- must be proper name; not supported in COinS
end
elseif mw.ustring.match(date_string, patterns['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2=mw.ustring.match(date_string, patterns['y-y'][1]);
anchor_year=year..'–'..anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2=mw.ustring.match(date_string, patterns['y4-y2'][1]);
anchor_year=year..'–'..anchor_year; -- assemble anchor year from both years
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century..year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match (date_string, patterns['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year=mw.ustring.match (date_string, patterns['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if test_accessdate then -- test accessdate here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; accessdate must not be a range
if not is_valid_accessdate (year..'-'..month..'-'..day) then
return false; -- return false when accessdate out of bounds
end
else
return false; -- return false when accessdate is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result=is_valid_date(year,month,day);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result=is_valid_date(year,month,day);
result=result and is_valid_date(year,month,day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result=is_valid_date(year,month,day);
result=result and is_valid_date(year,month2,day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result=is_valid_date(year,month,day);
result=result and is_valid_date(year2,month2,day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year=year, month=month, day=day, year2=year2, month2=month2, day2=day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
a single error message is created as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local error_message = "";
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub (v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date'==k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year'==k then
good_date = is_valid_year(year);
end
elseif 'date'==k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); --"n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); --"nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, tCOinS_date); -- go test the date
end
elseif 'year'==k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year= 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
end
elseif 'access-date'==k then -- if the parameter is |date=
good_date = check_date (v.val, nil, true); -- go test the date; nil is a placeholder; true is the test_accessdate flag
elseif 'embargo'==k then -- if the parameter is |embargo=
good_date = check_date (v.val); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |embargo= date a single dmy, mdy, or ymd formatted date? yes:returns embargo; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val); -- go test the date
end
if false==good_date then -- assemble one error message so we don't add the tracking category multiple times
if is_set(error_message) then -- once we've added the first portion of the error message ...
error_message=error_message .. ", "; -- ... add a comma space separator
end
error_message=error_message .. "|" .. v.name .. "="; -- add the failed parameter
end
end
end
return anchor_year, embargo_date, error_message; -- and done
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function returns a numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
]]
local function year_date_check (year_string, date_string)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') and year_string:match ('%d%d%d%d%a') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
else
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else
result = 0; -- no recognizable year in date
end
return result;
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps patern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns[pattern_idx][1]
Items in patterns{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns['ymd'][2] is an indicator letter identifying the content of the first capture
patterns['ymd'][3] ... the second capture etc
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- not supported at en.wiki
if 'yMd' == format_param then -- not supported at en.wiki
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns[pattern_idx][2..]
[patterns[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns[pattern_idx][3] or 'x'] = c2; -- patterns can have a variable number of captures; each capture requires an indicator letter;
[patterns[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns[pattern_idx][n] will be nil;
[patterns[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns[pattern_idx][6] or 'x'] = c5;
[patterns[pattern_idx][7] or 'x'] = c6;
[patterns[pattern_idx][8] or 'x'] = c7;
};
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_s'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_l'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
if 1582 > tonumber(t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_s'][t[mon]]) or cfg.date_names['inv_local_l'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then
if not mw.ustring.match (param_val.val, '%d%d%d%d%-%d%d%-%d%d') then -- for those that are not ymd dates (ustring because here digits may not be western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English month names to local-language month names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '%a+') do -- iterate through all dates in the date (single date or date range)
if cfg.date_names.en.long[month] then
mode = 'F'; -- English name is long so use long local name
elseif cfg.date_names.en.short[month] then
mode = 'M'; -- English name is short so use short local name
else
mode = nil; -- not an English month name; could be local language month name or an English season name
end
if mode then -- might be a season
xlate = lang_object:formatDate(mode, '1' .. month); -- translate the month name to this local language
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
is_set = utilities_page_ptr.is_set; -- import functions from selected Module:Citation/CS1/Utilities module
in_array = utilities_page_ptr.in_array; -- import functions from selected Module:Citation/CS1/Utilities module
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
dates = dates,
year_date_check = year_date_check,
reformat_dates = reformat_dates,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
set_selected_modules = set_selected_modules
}
ceb2a1f045831c93875c98c30b6c73da97d557c9
Module:Citation/CS1/Identifiers
828
89
176
2021-06-05T23:18:30Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1/Identifiers]]
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local is_set, in_array, set_error, select_one, add_maint_cat, substitute, make_wikilink; -- functions in Module:Citation/CS1/Utilities
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki style external link
]]
local function external_link_id(options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode( url_string );
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki(options.id));
if is_set(options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
-- this_wiki_code = mw.language.getContentLanguage():getCode(); -- get this wikipedia's language code (subdomain)
if string.match (mw.site.server, 'wikidata') then
this_wiki_code = mw.getCurrentFrame():preprocess('{{int:lang}}'); -- on wikidata so use interface language setting instead
end
if is_set (options.q) and mw.wikibase then -- wikibase test here avoids script errors in third party wikis that aren't using mw.wikibase extension
wd_article = mw.wikibase.getEntity (options.q):getSitelink (this_wiki_code .. 'wiki'); -- fetch article title from wd
if wd_article then
wd_article = table.concat ({':', this_wiki_code, ':', wd_article}); -- make interwiki link if taken from wd; leading colon required
end
end
return table.concat ({
make_wikilink (wd_article or options.link, options.label), -- wikidata link or locally specified
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki style internal link
]]
local function internal_link_id(options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (options.link, options.label),
options.separator or ' ',
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latn script identifiers from being reversed at rtl language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |embargo= against today's date. If embargo date is
in the future, returns the content of |embargo=; otherwise, returns and empty string because the embargo has expired or because
|embargo= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, good2, todays_date;
good1, embargo_date = pcall( lang.formatDate, lang, 'U', embargo );
good2, todays_date = pcall( lang.formatDate, lang, 'U' );
if good1 and good2 then -- if embargo date and today's date are good dates
if tonumber( embargo_date ) >= tonumber( todays_date ) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
add_maint_cat ('embargo')
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |embargo= not set return empty string
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all isbn/issn digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, issbn/issn must be checked for length
and stripped of dashes, spaces and other non-isxn characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len+1; -- adjust to be a loop counter
for i, v in ipairs( isxn_str ) do -- loop through all of the bytes and calculate the checksum
if v == string.byte( "X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10*( len - i ); -- it represents 10 decimal
else
temp = temp + tonumber( string.char(v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 isbn/ismn digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, isbn-13/ismn must be checked for length
and stripped of dashes, spaces and other non-isxn-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs( isxn_str ) do
temp = temp + (3 - 2*(i % 2)) * tonumber( string.char(v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when isbn-13/ismn is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
lccn normalization (http://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized lccn for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn,'/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix=string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn=prefix..suffix; -- reassemble the lccn
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: http://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9108 and 0703 is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (id, class)
local handler = cfg.id_handlers['ARXIV'];
local year, month, version;
local err_cat = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9108-0703 format w/ & w/o version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_cat = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 w/ & w/o version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then --or -- when year is 07, is month invalid (before April)?
err_cat = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format w/ & w/o version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_cat = true; -- flag for error message
end
else
err_cat = true; -- not a recognized format; flag for error message
end
err_cat = err_cat and table.concat ({' ', set_error ('bad_arxiv')}) or ''; -- set error message if flag is true
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=handler.access}) .. err_cat;
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[//arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
text = table.concat ({text, ' ', set_error ('class_ignored')});
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode id.
Format for bibcodes is specified here: http://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (id, access)
local handler = cfg.id_handlers['BIBCODE'];
local err_type;
local year;
local text = external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix, id=id, separator=handler.separator, encode=handler.encode,
access=access});
if 19 ~= id:len() then
err_type = 'length';
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$") --
if not year then -- if nil then no pattern match
err_type = 'value'; -- so value error
else
local next_year = tonumber(os.date ('%Y'))+1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = 'year'; -- year out of bounds
end
if id:find('&%.') then
err_type = 'journal'; -- journal abbreviation must not have '&.' (if it does its missing a letter)
end
end
end
if is_set (err_type) then -- if there was an error detected
text = text .. ' ' .. set_error( 'bad_bibcode', {err_type});
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv id and do simple error checking. BiorXiv ids are exactly 6 digits.
The bioRxiv id is the number following the last slash in the bioRxiv-issued DOI:
https://doi.org/10.1101/078733 -> 078733
]]
local function biorxiv(id)
local handler = cfg.id_handlers['BIORXIV'];
local err_cat = ''; -- presume that bioRxiv id is valid
if nil == id:match("^%d%d%d%d%d%d$") then -- if bioRxiv id has anything but six digits
err_cat = ' ' .. set_error( 'bad_biorxiv'); -- set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator,
encode=handler.encode, access=handler.access}) .. err_cat;
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (id)
local handler = cfg.id_handlers['CITESEERX'];
local matched;
local text = external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix, id=id, separator=handler.separator, encode=handler.encode,
access=handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
text = text .. ' ' .. set_error( 'bad_citeseerx' );
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the doi name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in doi names.
]]
local function doi(id, inactive, access)
local cat = ""
local handler = cfg.id_handlers['DOI'];
local text;
if is_set(inactive) then
local inactive_year = inactive:match("%d%d%d%d") or ''; -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
else
inactive_year = nil; -- |doi-broken= has something but it isn't a date
end
if is_set(inactive_year) and is_set (inactive_month) then
table.insert( z.error_categories, 'Pages with DOIs inactive as of ' .. inactive_year .. ' ' .. inactive_month); -- use inactive month in category name
elseif is_set(inactive_year) then
table.insert( z.error_categories, 'Pages with DOIs inactive as of ' .. inactive_year);
else
table.insert( z.error_categories, 'Pages with inactive DOIs'); -- when inactive doesn't contain a recognizable date
end
inactive = " (" .. cfg.messages['inactive'] .. ' ' .. inactive .. ')';
end
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=access}) .. (inactive or '')
local registrant = id:match ('^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when doi has the proper basic form
registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d%d*$', -- 5 digits with subcode (0xxxx, 40000+); accecpts: 10000–39999
'^[^1-3]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 40000+); accecpts: 10000–39999
'^[^1-9]%d%d%d%.%d%d*$', -- 4 digits with subcode (0xxx); accecpts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accecpts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (with subcode is legitimate)
'^5555$', -- test registrant will never resolve
}
if registrant then -- when doi has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
cat = ' ' .. set_error ('bad_doi'); -- when found, mark this doi as bad
break; -- and done
end
end
else
cat = ' ' .. set_error ('bad_doi'); -- invalid directory or malformed
end
return text .. cat
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
]]
local function hdl(id, access)
local handler = cfg.id_handlers['HDL'];
local text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- hdl must contain a fwd slash, must not contain spaces, endashes, and must not end with period or comma
text = text .. ' ' .. set_error( 'bad_hdl' );
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn( isbn_str )
if nil ~= isbn_str:match("[^%s-0-9X]") then
return false, 'invalid character'; -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
isbn_str = isbn_str:gsub( "-", "" ):gsub( " ", "" ); -- remove hyphens and spaces
local len = isbn_str:len();
if len ~= 10 and len ~= 13 then
return false, 'length'; -- fail if incorrect length
end
if len == 10 then
if isbn_str:match( "^%d*X?$" ) == nil then -- fail if isbn_str has 'X' anywhere but last position
return false, 'invalid form';
end
return is_valid_isxn(isbn_str, 10), 'checksum';
else
if isbn_str:match( "^%d+$" ) == nil then
return false, 'invalid character'; -- fail if isbn13 is not all digits
end
if isbn_str:match( "^97[89]%d*$" ) == nil then
return false, 'invalid prefix'; -- fail when isbn13 does not begin with 978 or 979
end
if isbn_str:match ('^9790') then
return false, 'invalid group id'; -- group identifier '0' is reserved to ismn
end
return is_valid_isxn_13 (isbn_str), 'checksum';
end
end
--[[--------------------------< A M A Z O N >------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: asin must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, asins must be 10-digit
isbn. If 10-digit isbn, add a maintenance category so a bot or awb script can replace |asin= with |isbn=.
Error message if not 10 characters, if not isbn10, if mixed and first character is a digit.
This function is positioned here because it calls isbn()
]]
local function asin(id, domain)
local err_cat = ""
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_cat = ' ' .. set_error ('bad_asin'); -- asin is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if isbn( id ) then -- see if asin value is isbn10
add_maint_cat ('ASIN');
elseif not is_set (err_cat) then
err_cat = ' ' .. set_error ('bad_asin'); -- asin is not isbn10
end
elseif not id:match("^%u[%d%u]+$") then
err_cat = ' ' .. set_error ('bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if not is_set(domain) then
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'au', 'br', 'mx'}) then -- Australia, Brazil, Mexico
domain = "com." .. domain;
end
local handler = cfg.id_handlers['ASIN'];
return external_link_id({link=handler.link,
label=handler.label, q = handler.q, prefix=handler.prefix .. domain .. "/dp/",
id=id, encode=handler.encode, separator = handler.separator}) .. err_cat;
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to isbn-13, ismn is 13 digits begining 979-0-... and uses the
same check digit calculations. See http://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
]]
local function ismn (id)
local handler = cfg.id_handlers['ISMN'];
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id=id:gsub( "[%s-–]", "" ); -- strip spaces, hyphens, and endashes from the ismn
if 13 ~= id:len() or id:match( "^9790%d*$" ) == nil then -- ismn must be 13 digits and begin 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ismn
end
-- text = internal_link_id({link = handler.link, label = handler.label, -- use this (or external version) when there is some place to link to
-- prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
text = table.concat (
{
make_wikilink (handler.link, handler.label),
handler.separator,
id_copy
}); -- because no place to link to yet
if false == valid_ismn then
text = text .. ' ' .. set_error( 'bad_ismn' ) -- add an error message if the ismn is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an issn. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [http://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the issn midpoint. It also validates the issn for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check issn error message. The
issn is always displayed with a hyphen, even if the issn was given as a single group of 8 digits.
]]
local function issn(id, e)
local issn_copy = id; -- save a copy of unadulterated issn; use this version for display if issn does not validate
local handler;
local text;
local valid_issn = true;
if e then
handler = cfg.id_handlers['EISSN'];
else
handler = cfg.id_handlers['ISSN'];
end
id=id:gsub( "[%s-–]", "" ); -- strip spaces, hyphens, and endashes from the issn
if 8 ~= id:len() or nil == id:match( "^%d*X?$" ) then -- validate the issn: 8 digits long, containing only 0-9 or X in the last position
valid_issn=false; -- wrong length or improper character
else
valid_issn=is_valid_isxn(id, 8); -- validate issn
end
if true == valid_issn then
id = string.sub( id, 1, 4 ) .. "-" .. string.sub( id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, use the show the invalid issn with error message
end
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
if false == valid_issn then
text = text .. ' ' .. set_error( 'bad_issn', e and 'e' or '' ) -- add an error message if the issn is invalid
end
return text
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (id)
local handler = cfg.id_handlers['JFM'];
local id_num;
local err_cat = '';
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
add_maint_cat ('jfm_format');
else -- plain number without mr prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
err_cat = ' ' .. set_error( 'bad_jfm' ); -- set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
http://info-uri.info/registry/OAIHandler?verb=GetRecord&metadataPrefix=reg&identifier=info:lccn/
length = 8 then all digits
length = 9 then lccn[1] is lower case alpha
length = 10 then lccn[1] and lccn[2] are both lower case alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lower case alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lower case alpha
]]
local function lccn(lccn)
local handler = cfg.id_handlers['LCCN'];
local err_cat = ''; -- presume that LCCN is valid
local id = lccn; -- local copy of the lccn
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the lccn
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_cat = ' ' .. set_error( 'bad_lccn' ); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_cat = ' ' .. set_error( 'bad_lccn' ); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_cat = ' ' .. set_error( 'bad_lccn' ); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_cat = ' ' .. set_error( 'bad_lccn' ); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_cat = ' ' .. set_error( 'bad_lccn' ); -- no match, set an error message
end
else
err_cat = ' ' .. set_error( 'bad_lccn' ); -- wrong length, set an error message
end
if not is_set (err_cat) and nil ~= lccn:find ('%s') then
err_cat = ' ' .. set_error( 'bad_lccn' ); -- lccn contains a space, set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=lccn,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (id)
local handler = cfg.id_handlers['MR'];
local id_num;
local id_len;
local err_cat = '';
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
add_maint_cat ('mr_format');
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len ) .. id_num; -- zero-fill leading digits
else
err_cat = ' ' .. set_error( 'bad_mr' ); -- set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an oclc id. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (id)
local handler = cfg.id_handlers['OCLC'];
local number;
local err_msg = ''; -- empty string for concatenation
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- contrain to 1 to 9 digits; change this when oclc issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if 10 < number:len() then
number = nil; -- contrain to 1 to 10 digits; change this when oclc issues 11-digit numbers
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
err_msg = ' ' .. set_error( 'bad_oclc' ) -- add an error message if the id is malformed
end
local text = external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix, id=id, separator=handler.separator, encode=handler.encode}) .. err_msg;
return text;
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary(id, access)
local code;
local handler = cfg.id_handlers['OL'];
local ident;
ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W'; remove OL prefix
if not is_set (ident) then -- if malformed return an error
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access}) .. ' ' .. set_error( 'bad_ol' );
end
id = ident; -- use ident without the optional OL prefix (it has been removed)
if ( code == "A" ) then
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'authors/OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access})
end
if ( code == "M" ) then
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'books/OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access})
end
if ( code == "W" ) then
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'works/OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access})
end
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc(id, embargo)
local test_limit = 8000000; -- update this value as PMCs approach
local handler = cfg.id_handlers['PMC'];
local err_cat = ''; -- presume that PMC is valid
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with pmc prefix
if is_set (id_num) then
add_maint_cat ('pmc_format');
else -- plain number without pmc prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber(id_num); -- convert id_num to a number for range testing
if 1 > id_num or test_limit < id_num then -- if PMC is outside test limit boundaries
err_cat = ' ' .. set_error( 'bad_pmc' ); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_cat = ' ' .. set_error( 'bad_pmc' ); -- set an error message
end
if is_set (embargo) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (handler.link, handler.label),
handler.separator,
id,
err_cat
});
else
text = external_link_id({link = handler.link, label = handler.label, q = handler.q, -- no embargo date or embargo has expired, ok to link to article
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=handler.access}) .. err_cat;
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid(id)
local test_limit = 33000000; -- update this value as PMIDs approach
local handler = cfg.id_handlers['PMID'];
local err_cat = ''; -- presume that PMID is valid
if id:match("[^%d]") then -- if PMID has anything but digits
err_cat = ' ' .. set_error( 'bad_pmid' ); -- set an error message
else -- PMID is only digits
local id_num = tonumber(id); -- convert id to a number for range testing
if 1 > id_num or test_limit < id_num then -- if PMID is outside test limit boundaries
err_cat = ' ' .. set_error( 'bad_pmid' ); -- set an error message
end
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an ssrn, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the ssrn to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (id)
local test_limit = 3500000; -- update this value as SSRNs approach
local handler = cfg.id_handlers['SSRN'];
local err_cat = ''; -- presume that SSRN is valid
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber(id_num); -- convert id_num to a number for range testing
if 100 > id_num or test_limit < id_num then -- if SSRN is outside test limit boundaries
err_cat = ' ' .. set_error( 'bad_ssrn' ); -- set an error message
end
else -- when id format incorrect
err_cat = ' ' .. set_error( 'bad_ssrn' ); -- set an error message
end
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=handler.access}) .. err_cat;
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (id)
local handler = cfg.id_handlers['USENETID'];
local text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$')then -- doesn't have '@' or has one or first or last character is '< or '>'
text = text .. ' ' .. set_error( 'bad_usenet_id' ) -- add an error message if the message id is invalid
end
return text
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (id)
local handler = cfg.id_handlers['ZBL'];
local err_cat = '';
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
add_maint_cat ('zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
err_cat = ' ' .. set_error( 'bad_zbl' ); -- no, set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< B U I L D _ I D _ L I S T >--------------------------------------------------------
Takes a table of IDs created by extract_ids() and turns it into a table of formatted ID outputs.
inputs:
id_list – table of identifiers built by extract_ids()
options – table of various template parameter values used to modify some manually handled identifiers
]]
local function build_id_list( id_list, options )
local new_list, handler = {};
local function fallback(k) return { __index = function(t,i) return cfg.id_handlers[k][i] end } end;
for k, v in pairs( id_list ) do -- k is uc identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
-- fallback to read-only cfg
handler = setmetatable( { ['id'] = v, ['access'] = options.IdAccessLevels[k] }, fallback(k) );
if handler.mode == 'external' then
table.insert( new_list, {handler.label, external_link_id( handler ) } );
elseif handler.mode == 'internal' then
table.insert( new_list, {handler.label, internal_link_id( handler ) } );
elseif handler.mode ~= 'manual' then
error( cfg.messages['unknown_ID_mode'] );
elseif k == 'ARXIV' then
table.insert( new_list, {handler.label, arxiv( v, options.Class ) } );
elseif k == 'ASIN' then
table.insert( new_list, {handler.label, asin( v, options.ASINTLD ) } );
elseif k == 'BIBCODE' then
table.insert( new_list, {handler.label, bibcode( v, handler.access ) } );
elseif k == 'BIORXIV' then
table.insert( new_list, {handler.label, biorxiv( v ) } );
elseif k == 'CITESEERX' then
table.insert( new_list, {handler.label, citeseerx( v ) } );
elseif k == 'DOI' then
table.insert( new_list, {handler.label, doi( v, options.DoiBroken, handler.access ) } );
elseif k == 'EISSN' then
table.insert( new_list, {handler.label, issn( v, true ) } ); -- true distinguishes eissn from issn
elseif k == 'HDL' then
table.insert( new_list, {handler.label, hdl( v, handler.access ) } );
elseif k == 'ISBN' then
local ISBN = internal_link_id( handler );
local check;
local err_type = '';
check, err_type = isbn( v );
if not check then
if is_set(options.IgnoreISBN) then -- ISBN is invalid; if |ignore-isbn-error= set
add_maint_cat ('ignore_isbn_err'); -- ad a maint category
else
ISBN = ISBN .. set_error( 'bad_isbn', {err_type}, false, " ", "" ); -- else display an error message
end
elseif is_set(options.IgnoreISBN) then -- ISBN is OK; if |ignore-isbn-error= set
add_maint_cat ('ignore_isbn_err'); -- because |ignore-isbn-error= unnecessary
end
table.insert( new_list, {handler.label, ISBN } );
elseif k == 'ISMN' then
table.insert( new_list, {handler.label, ismn( v ) } );
elseif k == 'ISSN' then
table.insert( new_list, {handler.label, issn( v ) } );
elseif k == 'JFM' then
table.insert( new_list, {handler.label, jfm( v ) } );
elseif k == 'LCCN' then
table.insert( new_list, {handler.label, lccn( v ) } );
elseif k == 'MR' then
table.insert( new_list, {handler.label, mr( v ) } );
elseif k == 'OCLC' then
table.insert( new_list, {handler.label, oclc( v ) } );
elseif k == 'OL' or k == 'OLA' then
table.insert( new_list, {handler.label, openlibrary( v, handler.access ) } );
elseif k == 'PMC' then
table.insert( new_list, {handler.label, pmc( v, options.Embargo ) } );
elseif k == 'PMID' then
table.insert( new_list, {handler.label, pmid( v ) } );
elseif k == 'SSRN' then
table.insert( new_list, {handler.label, ssrn( v ) } );
elseif k == 'USENETID' then
table.insert( new_list, {handler.label, usenet_id( v ) } );
elseif k == 'ZBL' then
table.insert( new_list, {handler.label, zbl( v ) } );
else
error( cfg.messages['unknown_manual_ID'] );
end
end
local function comp( a, b ) -- used in following table.sort()
return a[1]:lower() < b[1]:lower();
end
table.sort( new_list, comp );
for k, v in ipairs( new_list ) do
new_list[k] = v[2];
end
return new_list;
end
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message is more than one alias exists in args
]]
local function extract_ids( args )
local id_list = {}; -- list of identifiers found in args
for k, v in pairs( cfg.id_handlers ) do -- k is uc identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one( args, v.parameters, 'redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set(v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings.
Parameters which have a predefined access level (e.g. arxiv) do not use this
function as they are directly rendered as free without using an additional parameter.
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels( args, id_list )
local id_accesses_list = {};
for k, v in pairs( cfg.id_handlers ) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set(access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
table.insert( z.message_tail, { set_error( 'invalid_param_val', {access_param, access_level}, true ) } );
access_level = nil; -- invalid so unset
end
if not is_set(id_list[k]) then -- identifer access-level must have a matching identifier
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {k:lower()}, true ) } ); -- param name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
is_set = utilities_page_ptr.is_set; -- import functions from select Module:Citation/CS1/Utilities module
in_array = utilities_page_ptr.in_array;
set_error = utilities_page_ptr.set_error;
select_one = utilities_page_ptr.select_one;
add_maint_cat = utilities_page_ptr.add_maint_cat;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
build_id_list = build_id_list,
extract_ids = extract_ids,
extract_id_access_levels = extract_id_access_levels,
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
c8f37fef539a198c6d0c5621de3fd2ef7a455f40
Module:Citation/CS1/Utilities
828
90
178
2021-06-05T23:18:31Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1/Utilities]]
Scribunto
text/plain
local z = {
error_categories = {}; -- for categorizing citations that contain errors
error_ids = {};
message_tail = {};
maintenance_cats = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
properties_cats = {}; -- for categorizing citations based on certain properties, language of source for instance
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array( needle, haystack )
if needle == nil then
return false;
end
for n,v in ipairs( haystack ) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table.
]]
local function substitute( msg, args )
return args and mw.message.newRawMessage( msg, args ):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with css markup according to the state of hidden.
]]
local function error_comment( content, hidden )
return substitute( hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content );
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when bot link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an
empty string.
]=]
local function make_wikilink (link, display)
if is_set (link) then
if is_set (display) then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
else
return '';
end
end
--[[--------------------------< S E T _ E R R O R >--------------------------------------------------------------
Sets an error condition and returns the appropriate error message. The actual placement of the error message in the output is
the responsibility of the calling function.
]]
local function set_error( error_id, arguments, raw, prefix, suffix )
local error_state = cfg.error_conditions[ error_id ];
prefix = prefix or "";
suffix = suffix or "";
if error_state == nil then
error( cfg.messages['undefined_error'] ); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set( error_state.category ) then
table.insert( z.error_categories, error_state.category );
end
local message = substitute( error_state.message, arguments );
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids[ error_id ] = true;
if in_array( error_id, { 'bare_url_missing_title', 'trans_missing_title' } )
and z.error_ids['citation_missing_title'] then
return '', false;
end
message = table.concat({ prefix, message, suffix });
if raw == true then
return message, error_state.hidden;
end
return error_comment( message, error_state.hidden );
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set(args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs(error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert( error_list, alias ); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maintenance_cats using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maintenance_cats.
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maintenance_cats
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert( z.maintenance_cats, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics( str )
if not is_set(str) then
return str;
else
if str:sub(1,1) == "'" then str = "<span></span>" .. str; end
if str:sub(-1,-1) == "'" then str = str .. "<span></span>"; end
-- Remove newlines as they break italics.
return str:gsub( '\n', ' ' );
end
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set( str ) then
return "";
elseif in_array( key, { 'italic-title', 'trans-italic-title' } ) then
str = safe_for_italics( str );
end
return substitute( cfg.presentation[key], {str} );
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one( args, aliases_list, error_condition, index )
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs( aliases_list ) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); --test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
local error_str = "";
for _, k in ipairs( error_list ) do
if error_str ~= "" then error_str = error_str .. cfg.messages['parameter-separator'] end
error_str = error_str .. wrap_style ('parameter', k);
end
if #error_list > 1 then
error_str = error_str .. cfg.messages['parameter-final-separator'];
else
error_str = error_str .. cfg.messages['parameter-pair-separator'];
end
error_str = error_str .. wrap_style ('parameter', selected);
table.insert( z.message_tail, { set_error( error_condition, {error_str}, true ) } );
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims white space from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub( "%[%[([^%[%]]*)%]%]", function(l)
return l:gsub( "^[^|]*|(.*)$", "%1" ):gsub("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing white space and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wililink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
-- L = L and mw.text.trim (L, '%s|');
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ( "'''''", 1, true ) then -- bold italic (5)
argument, flag=argument:gsub("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ( "''''", 1, true ) then -- italic start and end without content (4)
argument, flag=argument:gsub("%'%'%'%'", "");
elseif argument:find ( "'''", 1, true ) then -- bold (3)
argument, flag=argument:gsub("%'%'%'", "");
elseif argument:find ( "''", 1, true ) then -- italic (2)
argument, flag=argument:gsub("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
is_set = is_set, -- exported functions
in_array = in_array,
substitute = substitute,
error_comment = error_comment,
set_error = set_error,
select_one = select_one,
add_maint_cat = add_maint_cat,
wrap_style = wrap_style,
safe_for_italics = safe_for_italics,
remove_wiki_link = remove_wiki_link,
is_wikilink = is_wikilink,
make_wikilink = make_wikilink,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
z = z, -- exported table
}
31543576ae4236d5508aadd4741c7235849f105d
Module:Citation/CS1/Whitelist
828
91
180
2021-06-05T23:18:31Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Citation/CS1/Whitelist]]
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
nil - these parameters are no longer supported. remove entirely
]]
local whitelist = {}
local basic_arguments = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['airdate'] = true,
['air-date'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true,
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-last'] = true,
['authorlink'] = true,
['author-link'] = true,
['authormask'] = true,
['author-mask'] = true,
['authors'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true,
['booktitle'] = true,
['book-title'] = true,
['cartography'] = true,
['chapter'] = true,
['chapter-format'] = true,
['chapterurl'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true,
['collaboration'] = true,
['conference'] = true,
['conference-format'] = true,
['conferenceurl'] = true,
['conference-url'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contributionurl'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-last'] = true,
['contributor-given'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['credits'] = true, -- cite episode, cite serial
['date'] = true,
['degree'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['displayauthors'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['displayeditors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-translators'] = true,
['docket'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken'] = true,
['doi-broken-date'] = true,
['doi-inactive-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editorlink'] = true,
['editor-link'] = true,
['editormask'] = true,
['editor-mask'] = true,
['editors'] = true,
['editor-surname'] = true,
['eissn'] = true,
['EISSN'] = true,
['embargo'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episodelink'] = true, -- cite episode and cite serial
['episode-link'] = true, -- cite episode and cite serial
['eprint'] = true, -- cite arxiv and arxiv identifiers
['event'] = true,
['event-format'] = true,
['eventurl'] = true,
['event-url'] = true,
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true,
['id'] = true,
['ID'] = true,
['ignoreisbnerror'] = true,
['ignore-isbn-error'] = true,
['inset'] = true,
['institution'] = true,
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-last'] = true,
['interviewerlink'] = true,
['interviewer-link'] = true,
['interviewermask'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['isbn13'] = true,
['ISBN13'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lastauthoramp'] = true,
['last-author-amp'] = true,
['laydate'] = true,
['lay-date'] = true,
['laysource'] = true,
['lay-source'] = true,
['lay-format'] = true,
['layurl'] = true,
['lay-url'] = true,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['mailinglist'] = true, -- cite mailing list only
['mailing-list'] = true, -- cite mailing list only
['map'] = true, -- cite map only
['map-format'] = true, -- cite map only
['mapurl'] = true, -- cite map only
['map-url'] = true, -- cite map only
['map-url-access'] = true, -- cite map only
['medium'] = true,
['message-id'] = true, -- cite newsgroup
['minutes'] = true,
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-format'] = true,
['network'] = true,
['newsgroup'] = true,
['newspaper'] = true,
['nocat'] = true,
['no-cat'] = true,
['nopp'] = true,
['no-pp'] = true,
['notracking'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['people'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publicationdate'] = true,
['publication-date'] = true,
['publicationplace'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-map'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['season'] = true,
['section'] = true,
['section-format'] = true,
['sections'] = true, -- cite map only
['sectionurl'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['serieslink'] = true,
['series-link'] = true,
['seriesno'] = true,
['series-no'] = true,
['seriesnumber'] = true,
['series-number'] = true,
['series-separator'] = true,
['sheet'] = true, -- cite map only
['sheets'] = true, -- cite map only
['ssrn'] = true,
['SSRN'] = true,
['station'] = true,
['subject'] = true,
['subjectlink'] = true,
['subject-link'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['time'] = true,
['timecaption'] = true,
['time-caption'] = true,
['title'] = true,
['titlelink'] = true,
['title-link'] = true,
['trans-map'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcripturl'] = true,
['transcript-url'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-last'] = true,
['translator-given'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-link#'] = true,
['author#link'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author-mask#'] = true,
['author#mask'] = true,
['author#-mask'] = true,
['authormask#'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor#-given'] = true,
['editor-given#'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-link#'] = true,
['editor#link'] = true,
['editor#-link'] = true,
['editorlink#'] = true,
['editor-mask#'] = true,
['editor#mask'] = true,
['editor#-mask'] = true,
['editormask#'] = true,
['editor#-surname'] = true,
['editor-surname#'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-link#'] = true,
['subject#link'] = true,
['subject#-link'] = true,
['subjectlink#'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, and cite ssrn are preprint templates that use the limited set of parameters
defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are supplemented with a
template-specific list of parameters that are required by the particular template and may be exclusive to one of the
proeprint templates. Some of these parameters may also be available to the general cs1|2 templates.
Same conventions for true/false/nil as above.
]]
--[[--------------------------< C I T E A R X I V >----------------------------------------------------------
]]
local arxiv_basic_arguments = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true, -- cite arxiv only
['eprint'] = true, -- cite arxiv and arxiv identifiers
}
--[[--------------------------< C I T E B I O R X I V >------------------------------------------------------
]]
local biorxiv_basic_arguments = {
['biorxiv'] = true,
}
--[[--------------------------< C I T E C I T E S E E R X >--------------------------------------------------
]]
local citeseerx_basic_arguments = {
['citeseerx'] = true,
}
--[[--------------------------< C I T E S S R N >------------------------------------------------------------
]]
local ssrn_basic_arguments = {
['ssrn'] = true,
['SSRN'] = true,
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
This is an experiment that attempts to use validate() and a limited list of valid parameters to validate the
parameters provided in a cite arxiv, cite biorxiv, or cite citeseerx templates. These parameters are common to
all three templates
Same conventions for true/false/nil as above.
]]
local limited_basic_arguments = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-last'] = true,
['authorlink'] = true,
['author-link'] = true,
['authormask'] = true,
['author-mask'] = true,
['authors'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['displayauthors'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['lastauthoramp'] = true,
['last-author-amp'] = true,
['mode'] = true,
['name-list-format'] = true,
['nocat'] = true,
['no-cat'] = true,
['notracking'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['url'] = true,
['URL'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-link#'] = true,
['author#link'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author-mask#'] = true,
['author#mask'] = true,
['author#-mask'] = true,
['authormask#'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
basic_arguments = basic_arguments,
numbered_arguments = numbered_arguments,
limited_basic_arguments = limited_basic_arguments,
limited_numbered_arguments = limited_numbered_arguments,
arxiv_basic_arguments = arxiv_basic_arguments,
biorxiv_basic_arguments = biorxiv_basic_arguments,
citeseerx_basic_arguments = citeseerx_basic_arguments,
ssrn_basic_arguments = ssrn_basic_arguments
};
e75739ce91241e1b4dd6525ed4358d0f20edda65
Module:Country extract
828
95
188
2021-06-05T23:18:32Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Country_extract]]
Scribunto
text/plain
local p = {}
--
-- to enable us to replicate the current functioning of CountryAbbr and CountryAbbr2
-- We need to deal with
-- 1 alternative names ISO 3166 should do that
-- 2 {{<name>}}
-- 3 [ [<name>] ]
-- 4 [ [<name>|<junk>] ]
-- 5 [ [image:flag of <country>.[svg|gif|png|jpg]|\d+px] ]
--
function p.extractCountry(frame)
local string= mw.ustring.toNFC (frame.args[1])
local match=nil;
match = mw.ustring.match(string, "Flag of ([^\.]*)")
if (match) then
return match
end
-- () for Cocos (Keeling) Islands
-- ' For People's
-- . for U.S. etc.
match = mw.ustring.match(string, "(%u[%a\(\)\.' -]+)")
if (match == "Image") then
string = mw.ustring.gsub(string, match, "")
match = mw.ustring.match(string, "[\|\[](%u[%a\(\)\.' -]+)")
end
if (match == "20px") then
string = mw.ustring.gsub(string, match, "")
match = mw.ustring.match(string, "\[(%u[%a\(\)\.' -]+)")
end
if (match) then
return match
end
return string
end
--[[
]]
function p.extractSubdivision(frame)
local string= mw.ustring.toNFC (frame.args[1])
local match=nil;
-- Needed for {{flag|Greenland}},
match = mw.ustring.match(string, "Flag of ([^\.]*)")
if (match) then
return match
end
-- . needed for Washington D.C.
-- ' for cote d'azur
-- leading ' for 'Aden
-- ‘ and trailing ' for Şan‘ā'
match = mw.ustring.match(string, "('?[%u][%a'‘ \.\,-]+[%a\.'\d]+)")
if (match) then
return match
end
return string
end
local countries = {
["Andorra"] = "AD",
["United Arab Emirates"] = "AE",
["UAE"] = "AE",
["Afghanistan"] = "AF",
["Antigua and Barbuda"] = "AG",
["Anguilla"] = "AI",
["Albania"] = "AL",
["Armenia"] = "AM",
["Angola"] = "AO",
["Antarctica"] = "AQ",
["Argentina"] = "AR",
["American Samoa"] = "AS",
["Austria"] = "AT",
["Australia"] = "AU",
["Aruba"] = "AW",
["Åland Islands"] = "AX",
["Aland Islands"] = "AX",
["Azerbaijan"] = "AZ",
["Nagorno-Karabakh"] = "AZ", -- disputed
["Nagorno-Karabakh Republic"] = "AZ", -- disputed
["Bosnia and Herzegovina"] = "BA",
["Bosnia"] = "BA",
["Barbados"] = "BB",
["Bangladesh"] = "BD",
["Belgium"] = "BE",
["Burkina Faso"] = "BF",
["Bulgaria"] = "BG",
["Bahrain"] = "BH",
["Burundi"] = "BI",
["Benin"] = "BJ",
["Saint Barthélemy"] = "BL",
["Saint Barthelemy"] = "BL",
["St. Barthélemy"] = "BL",
["St. Barthelemy"] = "BL",
["St Barthélemy"] = "BL",
["St Barthelemy"] = "BL",
["Bermuda"] = "BM",
["Brunei"] = "BN",
["Brunei Darussalam"] = "BN",
["Bolivia"] = "BO",
["Bolivia, Plurinational State of"] = "BO",
["Bonaire, Sint Eustatius and Saba"] = "BQ",
["Brazil"] = "BR",
["Bahamas"] = "BS",
["The Bahamas"] = "BS",
["the Bahamas"] = "BS",
["Bhutan"] = "BT",
["Bouvet Island"] = "BV",
["Botswana"] = "BW",
["Belarus"] = "BY",
["Belize"] = "BZ",
["Canada"] = "CA",
["Cocos (Keeling) Islands"] = "CC",
["Cocos Islands"] = "CC",
["Keeling Islands"] = "CC",
["Congo, the Democratic Republic of the"] = "CD",
["Democratic Republic of the Congo"] = "CD",
["DR Congo"] = "CD",
["Congo-Kinshasa"] = "CD",
["DROC"] = "CD",
["DRC"] = "CD",
["Central African Republic"] = "CF",
["CAR"] = "CF",
["Congo"] = "CG",
["Republic of the Congo"] = "CG",
["Congo Republic"] = "CG",
["Congo-Brazzaville"] = "CG",
["West Congo"] = "CG",
["Switzerland"] = "CH",
["Côte d'Ivoire"] = "CI",
["Ivory Coast"] = "CI",
["Cook Islands"] = "CK",
["Chile"] = "CL",
["Cameroon"] = "CM",
["China"] = "CN",
["PRC"] = "CN",
["People's Republic of China"] = "CN",
["Colombia"] = "CO",
["Costa Rica"] = "CR",
["Cuba"] = "CU",
["Cape Verde"] = "CV",
["Curaçao"] = "CW",
["Curacao"] = "CW",
["Christmas Island"] = "CX",
["Cyprus"] = "CY",
["Republic of Cyprus"] = "CY",
["Northern Cyprus"] = "CY", -- disputed
["Turkish Republic of Northern Cyprus"] = "CY", -- disputed
["Czech Republic"] = "CZ",
["Germany"] = "DE",
["Djibouti"] = "DJ",
["Denmark"] = "DK",
["Dominica"] = "DM",
["Dominican Republic"] = "DO",
["Algeria"] = "DZ",
["Ecuador"] = "EC",
["Estonia"] = "EE",
["Egypt"] = "EG",
["Western Sahara"] = "EH",
["Eritrea"] = "ER",
["Spain"] = "ES",
["Ethiopia"] = "ET",
["Finland"] = "FI",
["Fiji"] = "FJ",
["Falkland Islands (Malvinas)"] = "FK",
["Falklands"] = "FK",
["Falkland Islands"] = "FK",
["Malvinas"] = "FK",
["Malvinas Islands"] = "FK",
["Micronesia, Federated States of"] = "FM",
["Micronesia"] = "FM",
["Faroe Islands"] = "FO",
["France"] = "FR",
["Gabon"] = "GA",
["United Kingdom"] = "GB",
["the United Kingdom"] = "GB",
["U. K."] = "GB",
["U.K."] = "GB",
["the U.K."] = "GB",
["UK"] = "GB",
["the UK"] = "GB",
["Great Britain"] = "GB",
["England"] = "GB-ENG",
["Scotland"] = "GB-SCT",
["Wales"] = "GB-WLS",
["Northern Ireland"] = "GB-NIR",
["England and Wales"] = "GB-EAW",
["Grenada"] = "GD",
["Georgia"] = "GE",
["South Ossetia"] = "GE", -- disputed
["Tskhinvali Region"] = "GE", -- disputed
["Abkhazia"] = "GE-AB", -- disputed
["Republic of Abkhazia"] = "GE-AB", -- disputed
["French Guiana"] = "GF",
["Guernsey"] = "GG",
["Ghana"] = "GH",
["Gibraltar"] = "GI",
["Greenland"] = "GL",
["Gambia"] = "GM",
["Guinea"] = "GN",
["Guadeloupe"] = "GP",
["Equatorial Guinea"] = "GQ",
["Greece"] = "GR",
["South Georgia and the South Sandwich Islands"] = "GS",
["Guatemala"] = "GT",
["Guam"] = "GU",
["Guinea-Bissau"] = "GW",
["Guyana"] = "GY",
["Hong Kong"] = "HK",
["Heard Island and McDonald Islands"] = "HM",
["Heard and McDonald Islands"] = "HM",
["Honduras"] = "HN",
["Croatia"] = "HR",
["Haiti"] = "HT",
["Hungary"] = "HU",
["Indonesia"] = "ID",
["Ireland"] = "IE",
["Israel"] = "IL",
["Isle of Man"] = "IM",
["India"] = "IN",
["British Indian Ocean Territory"] = "IO",
["Iraq"] = "IQ",
["Iran, Islamic Republic of"] = "IR",
["Iran"] = "IR",
["Iceland"] = "IS",
["Italy"] = "IT",
["Jersey"] = "JE",
["Jamaica"] = "JM",
["Jordan"] = "JO",
["Japan"] = "JP",
["Kenya"] = "KE",
["Kyrgyzstan"] = "KG",
["Cambodia"] = "KH",
["Kiribati"] = "KI",
["Comoros"] = "KM",
["The Comoros"] = "KM",
["the Comoros"] = "KM",
["Saint Kitts and Nevis"] = "KN",
["St. Kitts and Nevis"] = "KN",
["St Kitts and Nevis"] = "KN",
["Korea, Democratic People's Republic of"] = "KP",
["Democratic People's Republic of Korea"] = "KP",
["North Korea"] = "KP",
["Korea, Republic of"] = "KR",
["Republic of Korea"] = "KR",
["South Korea"] = "KR",
["Kuwait"] = "KW",
["Cayman Islands"] = "KY",
["The Cayman Islands"] = "KY",
["the Cayman Islands"] = "KY",
["Kazakhstan"] = "KZ",
["Lao People's Democratic Republic"] = "LA",
["Laos"] = "LA",
["Lao"] = "LA",
["Lebanon"] = "LB",
["Saint Lucia"] = "LC",
["St. Lucia"] = "LC",
["St Lucia"] = "LC",
["Liechtenstein"] = "LI",
["Sri Lanka"] = "LK",
["Liberia"] = "LR",
["Lesotho"] = "LS",
["Lithuania"] = "LT",
["Luxembourg"] = "LU",
["Latvia"] = "LV",
["Libyan Arab Jamahiriya"] = "LY",
["Libya"] = "LY",
["Morocco"] = "MA",
["Monaco"] = "MC",
["Moldova, Republic of"] = "MD",
["Moldova"] = "MD",
["Transnistria"] = "MD", -- disputed
["Montenegro"] = "ME",
["Saint Martin (French part)"] = "MF",
["Saint Martin (France)"] = "MF",
["Collectivity of Saint Martin"] = "MF",
["Collectivity of St. Martin"] = "MF",
["Collectivity of St Martin"] = "MF",
["Saint-Martin"] = "MF",
["Madagascar"] = "MG",
["Marshall Islands"] = "MH",
["Macedonia"] = "MK",
["Mali"] = "ML",
["Myanmar"] = "MM",
["Burma"] = "MM",
["Mongolia"] = "MN",
["Macau"] = "MO",
["Macao"] = "MO",
["Northern Mariana Islands"] = "MP",
["Martinique"] = "MQ",
["Mauritania"] = "MR",
["Montserrat"] = "MS",
["Malta"] = "MT",
["Mauritius"] = "MU",
["Maldives"] = "MV",
["Malawi"] = "MW",
["Mexico"] = "MX",
["Malaysia"] = "MY",
["Mozambique"] = "MZ",
["Namibia"] = "NA",
["New Caledonia"] = "NC",
["Niger"] = "NE",
["Norfolk Island"] = "NF",
["Nigeria"] = "NG",
["Nicaragua"] = "NI",
["Netherlands"] = "NL",
["The Netherlands"] = "NL",
["the Netherlands"] = "NL",
["Norway"] = "NO",
["Nepal"] = "NP",
["Nauru"] = "NR",
["Niue"] = "NU",
["New Zealand"] = "NZ",
["Aotearoa"] = "NZ",
["Oman"] = "OM",
["Panama"] = "PA",
["Peru"] = "PE",
["French Polynesia"] = "PF",
["Papua New Guinea"] = "PG",
["Philippines"] = "PH",
["The Philippines"] = "PH",
["the Philippines"] = "PH",
["Pakistan"] = "PK",
["Poland"] = "PL",
["Saint Pierre and Miquelon"] = "PM",
["St. Pierre and Miquelon"] = "PM",
["St Pierre and Miquelon"] = "PM",
["Pitcairn"] = "PN",
["Puerto Rico"] = "PR",
["State of Palestine"] = "PS",
["Palestine"] = "PS",
["Portugal"] = "PT",
["Palau"] = "PW",
["Paraguay"] = "PY",
["Qatar"] = "QA",
["Réunion"] = "RE",
["Reunion"] = "RE",
["Romania"] = "RO",
["Serbia"] = "RS",
["Kosovo"] = "RS", -- disputed
["Russian Federation"] = "RU",
["Russia"] = "RU",
["Rwanda"] = "RW",
["Saudi Arabia"] = "SA",
["Solomon Islands"] = "SB",
["Seychelles"] = "SC",
["Sudan"] = "SD",
["Sweden"] = "SE",
["Singapore"] = "SG",
["Saint Helena, Ascension and Tristan da Cunha"] = "SH",
["Slovenia"] = "SI",
["Svalbard and Jan Mayen"] = "SJ",
["Slovakia"] = "SK",
["Sierra Leone"] = "SL",
["San Marino"] = "SM",
["Senegal"] = "SN",
["Somalia"] = "SO",
["Somaliland"] = "SO", -- disputed
["Suriname"] = "SR",
["South Sudan"] = "SS",
["São Tomé and Príncipe"] = "ST",
["Sao Tome and Principe"] = "ST",
["El Salvador"] = "SV",
["Sint Maarten"] = "SX",
["Saint Martin (Dutch part)"] = "SX",
["Saint Martin (Netherlands)"] = "SX",
["Syrian Arab Republic"] = "SY",
["Syria"] = "SY",
["Swaziland"] = "SZ",
["Turks and Caicos Islands"] = "TC",
["Chad"] = "TD",
["French Southern Territories"] = "TF",
["Togo"] = "TG",
["Thailand"] = "TH",
["Tajikistan"] = "TJ",
["Tokelau"] = "TK",
["Timor-Leste"] = "TL",
["East Timor"] = "TL",
["Turkmenistan"] = "TM",
["Tunisia"] = "TN",
["Tonga"] = "TO",
["Turkey"] = "TR",
["Trinidad and Tobago"] = "TT",
["Tuvalu"] = "TV",
["Taiwan"] = "TW",
["Republic of China"] = "TW",
["Tanzania, United Republic of"] = "TZ",
["Tanzania"] = "TZ",
["Ukraine"] = "UA",
["The Ukraine"] = "UA",
["the Ukraine"] = "UA",
["Uganda"] = "UG",
["United States Minor Outlying Islands"] = "UM",
["United States"] = "US",
["the United States"] = "US",
["United States of America"] = "US",
["the United States of America"] = "US",
["U. S."] = "US",
["U.S."] = "US",
["the U.S."] = "US",
["US"] = "US",
["the US"] = "US",
["Uruguay"] = "UY",
["Uzbekistan"] = "UZ",
["Holy See (Vatican City State)"] = "VA",
["Holy See"] = "VA",
["Vatican City State"] = "VA",
["Vatican City"] = "VA",
["Saint Vincent and the Grenadines"] = "VC",
["St. Vincent and the Grenadines"] = "VC",
["St Vincent and the Grenadines"] = "VC",
["Venezuela, Bolivarian Republic of"] = "VE",
["Venezuela"] = "VE",
["Virgin Islands, British"] = "VG",
["British Virgin Islands"] = "VG",
["UK Virgin Islands"] = "VG",
["Virgin Islands of the United Kingdom"] = "VG",
["Virgin Islands of the UK"] = "VG",
["Virgin Islands, U. S."] = "VI",
["Virgin Islands, U.S."] = "VI",
["Virgin Islands, US"] = "VI",
["United States Virgin Islands"] = "VI",
["American Virgin Islands"] = "VI",
["U. S. Virgin Islands"] = "VI",
["U.S. Virgin Islands"] = "VI",
["US Virgin Islands"] = "VI",
["Virgin Islands of the United States"] = "VI",
["Virgin Islands of the U.S."] = "VI",
["Virgin Islands of the US"] = "VI",
["Vietnam"] = "VN",
["Viet Nam"] = "VN",
["Vanuatu"] = "VU",
["Wallis and Futuna"] = "WF",
["Samoa"] = "WS",
["Yemen"] = "YE",
["Mayotte"] = "YT",
["South Africa"] = "ZA",
["Zambia"] = "ZM",
["Zimbabwe"] = "ZW",
["ABW"] = "AW",
["AFG"] = "AF",
["AGO"] = "AO",
["AIA"] = "AI",
["ALA"] = "AX",
["ALB"] = "AL",
["AND"] = "AD",
["ARE"] = "AE",
["ARG"] = "AR",
["ARM"] = "AM",
["ASM"] = "AS",
["ATA"] = "AQ",
["ATF"] = "TF",
["ATG"] = "AG",
["AUS"] = "AU",
["AUT"] = "AT",
["AZE"] = "AZ",
["BDI"] = "BI",
["BEL"] = "BE",
["BEN"] = "BJ",
["BFA"] = "BF",
["BGD"] = "BD",
["BGR"] = "BG",
["BHR"] = "BH",
["BHS"] = "BS",
["BIH"] = "BA",
["BLM"] = "BL",
["BLR"] = "BY",
["BLZ"] = "BZ",
["BMU"] = "BM",
["BOL"] = "BO",
["BRA"] = "BR",
["BRB"] = "BB",
["BRN"] = "BN",
["BTN"] = "BT",
["BVT"] = "BV",
["BWA"] = "BW",
["CAF"] = "CF",
["CAN"] = "CA",
["CCK"] = "CC",
["CHE"] = "CH",
["CHL"] = "CL",
["CHN"] = "CN",
["CIV"] = "CI",
["CMR"] = "CM",
["COD"] = "CG",
["COG"] = "CG",
["COK"] = "CK",
["COL"] = "CO",
["COM"] = "KM",
["CRI"] = "CR",
["CUB"] = "CU",
["CUW"] = "CW",
["CXR"] = "CX",
["CYM"] = "KY",
["CYP"] = "CY",
["CZE"] = "CZ",
["DEU"] = "DE",
["DJI"] = "DJ",
["DMA"] = "DM",
["DNK"] = "DK",
["DOM"] = "DO",
["DZA"] = "DZ",
["ECU"] = "EC",
["EGY"] = "EG",
["ERI"] = "ER",
["ESH"] = "EH",
["ESP"] = "ES",
["EST"] = "EE",
["ETH"] = "ET",
["FIN"] = "FI",
["FJI"] = "FJ",
["FLK"] = "FK",
["FRA"] = "FR",
["FRO"] = "FO",
["FSM"] = "FM",
["GAB"] = "GA",
["GBR"] = "GB",
["GEO"] = "GE",
["GGY"] = "GG",
["GHA"] = "GH",
["GIB"] = "GI",
["GIN"] = "GN",
["GLP"] = "GP",
["GMB"] = "GM",
["GNB"] = "GW",
["GNQ"] = "GQ",
["GRC"] = "GR",
["GRD"] = "GD",
["GRL"] = "GL",
["GTM"] = "GT",
["GUF"] = "GF",
["GUM"] = "GU",
["GUY"] = "GY",
["HKG"] = "HK",
["HMD"] = "HM",
["HND"] = "HN",
["HRV"] = "HR",
["HTI"] = "HT",
["HUN"] = "HU",
["IDN"] = "ID",
["IMN"] = "IM",
["IND"] = "IN",
["IOT"] = "IO",
["IRL"] = "IE",
["IRN"] = "IR",
["IRQ"] = "IQ",
["ISL"] = "IS",
["ISR"] = "IL",
["ITA"] = "IT",
["JAM"] = "JM",
["JEY"] = "JE",
["JOR"] = "JO",
["JPN"] = "JP",
["KAZ"] = "KZ",
["KEN"] = "KE",
["KGZ"] = "KG",
["KHM"] = "KH",
["KIR"] = "KI",
["KNA"] = "KN",
["KWT"] = "KW",
["LAO"] = "LA",
["LBN"] = "LB",
["LBR"] = "LR",
["LBY"] = "LY",
["LCA"] = "LC",
["LIE"] = "LI",
["LKA"] = "LK",
["LSO"] = "LS",
["LTU"] = "LT",
["LUX"] = "LU",
["LVA"] = "LV",
["MAC"] = "MO",
["MAF"] = "MF",
["MAR"] = "MA",
["MCO"] = "MC",
["MDA"] = "MD",
["MDG"] = "MG",
["MDV"] = "MV",
["MEX"] = "MX",
["MHL"] = "MH",
["MKD"] = "MK",
["MLI"] = "ML",
["MLT"] = "MT",
["MMR"] = "MM",
["MNE"] = "ME",
["MNG"] = "MN",
["MNP"] = "MP",
["MOZ"] = "MZ",
["MRT"] = "MR",
["MSR"] = "MS",
["MTQ"] = "MQ",
["MUS"] = "MU",
["MWI"] = "MW",
["MYS"] = "MY",
["MYT"] = "YT",
["NAM"] = "NA",
["NCL"] = "NC",
["NER"] = "NE",
["NFK"] = "NF",
["NGA"] = "NG",
["NIC"] = "NI",
["NIU"] = "NU",
["NLD"] = "NL",
["NOR"] = "NO",
["NPL"] = "NP",
["NRU"] = "NR",
["NZL"] = "NZ",
["OMN"] = "OM",
["PAK"] = "PK",
["PAN"] = "PA",
["PCN"] = "PN",
["PER"] = "PE",
["PHL"] = "PH",
["PLW"] = "PW",
["PNG"] = "PG",
["POL"] = "PL",
["PRI"] = "PR",
["PRT"] = "PT",
["PRY"] = "PY",
["PSE"] = "PS",
["PYF"] = "PF",
["QAT"] = "QA",
["REU"] = "RE",
["ROU"] = "RO",
["RUS"] = "RU",
["RWA"] = "RW",
["SAU"] = "SA",
["SDN"] = "SD",
["SEN"] = "SN",
["SGP"] = "SG",
["SGS"] = "GS",
["SJM"] = "SJ",
["SLB"] = "SB",
["SLE"] = "SL",
["SLV"] = "SV",
["SMR"] = "SM",
["SOM"] = "SO",
["SPM"] = "PM",
["SRB"] = "RS",
["SSD"] = "SS",
["STP"] = "ST",
["SUR"] = "SR",
["SVK"] = "SK",
["SVN"] = "SI",
["SWE"] = "SE",
["SWZ"] = "SZ",
["SXM"] = "SX",
["SYC"] = "SC",
["SYR"] = "SY",
["TCA"] = "TC",
["TCD"] = "TD",
["TGO"] = "TG",
["THA"] = "TH",
["TJK"] = "TJ",
["TKL"] = "TK",
["TKM"] = "TM",
["TLS"] = "TL",
["TON"] = "TO",
["TTO"] = "TT",
["TUN"] = "TN",
["TUR"] = "TR",
["TUV"] = "TV",
["TWN"] = "TW",
["TZA"] = "TZ",
["UGA"] = "UG",
["UKR"] = "UA",
["UMI"] = "UM",
["URY"] = "UY",
["USA"] = "US",
["UZB"] = "UZ",
["VAT"] = "VA",
["VCT"] = "VC",
["VEN"] = "VE",
["VNM"] = "VN",
["VUT"] = "VU",
["WLF"] = "WF",
["WSM"] = "WS",
["YEM"] = "YE",
["ZAF"] = "ZA",
["ZMB"] = "ZM",
["ZWE"] = "ZW"
}
function p.main(frame)
local country = mw.ustring.gsub(mw.ustring.toNFC(frame.args[1] or ''), '^%s*(.-)%s*$', '%1')
local match1 = ''
if country and country ~= '' then
match1 = mw.ustring.match(country, "Flag of the ([^\.]*)") or mw.ustring.match(country, "Flag of ([^\.]*)") or mw.ustring.match(country, "^[Tt]he %A*(%u[%a%(%)%.' %-]+)") or mw.ustring.match(country, "(%u[%a%(%)%.' %-]+)") or ""
if (match1 == "Image") or (match1 == "File") then
country = mw.ustring.gsub(country, match1, "")
match1 = mw.ustring.match(country, "[%|%[](%u[%a%(%)%.' %-]+)") or ""
end
if mw.ustring.match(match1, "^%d*x?%d+px$") then
country = mw.ustring.gsub(country, match1, "")
match1 = mw.ustring.match(country, "%[(%u[%a%(%)%.' %-]+)") or ""
end
end
local code = countries[match1] or countries[mw.ustring.gsub(match1, " %(.*%)$", "")] or countries[mw.ustring.gsub(match1, ",.*$", "")] or countries[mw.ustring.gsub(match1, " %(.*$", "")]
if not code then
if match1 ~= '' and mw.title.new('Template:ISO 3166 code ' .. match1).exists then
code = frame:expandTemplate{ title = 'Template:ISO 3166 code ' .. match1 }
else
if frame.args.nocat and frame.args.nocat == 'true' then
return ''
end
local ns = mw.title.getCurrentTitle().namespace
if ns == 0 then
return '[[Category:Wikipedia page with obscure country]]'
else
return '[[Category:Wikipedia page with obscure country|'.. frame:expandTemplate{ title = 'Namespace Greek' } ..']]'
end
end
end
local subdivision = mw.ustring.gsub(mw.ustring.toNFC(frame.args[2] or ''), '^%s*(.-)%s*$', '%1')
if not subdivision or subdivision == '' then return code end
local countrytables = {
["AD"] = true,
["AE"] = true,
["AF"] = true,
["AG"] = true,
["AL"] = true,
["AM"] = true,
["AO"] = true,
["AR"] = true,
["AT"] = true,
["AU"] = true,
["AZ"] = true,
["BA"] = true,
["BB"] = true,
["BD"] = true,
["BE"] = true,
["BF"] = true,
["BG"] = true,
["BH"] = true,
["BI"] = true,
["BJ"] = true,
["BN"] = true,
["BO"] = true,
["BQ"] = true,
["BR"] = true,
["BS"] = true,
["BT"] = true,
["BW"] = true,
["BY"] = true,
["BZ"] = true,
["CA"] = true,
["CD"] = true,
["CF"] = true,
["CG"] = true,
["CH"] = true,
["CI"] = true,
["CL"] = true,
["CM"] = true,
["CN"] = true,
["CO"] = true,
["CR"] = true,
["CU"] = true,
["CV"] = true,
["CY"] = true,
["CZ"] = true,
["DE"] = true,
["DJ"] = true,
["DK"] = true,
["DM"] = true,
["DO"] = true,
["DZ"] = true,
["EC"] = true,
["EE"] = true,
["EG"] = true,
["ER"] = true,
["ES"] = true,
["ET"] = true,
["FI"] = true,
["FJ"] = true,
["FM"] = true,
["FR"] = true,
["GA"] = true,
["GB"] = true,
["GD"] = true,
["GE"] = true,
["GH"] = true,
["GL"] = true,
["GM"] = true,
["GN"] = true,
["GQ"] = true,
["GR"] = true,
["GT"] = true,
["GW"] = true,
["GY"] = true,
["HN"] = true,
["HR"] = true,
["HT"] = true,
["HU"] = true,
["ID"] = true,
["IE"] = true,
["IL"] = true,
["IN"] = true,
["IQ"] = true,
["IR"] = true,
["IS"] = true,
["IT"] = true,
["JM"] = true,
["JO"] = true,
["JP"] = true,
["KE"] = true,
["KG"] = true,
["KH"] = true,
["KI"] = true,
["KM"] = true,
["KN"] = true,
["KP"] = true,
["KR"] = true,
["KW"] = true,
["KZ"] = true,
["LA"] = true,
["LB"] = true,
["LC"] = true,
["LI"] = true,
["LK"] = true,
["LR"] = true,
["LS"] = true,
["LT"] = true,
["LU"] = true,
["LV"] = true,
["LY"] = true,
["MA"] = true,
["MC"] = true,
["MD"] = true,
["ME"] = true,
["MG"] = true,
["MH"] = true,
["MK"] = true,
["ML"] = true,
["MM"] = true,
["MN"] = true,
["MR"] = true,
["MT"] = true,
["MU"] = true,
["MV"] = true,
["MW"] = true,
["MX"] = true,
["MY"] = true,
["MZ"] = true,
["NA"] = true,
["NE"] = true,
["NG"] = true,
["NI"] = true,
["NL"] = true,
["NO"] = true,
["NP"] = true,
["NR"] = true,
["NZ"] = true,
["OM"] = true,
["PA"] = true,
["PE"] = true,
["PG"] = true,
["PH"] = true,
["PK"] = true,
["PL"] = true,
["PS"] = true,
["PT"] = true,
["PW"] = true,
["PY"] = true,
["QA"] = true,
["RO"] = true,
["RS"] = true,
["RU"] = true,
["RW"] = true,
["SA"] = true,
["SB"] = true,
["SC"] = true,
["SD"] = true,
["SE"] = true,
["SG"] = true,
["SH"] = true,
["SI"] = true,
["SK"] = true,
["SL"] = true,
["SM"] = true,
["SN"] = true,
["SO"] = true,
["SR"] = true,
["SS"] = true,
["ST"] = true,
["SV"] = true,
["SY"] = true,
["SZ"] = true,
["TD"] = true,
["TG"] = true,
["TH"] = true,
["TJ"] = true,
["TL"] = true,
["TM"] = true,
["TN"] = true,
["TO"] = true,
["TR"] = true,
["TT"] = true,
["TV"] = true,
["TW"] = true,
["TZ"] = true,
["UA"] = true,
["UG"] = true,
["UM"] = true,
["US"] = true,
["UY"] = true,
["UZ"] = true,
["VC"] = true,
["VE"] = true,
["VN"] = true,
["VU"] = true,
["WF"] = true,
["WS"] = true,
["YE"] = true,
["ZA"] = true,
["ZM"] = true,
["ZW"] = true,
}
local match2 = mw.ustring.match(subdivision, "Flag of the ([^\.]*)") or mw.ustring.match(subdivision, "Flag of ([^\.]*)") or mw.ustring.match(subdivision, "[Tt]he %A*([ǁ'‘ʻ]?%u[%aZ̧z̄'‘‘ %.%,%-]+[%a%.'%d]+)") or mw.ustring.match(subdivision, "([ǁ'‘ʻ]?%u[%aZ̧z̄'‘‘ %.%,%-]+[%a%.'%d]+)") or ""
if (match2 == "Image") or (match2 == "File") then
subdivision = mw.ustring.gsub(subdivision, match2, "")
match2 = mw.ustring.match(subdivision, "[\|\[]([ǁ'‘ʻ]?%u[%aZ̧z̄'‘ʻ %.%,%-]+[%a%.'%d]+)") or ""
end
if mw.ustring.match(match2, "^%d*x?%d+px$") then
subdivision = mw.ustring.gsub(subdivision, match2, "")
match2 = mw.ustring.match2(subdivision, "%[([ǁ'‘ʻ]?%u[%aZ̧z̄'‘ʻ %.%,%-]+[%a%.'%d]+)") or ""
end
local code1 = mw.ustring.sub(code, 1, 2)
if countrytables[code1] then
local tmp = mw.loadData('Module:Country extract/' .. code1)
local code2 = tmp[match2] or tmp[mw.ustring.gsub(match2, " %(.*%)$", "")] or tmp[mw.ustring.gsub(match2, ",.*$", "")] or tmp[mw.ustring.gsub(match2, " %(.*$", "")]
if code2 then return code2 end
local legacytemplate = 'Template:ISO 3166 code ' .. match1
if mw.title.new(legacytemplate).exists then
tmp = nil
for k, v in ipairs({
frame:expandTemplate{ title = legacytemplate, args = { mw.ustring.gsub(match2, " %(.*%)$", "") } },
frame:expandTemplate{ title = legacytemplate, args = { mw.ustring.gsub(match2, ",.*$", "") } },
frame:expandTemplate{ title = legacytemplate, args = { mw.ustring.gsub(match2, " %(.*$", "") } },
frame:expandTemplate{ title = legacytemplate, args = { match2 } }
}) do
if v ~= code and v ~= '' then
tmp = v
break
end
end
if tmp then return tmp end
end
if frame.args.nocat and frame.args.nocat == 'true' then
return code
end
local ns = mw.title.getCurrentTitle().namespace
if ns == 0 then
return code .. '[[Category:Wikipedia page with obscure country or subdivision]]'
else
return code .. '[[Category:Wikipedia page with obscure country or subdivision|'.. frame:expandTemplate{ title = 'Namespace Greek' } ..']]'
end
end
return code
end
return p
dd859aadb5c4b0f9522d484b864286fb57fa088d
Module:Country extract/US
828
96
190
2021-06-05T23:18:33Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Country_extract/US]]
Scribunto
text/plain
return {
["Alaska"] = "US-AK",
["Alabama"] = "US-AL",
["Arkansas"] = "US-AR",
["American Samoa"] = "US-AS",
["Arizona"] = "US-AZ",
["California"] = "US-CA",
["Colorado"] = "US-CO",
["Connecticut"] = "US-CT",
["District of Columbia"] = "US-DC",
["Washington D.C."] = "US-DC",
["Washington DC"] = "US-DC",
["Washington, D.C."] = "US-DC",
["Washington, DC"] = "US-DC",
["Delaware"] = "US-DE",
["Florida"] = "US-FL",
["Georgia (state)"] = "US-GA",
["Georgia"] = "US-GA",
["Georgia (U.S. state)"] = "US-GA",
["Guam"] = "US-GU",
["Hawaii"] = "US-HI",
["Iowa"] = "US-IA",
["Idaho"] = "US-ID",
["Illinois"] = "US-IL",
["Indiana"] = "US-IN",
["Kansas"] = "US-KS",
["Kentucky"] = "US-KY",
["Louisiana"] = "US-LA",
["Massachusetts"] = "US-MA",
["Maryland"] = "US-MD",
["Maine"] = "US-ME",
["Michigan"] = "US-MI",
["Minnesota"] = "US-MN",
["Missouri"] = "US-MO",
["Northern Mariana Islands"] = "US-MP",
["Mississippi"] = "US-MS",
["Montana"] = "US-MT",
["North Carolina"] = "US-NC",
["North Dakota"] = "US-ND",
["Nebraska"] = "US-NE",
["New Hampshire"] = "US-NH",
["New Jersey"] = "US-NJ",
["New Mexico"] = "US-NM",
["Nevada"] = "US-NV",
["New York (state)"] = "US-NY",
["New York"] = "US-NY",
["New York state"] = "US-NY",
["Ohio"] = "US-OH",
["Oklahoma"] = "US-OK",
["Oregon"] = "US-OR",
["Pennsylvania"] = "US-PA",
["Puerto Rico"] = "US-PR",
["Rhode Island"] = "US-RI",
["South Carolina"] = "US-SC",
["South Dakota"] = "US-SD",
["Tennessee"] = "US-TN",
["Texas"] = "US-TX",
["United States Minor Outlying Islands"] = "US-UM",
["Minor Outlying Islands"] = "US-UM",
["Utah"] = "US-UT",
["Virginia"] = "US-VA",
["Virgin Islands, U.S."] = "US-VI",
["Virgin Islands"] = "US-VI",
["Virgin Islands, U. S."] = "US-VI",
["Virgin Islands, US"] = "US-VI",
["United States Virgin Islands"] = "US-VI",
["American Virgin Islands"] = "US-VI",
["U. S. Virgin Islands"] = "US-VI",
["U.S. Virgin Islands"] = "US-VI",
["US Virgin Islands"] = "US-VI",
["Virgin Islands of the United States"] = "US-VI",
["Virgin Islands of the U.S."] = "US-VI",
["Virgin Islands of the US"] = "US-VI",
["Vermont"] = "US-VT",
["Washington (state)"] = "US-WA",
["Washington"] = "US-WA",
["Washington state"] = "US-WA",
["Wisconsin"] = "US-WI",
["West Virginia"] = "US-WV",
["Wyoming"] = "US-WY",
["Johnston Atoll"] = "UM-67",
["Midway Islands"] = "UM-71",
["Midway Atoll"] = "UM-71",
["Navassa Island"] = "UM-76",
["Wake Island"] = "UM-79",
["Baker Island"] = "UM-81",
["Howland Island"] = "UM-84",
["Jarvis Island"] = "UM-86",
["Kingman Reef"] = "UM-89",
["Palmyra Atoll"] = "UM-95",
}
c6b25f04b724aec4d03f3d476a47accb02d09933
Module:If empty
828
12
22
2021-06-05T23:18:34Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:If_empty]]
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
-- For backwards compatibility reasons, the first 8 parameters can be unset instead of being blank,
-- even though there's really no legitimate use case for this. At some point, this will be removed.
local lowestNil = math.huge
for i = 8,1,-1 do
if args[i] == nil then
args[i] = ''
lowestNil = i
end
end
for k,v in ipairs(args) do
if v ~= '' then
if lowestNil < k then
-- If any uses of this template depend on the behavior above, add them to a tracking category.
-- This is a rather fragile, convoluted, hacky way to do it, but it ensures that this module's output won't be modified
-- by it.
frame:extensionTag('ref', '[[Category:Instances of Template:If_empty missing arguments]]', {group = 'TrackingCategory'})
frame:extensionTag('references', '', {group = 'TrackingCategory'})
end
return v
end
end
end
return p
39b83f8d043283ec767774d927e2f6f3fb3078b4
Module:Location map/data/USA
828
100
198
2021-06-05T23:18:38Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Location_map/data/USA]]
Scribunto
text/plain
return {
name = 'the US',
x = '50.0 + 124.03149777329222 * ((1.9694462586094064-($1 * pi / 180)) * sin(0.6010514667026994 * ($2 + 96) * pi / 180))',
y = '50.0 + 1.6155950752393982 * 124.03149777329222 * ( 0.02613325650382181 - (1.3236744353715044 - (1.9694462586094064 - ($1 * pi / 180)) * cos(0.6010514667026994 * ($2 + 96) * pi / 180)))',
image = 'Usa edcp location map.svg',
image1 = 'Usa edcp relief location map.png'
}
f9ff12b9b0328d94d87db1816bb8bed69e3fd752
Module:Plain text
828
16
30
2021-06-05T23:18:40Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Plain_text]]
Scribunto
text/plain
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
local p = {}
function p.main(frame)
local text = frame.args[1]
return p._main(text)
end
function p._main(text)
if not text then return end
text = mw.text.killMarkers(text)
:gsub('<span class="nowrap">(.+)</span>', '%1') --remove nowrap while keeping text inside
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<.->.-<.->', '') --strip out tags
:gsub('%[%[%s*[Ff]ile%s*:.-%]%]', '') --strip out files
:gsub('%[%[%s*[Ii]mage%s*:.-%]%]', '') --strip out use of image:
:gsub('%[%[%s*[Cc]ategory%s*:.-%]%]', '') --strip out categories
:gsub('%[%[[^%]]-|', '') --strip out piped link text
:gsub('[%[%]]', '') --then strip out remaining [ and ]
:gsub("'''''", "") --strip out bold italic markup
:gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes
return text
end
return p
d4669a2e95551ca7393fd4337669aa6038c951b3
Module:Unicode data
828
105
208
2021-06-05T23:18:42Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Unicode_data]]
Scribunto
text/plain
local p = {}
local floor = math.floor
local function errorf(level, ...)
if type(level) == "number" then
return error(string.format(...), level + 1)
else -- level is actually the format string.
return error(string.format(level, ...), 2)
end
end
local function binary_range_search(codepoint, ranges)
local low, mid, high
low, high = 1, ranges.length or require "Module:TableTools".length(ranges)
while low <= high do
mid = floor((low + high) / 2)
local range = ranges[mid]
if codepoint < range[1] then
high = mid - 1
elseif codepoint <= range[2] then
return range, mid
else
low = mid + 1
end
end
return nil, mid
end
p.binary_range_search = binary_range_search
--[[
local function linear_range_search(codepoint, ranges)
for i, range in ipairs(ranges) do
if range[1] <= codepoint and codepoint <= range[2] then
return range
end
end
end
--]]
-- Load a module by indexing "loader" with the name of the module minus the
-- "Module:Unicode data/" part. For instance, loader.blocks returns
-- [[Module:Unicode data/blocks]]. If a module cannot be loaded, false will be
-- returned.
local loader = setmetatable({}, {
__index = function (self, key)
local success, data = pcall(mw.loadData, "Module:Unicode data/" .. key)
if not success then
data = false
end
self[key] = data
return data
end
})
-- For the algorithm used to generate Hangul Syllable names,
-- see "Hangul Syllable Name Generation" in section 3.12 of the
-- Unicode Specification:
-- https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf
local name_hooks = {
{ 0x00, 0x1F, "<control-%04X>" }, -- C0 control characters
{ 0x7F, 0x9F, "<control-%04X>" }, -- DEL and C1 control characters
{ 0x3400, 0x4DBF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension A
{ 0x4E00, 0x9FFC, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph
{ 0xAC00, 0xD7A3, function (codepoint) -- Hangul Syllables
local Hangul_data = loader.Hangul
local syllable_index = codepoint - 0xAC00
return ("HANGUL SYLLABLE %s%s%s"):format(
Hangul_data.leads[floor(syllable_index / Hangul_data.final_count)],
Hangul_data.vowels[floor((syllable_index % Hangul_data.final_count)
/ Hangul_data.trail_count)],
Hangul_data.trails[syllable_index % Hangul_data.trail_count]
)
end },
-- High Surrogates, High Private Use Surrogates, Low Surrogates
{ 0xD800, 0xDFFF, "<surrogate-%04X>" },
{ 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0x17000, 0x187F7, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph
{ 0x18800, 0x18AFF, function (codepoint)
return ("TANGUT COMPONENT-%03d"):format(codepoint - 0x187FF)
end },
{ 0x18D00, 0x18D08, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph Supplement
{ 0x1B170, 0x1B2FB, "NUSHU CHARACTER-%04X" }, -- Nushu
{ 0x20000, 0x2A6DD, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension B
{ 0x2A700, 0x2B734, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension C
{ 0x2B740, 0x2B81D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension D
{ 0x2B820, 0x2CEA1, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension E
{ 0x2CEB0, 0x2EBE0, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension F
-- CJK Compatibility Ideographs Supplement (Supplementary Ideographic Plane)
{ 0x2F800, 0x2FA1D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xE0100, 0xE01EF, function (codepoint) -- Variation Selectors Supplement
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xE0100 + 17)
end},
{ 0x30000, 0x3134A, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension G
{ 0xF0000, 0xFFFFD, "<private-use-%04X>" }, -- Plane 15 Private Use
{ 0x100000, 0x10FFFD, "<private-use-%04X>" } -- Plane 16 Private Use
}
name_hooks.length = #name_hooks
local name_range_cache
local function generate_name(data, codepoint)
if type(data) == "string" then
return data:format(codepoint)
else
return data(codepoint)
end
end
--[[
-- Checks that the code point is a number and in range.
-- Does not check whether code point is an integer.
-- Not used
local function check_codepoint(funcName, argIdx, val)
require 'libraryUtil'.checkType(funcName, argIdx, val, 'number')
if codepoint < 0 or 0x10FFFF < codepoint then
errorf("Codepoint %04X out of range", codepoint)
end
end
--]]
-- https://www.unicode.org/versions/Unicode11.0.0/ch04.pdf, section 4.8
function p.lookup_name(codepoint)
-- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned
-- (Cn) and specifically noncharacters:
-- https://www.unicode.org/faq/private_use.html#nonchar4
if 0xFDD0 <= codepoint and (codepoint <= 0xFDEF
or floor(codepoint % 0x10000) >= 0xFFFE) then
return ("<noncharacter-%04X>"):format(codepoint)
end
if name_range_cache -- Check if previously used "name hook" applies to this code point.
and codepoint >= name_range_cache[1]
and codepoint <= name_range_cache[2] then
return generate_name(name_range_cache[3], codepoint)
end
local range = binary_range_search(codepoint, name_hooks)
if range then
name_range_cache = range
return generate_name(range[3], codepoint)
end
local data = loader[('names/%03X'):format(codepoint / 0x1000)]
if data and data[codepoint] then
return data[codepoint]
-- Unassigned (Cn) consists of noncharacters and reserved characters.
-- The character has been established not to be a noncharacter,
-- and if it were assigned, its name would already been retrieved,
-- so it must be reserved.
else
return ("<reserved-%04X>"):format(codepoint)
end
end
--[[
-- No image data modules on Wikipedia yet.
function p.lookup_image(codepoint)
local data = loader[('images/%03X'):format(codepoint / 0x1000)]
if data then
return data[codepoint]
end
end
--]]
local planes = {
[ 0] = "Basic Multilingual Plane";
[ 1] = "Supplementary Multilingual Plane";
[ 2] = "Supplementary Ideographic Plane";
[ 3] = "Tertiary Ideographic Plane";
[14] = "Supplementary Special-purpose Plane";
[15] = "Supplementary Private Use Area-A";
[16] = "Supplementary Private Use Area-B";
}
-- Load [[Module:Unicode data/blocks]] if needed and assign it to this variable.
local blocks
local function block_iter(blocks, i)
i = i + 1
local data = blocks[i]
if data then
-- Unpack doesn't work on tables loaded with mw.loadData.
return i, data[1], data[2], data[3]
end
end
-- An ipairs-type iterator generator for the list of blocks.
function p.enum_blocks()
local blocks = loader.blocks
return block_iter, blocks, 0
end
function p.lookup_plane(codepoint)
local i = floor(codepoint / 0x10000)
return planes[i] or ("Plane %u"):format(i)
end
function p.lookup_block(codepoint)
local blocks = loader.blocks
local range = binary_range_search(codepoint, blocks)
if range then
return range[3]
else
return "No Block"
end
end
function p.get_block_info(name)
for i, block in ipairs(loader.blocks) do
if block[3] == name then
return block
end
end
end
function p.is_valid_pagename(pagename)
local has_nonws = false
for cp in mw.ustring.gcodepoint(pagename) do
if (cp == 0x0023) -- #
or (cp == 0x005B) -- [
or (cp == 0x005D) -- ]
or (cp == 0x007B) -- {
or (cp == 0x007C) -- |
or (cp == 0x007D) -- }
or (cp == 0x180E) -- MONGOLIAN VOWEL SEPARATOR
or ((cp >= 0x2000) and (cp <= 0x200A)) -- spaces in General Punctuation block
or (cp == 0xFFFD) -- REPLACEMENT CHARACTER
then
return false
end
local printable, result = p.is_printable(cp)
if not printable then
return false
end
if result ~= "space-separator" then
has_nonws = true
end
end
return has_nonws
end
local function manual_unpack(what, from)
if what[from + 1] == nil then
return what[from]
end
local result = {}
from = from or 1
for i, item in ipairs(what) do
if i >= from then
table.insert(result, item)
end
end
return unpack(result)
end
local function compare_ranges(range1, range2)
return range1[1] < range2[1]
end
-- Creates a function to look up data in a module that contains "singles" (a
-- code point-to-data map) and "ranges" (an array containing arrays that contain
-- the low and high code points of a range and the data associated with that
-- range).
-- "loader" loads and returns the "singles" and "ranges" tables.
-- "match_func" is passed the code point and either the data or the "dots", and
-- generates the final result of the function.
-- The varargs ("dots") describes the default data to be returned if there wasn't
-- a match.
-- In case the function is used more than once, "cache" saves ranges that have
-- already been found to match, or a range whose data is the default if there
-- was no match.
local function memo_lookup(data_module_subpage, match_func, ...)
local dots = { ... }
local cache = {}
local singles, ranges
return function (codepoint)
if not singles then
local data_module = loader[data_module_subpage]
singles, ranges = data_module.singles, data_module.ranges
end
if singles[codepoint] then
return match_func(codepoint, singles[codepoint])
end
local range = binary_range_search(codepoint, cache)
if range then
return match_func(codepoint, manual_unpack(range, 3))
end
local range, index = binary_range_search(codepoint, ranges)
if range then
table.insert(cache, range)
table.sort(cache, compare_ranges)
return match_func(codepoint, manual_unpack(range, 3))
end
if ranges[index] then
local dots_range
if codepoint > ranges[index][2] then
dots_range = {
ranges[index][2] + 1,
ranges[index + 1] and ranges[index + 1][1] - 1 or 0x10FFFF,
unpack(dots)
}
else -- codepoint < range[index][1]
dots_range = {
ranges[index - 1] and ranges[index - 1][2] + 1 or 0,
ranges[index][1] - 1,
unpack(dots)
}
end
table.sort(cache, compare_ranges)
end
return match_func(codepoint)
end
end
-- Get a code point's combining class value in [[Module:Unicode data/combining]],
-- and return whether this value is not zero. Zero is assigned as the default
-- if the combining class value is not found in this data module.
-- That is, return true if character is combining, or false if it is not.
-- See https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values for
-- more information.
p.is_combining = memo_lookup(
"combining",
function (codepoint, combining_class)
return combining_class and combining_class ~= 0 or false
end,
0)
function p.add_dotted_circle(str)
return (mw.ustring.gsub(str, ".",
function(char)
if p.is_combining(mw.ustring.codepoint(char)) then
return '◌' .. char
end
end))
end
local lookup_control = memo_lookup(
"control",
function (codepoint, ccc)
return ccc or "assigned"
end,
"assigned")
p.lookup_control = lookup_control
function p.is_assigned(codepoint)
return lookup_control(codepoint) ~= "unassigned"
end
function p.is_printable(codepoint)
local result = lookup_control(codepoint)
return (result == "assigned") or (result == "space-separator"), result
end
function p.is_whitespace(codepoint)
local result = lookup_control(codepoint)
return (result == "space-separator"), result
end
p.lookup_category = memo_lookup(
"category",
function (codepoint, category)
return category
end,
"Cn")
local lookup_script = memo_lookup(
"scripts",
function (codepoint, script_code)
return script_code or 'Zzzz'
end,
"Zzzz")
p.lookup_script = lookup_script
function p.get_best_script(str)
-- Check type of argument, because mw.text.decode coerces numbers to strings!
require "libraryUtil".checkType("get_best_script", 1, str, "string")
-- Convert HTML character references (including named character references,
-- or character entities) to characters.
str = mw.text.decode(str, true)
local scripts = {}
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
-- Ignore "Inherited", "Undetermined", or "Uncoded" scripts.
if not (script == "Zyyy" or script == "Zinh" or script == "Zzzz") then
scripts[script] = true
end
end
-- If scripts does not contain two or more keys,
-- return first and only key (script code) in table.
if not next(scripts, next(scripts)) then
return next(scripts)
end -- else return majority script, or else "Zzzz"?
end
function p.is_Latin(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0340-U+10FFFF. If they are not found and there is at least
-- one Latin-script character, the string counts as Latin, because the rest
-- of the characters can only be Zyyy, Zinh, and Zzzz.
-- The only scripts found below U+0370 (the first code point of the Greek
-- and Coptic block) are Latn, Zyyy, Zinh, and Zzzz.
-- See the codepage in the [[UTF-8]] article.
if not str:find "[\205-\244]" then
for codepoint in mw.ustring.gcodepoint(str) do
if lookup_script(codepoint) == "Latn" then
return true
end
end
end
local Latn = false
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if script == "Latn" then
Latn = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return Latn
end
-- Checks that a string contains only characters belonging to right-to-left
-- scripts, or characters of ignorable scripts.
function p.is_rtl(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0580-U+10FFFF. If they are not found, the string can only
-- have characters from a left-to-right script, because the first code point
-- in a right-to-left script is U+0591, in the Hebrew block.
if not str:find "[\214-\244]" then
return false
end
local result = false
local rtl = loader.scripts.rtl
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if rtl[script] then
result = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return result
end
local function get_codepoint(args, arg)
local codepoint_string = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
local codepoint = tonumber(codepoint_string, 16)
or errorf(2, "Parameter %s is not a code point in hexadecimal base",
tostring(arg))
if not (0 <= codepoint and codepoint <= 0x10FFFF) then
errorf(2, "code point in parameter %s out of range", tostring(arg))
end
return codepoint
end
local function get_func(args, arg, prefix)
local suffix = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
suffix = mw.text.trim(suffix)
local func_name = prefix .. suffix
local func = p[func_name]
or errorf(2, "There is no function '%s'", func_name)
return func
end
-- This function allows any of the "lookup" functions to be invoked. The first
-- parameter is the word after "lookup_"; the second parameter is the code point
-- in hexadecimal base.
function p.lookup(frame)
local func = get_func(frame.args, 1, "lookup_")
local codepoint = get_codepoint(frame.args, 2)
local result = func(codepoint)
if func == p.lookup_name then
-- Prevent code point labels such as <control-0000> from being
-- interpreted as HTML tags.
result = result:gsub("<", "<")
end
return result
end
function p.is(frame)
local func = get_func(frame.args, 1, "is_")
-- is_Latin and is_valid_pagename take strings.
if func == p.is_Latin or func == p.is_valid_pagename or func == p.is_rtl then
return (func(frame.args[2]))
else -- The rest take code points.
local codepoint = get_codepoint(frame.args, 2)
return (func(codepoint)) -- Adjust to one result.
end
end
return p
3834f6ce1efd8c4eb1a49828d0dbbbd18c91de73
Template:Both
10
3
4
2021-06-06T01:48:35Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Both]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{SAFESUBST:<noinclude />#if:{{{2|}}}|1}}}}<noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Both}}
</noinclude>
11e3119581f17594e02b5ed766168163e719e2cc
Template:Clc
10
36
70
2021-06-06T01:48:37Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Clc]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#REDIRECT [[Template:Category link with count]]
02280e2ab57b544236e11f913e3759c5781ca9d5
Template:Cob
10
120
238
2021-06-06T01:48:37Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Cob]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#REDIRECT [[Template:Collapse bottom]]
414179c04bb216d1df3d18596af4673de10bb273
Template:Collapse bottom
10
38
74
2021-06-06T01:48:38Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Collapse_bottom]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
|}</div><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
{{En-WP attribution notice|Template:Collapse bottom}}
</noinclude>
53b7e30fc0b9f5344fc33db4ab59f5392f62e066
Template:Collapse top
10
39
76
2021-06-06T01:48:38Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Collapse_top]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible {{{{{|safesubst:}}}#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{{{{|safesubst:}}}#if:{{{left|}}}|left|center}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <span style="font-size:115%">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</span>
{{{{{|safesubst:}}}#if:{{{warning|{{{2|}}}}}}
|{{{{{|safesubst:}}}!}}-
{{{{{|safesubst:}}}!}} style="text-align:center; font-style:italic;" {{{{{|safesubst:}}}!}} {{{2|The following is a closed debate. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{{{{|safesubst:}}}!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
{{Collapse top/TemplateData}}
</noinclude>
934c00f78c565a81bd071ae325883eac671acc3a
Template:Collapsible list
10
40
78
2021-06-06T01:48:38Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Collapsible_list]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:collapsible list|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
aff61df28bcc6c3457d6aa36ada4fffe68c409a9
Template:Color
10
121
240
2021-06-06T01:48:39Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Color]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span style="color:{{{1|}}}">{{{2|{{{1|}}}}}}</span><noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude>
f12cd387c0d5c11494a7182b7538cc3292eb3a4a
Template:Coord
10
41
80
2021-06-06T01:48:41Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Coord]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly>{{#invoke:Coordinates|coord}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using coordinates template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Coord]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9| display | format | name | nosave | notes }}<noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Coord}}
</noinclude>
b7ab6e2054a4498d7858016fc1428b1c450b6e09
Template:Country data Austria
10
122
242
2021-06-06T01:48:42Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Austria]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Austria
| flag alias = Flag of Austria.svg
| flag alias-empire = Flag of the Habsburg Monarchy.svg
| flag alias-state = Flag of Austria (state).svg
| flag alias-war = Austria-Hungary-flag-1869-1914-naval-1786-1869-merchant.svg
| flag alias-army = Flag of Austria (state).svg
| flag alias-air force = Flag of Austria (state).svg
| link alias-army = Austrian Land Forces
| flag alias-naval = Flag of Austria (state).svg
| link alias-naval = Austrian Federal Police
| link alias-air force = Austrian Air Force
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = empire
| var2 = state
| var3 = war
| redir1 = AUT
| redir2 = Archduchy of Austria
| related1 = Austria-Hungary
</noinclude>
}}
213d34b9a00caf4938ae1326ee6c9131597e56a5
Template:Country data Belgium
10
123
244
2021-06-06T01:48:42Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Belgium]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Belgium
| flag alias = Flag of Belgium (civil).svg <!-- Not the official flag of Belgium, but see talk page for objections to using the state flag as the default -->
| flag alias-government = Government Ensign of Belgium.svg
| flag alias-state = Flag of Belgium.svg<!-- The official flag of Belgium. See talk page for why it is not the default. -->
| flag alias-1830 = Flag of Belgium (1830).svg
| flag alias-1858 = Royal ensign of Belgium (1858).svg
| flag alias-army = Flag of the Belgian Land Component.svg
| link alias-army = Belgian Land Component
| flag alias-naval = Naval Ensign of Belgium.svg
| link alias-naval = Belgian Navy
| flag alias-air force = Air Force Ensign of Belgium.svg
| link alias-air force = Belgian Air Component
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = state
| var2 = government
| var3 = 1830
| var4 = 1858
| redir1 = BEL
</noinclude>
}}
cc537c026b20572666d6ff4ef53ec8e87b409f1a
Template:Country data Bulgaria
10
124
246
2021-06-06T01:48:43Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Bulgaria]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Bulgaria
| flag alias = Flag of Bulgaria.svg
| flag alias-1878 = Flag of Bulgaria.svg
| flag alias-1944 = Flag of the Bulgarian Homeland Front.svg
| flag alias-1946 = Flag of Bulgaria (1948-1967).svg
| flag alias-1967 = Flag of Bulgaria (1967-1971).svg
| flag alias-1971 = Flag of Bulgaria (1971 – 1990).svg
| flag alias-naval = Naval Ensign of Bulgaria.svg
| link alias-naval = Bulgarian Navy
| flag alias-army = War flag of Bulgaria.svg
| link alias-army = Bulgarian Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1878
| var2 = 1944
| var3 = 1946
| var4 = 1967
| var5 = 1971
| redir1 = BGR
| redir2 = BUL
| related1 = Kingdom of Bulgaria
</noinclude>
}}
d15d83d7bdbe6d98649ded54ef78ea43f02de8b1
Template:Country data Croatia
10
125
248
2021-06-06T01:48:43Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Croatia]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Croatia
| flag alias = Flag of Croatia.svg
| flag alias-civil = Civil Ensign of Croatia.svg
| flag alias-1990 = Flag of Croatia (1990).svg
| flag alias-naval = Naval ensign of Croatia.svg
| link alias-naval = Croatian Navy
| flag alias-air force = Flag of the Croatian Air Force.svg
| link alias-air force = Croatian Air Force
| link alias-military = Republic of Croatia Armed Forces
| link alias-army = Croatian Army
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = civil
| var2 = 1990
| redir1 = HRV
| redir2 = CRO
| related1 = Independent State of Croatia
| related2 = SR Croatia
| related3 = PR Croatia
| related4 = Kingdom of Croatia (Habsburg)
</noinclude>
}}
3991eb420481f822c83d7800b9243b97de54fda3
Template:Country data Cyprus
10
126
250
2021-06-06T01:48:43Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Cyprus]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Cyprus
| flag alias = Flag of Cyprus.svg
| flag alias-1878 = Flag of United Kingdom.svg
| flag alias-1881 = Flag of Cyprus (1881–1922).svg
| flag alias-colonial = Blue Ensign of Cyprus (1922).svg
| flag alias-April 1960 = Flag of Cyprus (1960).svg
| flag alias-1960 = Flag of Cyprus (1960–2006).svg
| link alias-army = Cypriot Ground Forces
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
| altlink = {{{altlink|}}}
<noinclude>
| redir1 = CYP
| var1 = 1878
| var2 = 1881
| var3 = colonial
| var4 = April 1960
| var5 = 1960
</noinclude>
}}
8c0f70f8f83686528fce061c39e2cbf1e3188056
Template:Country data Czech Republic
10
127
252
2021-06-06T01:48:44Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Czech_Republic]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Czech Republic
| flag alias = Flag of the Czech Republic.svg
| link alias-air force = Czech Air Force
| link alias-army = Czech Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
<noinclude>
| redir1 = CZE
| redir2 = Czechia
| related1 = Czechoslovakia
| related2 = Bohemia
| related3 = Slovakia
</noinclude>
}}
3e070640007888ede5f8b7b2816f45c0a46556ae
Template:Country data Denmark
10
128
254
2021-06-06T01:48:44Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Denmark]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Denmark
| flag alias = Flag of Denmark.svg
| flag alias-state = Flag of Denmark (state).svg
| border-state =
| flag alias-naval = Naval Ensign of Denmark.svg
| border-naval =
| link alias-naval = Royal Danish Navy
| link alias-army = Royal Danish Army
| flag alias-army = Flag of Denmark (state).svg
| link alias-air force = Royal Danish Air Force
| flag alias-air force = Flag of Denmark (state).svg
| border-army =
| border-air force =
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = state
| redir1 = DNK
| redir2 = DEN
| redir3 = Kingdom of Denmark
</noinclude>
}}
f2c26342f0ba6e7d828ef884f57d88da1e297710
Template:Country data EU
10
129
256
2021-06-06T01:48:44Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_EU]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#REDIRECT [[Template:Country data European Union]]<noinclude>[[Category: Country data redirects|EU]]</noinclude>
2267fd165f54795dc23946ea44a5a5f233a3d041
Template:Country data Estonia
10
130
258
2021-06-06T01:48:45Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Estonia]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Estonia
| flag alias = Flag of Estonia.svg
| flag alias-naval = Naval Ensign of Estonia.svg
| link alias-naval = Estonian Navy
| flag alias-army=Flag of Estonian Land Forces.svg
| link alias-army=Estonian Land Forces
| flag alias-air force =Flag of the Estonia Air Force.png
| link alias-air force = Estonian Air Force
| border-naval =
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| redir1 = EST
| related1 = Estonian SSR
</noinclude>
}}
3726e0a4c43e691ee6f87ca6788f620f6eeb8733
Template:Country data European Union
10
131
260
2021-06-06T01:48:45Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_European_Union]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = European Union
| flag alias = Flag of Europe.svg
| shortname alias = EU
| size = {{{size|}}}
| name = {{{name|}}}
<noinclude>
| redir1 = EU
| related1 = Europe
</noinclude>
}}
e20448f1167e7e5bfebd941a507b6ef6c3a4650e
Template:Country data Finland
10
132
262
2021-06-06T01:48:45Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Finland]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Finland
| flag alias = Flag of Finland.svg
| flag alias-grand duchy = Flag of Russia.svg
| flag alias-1809 = Flag of Russia.svg
| flag alias-1917 = Flag of Finland 1918 (state).svg
| flag alias-1918 = Flag of Finland (1918-1920).svg
| flag alias-1920 = Flag of Finland.svg
| flag alias-state = Flag of Finland (state).svg
| flag alias-state-1918 = Flag of Finland 1918-1920 (State).svg
| flag alias-state-1920 = Flag of Finland 1920-1978 (State).svg
| flag alias-naval = Military Flag of Finland.svg
| border-naval =
| flag alias-naval-1918 = Flag of Finland 1918-1920 (Military).svg
| border-naval-1918 =
| flag alias-naval-1920 = Flag of Finland 1920-1978 (Military).svg
| border-naval-1920 =
| link alias-naval = Finnish Navy
| flag alias-navy = Naval Jack of Finland.svg
| link alias-navy = Finnish Navy
| link alias-air force = Finnish Air Force
| link alias-army = Finnish Army
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = grand duchy
| var2 = 1809
| var3 = 1917
| var4 = 1918
| var5 = 1920
| var6 = state
| var7 = state-1918
| var8 = state-1920
| var9 = naval-1918
| var10 = naval-1920
| redir1 = FIN
| related1 = Åland
</noinclude>
}}
2b032fd45283601b72bcda96d62ac73a3218f5ec
Template:Country data France
10
133
264
2021-06-06T01:48:46Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_France]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = France
| flag alias = Flag of France.svg
| flag alias-1790 = Flag of France (1790–1794).svg
| flag alias-1794 = Flag of France (1794–1815, 1830–1958).svg
| flag alias-1814 = Flag of the Kingdom of France (1814-1830).svg
| flag alias-1830 = Flag of France (1794–1815, 1830–1958).svg
| flag alias-1848 = Drapeau france 1848.svg
| flag alias-1848a = Drapeau france 1848.svg
| flag alias-1848b = Flag of France (1794–1815, 1830–1958).svg
| flag alias-naval = Civil and Naval Ensign of France.svg
| flag alias-naval-1790 = Flag of French-Navy-Revolution.svg
| link alias-air force = French Air and Space Force
| flag alias-coast guard = French Maritime Gendarmerie racing stripe.svg
| border-coast guard =
| link alias-coast guard = French Maritime Gendarmerie
| link alias-army = French Army
| link alias-naval = French Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1790
| var2 = 1794
| var3 = 1814
| var4 = 1830
| var5 = 1848a
| var6 = 1848b
| var7 = naval-1790
| redir1 = FRA
| related1 = Kingdom of France
| related2 = Free France
</noinclude>
}}
3cd3f88394128ba48bd5b03e9c8ef76c96a5580a
Template:Country data Germany
10
134
266
2021-06-06T01:48:46Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Germany]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{safesubst<noinclude />: {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Germany
| flag alias = Flag of Germany.svg
| flag alias-1866 = Flag of the German Empire.svg
| link alias-1866 = German Empire
| flag alias-empire = Flag of the German Empire.svg
| link alias-empire = German Empire
| flag alias-1919 = Flag of Germany (3-2 aspect ratio).svg
| link alias-1919 = Weimar Republic
| flag alias-Weimar = Flag of Germany (3-2 aspect ratio).svg
| link alias-Weimar = Weimar Republic
| flag alias-1933 = Flag of Germany (1933-1935).svg
| flag alias-1935 = Flag of Germany (1935–1945).svg
| link alias-1935 = Nazi Germany
| flag alias-Nazi = Flag of Germany (1935–1945).svg
| link alias-Nazi = Nazi Germany
| flag alias-1946 = Merchant flag of Germany (1946–1949).svg
| border-1946 =
| flag alias-1949 = Flag of Germany.svg
| flag alias-EUA = German Olympic flag (1959-1968).svg
| flag alias-gold = Flag of West Germany; Flag of Germany (1990–1996).svg
| flag alias-state = Flag of Germany (state).svg
| flag alias-naval = Naval Ensign of Germany.svg
| border-naval =
| link alias-naval = German Navy
| flag alias-coast guard=German Federal Coast Guard racing stripe.svg
| border-coast guard=
| link alias-coast guard=German Federal Coast Guard
| flag alias-army = Colour of Germany.svg
| flag alias-air force =Flag of Germany (state).svg
| link alias-air force = German Air Force
| link alias-army = German Army
| border-army=
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1866
| var2 = empire
| var3 = 1919
| var4 = Weimar
| var5 = 1933
| var6 = 1935
| var7 = Nazi
| var8 = 1946
| var9 = 1949
| var10 = EUA
| var11 = gold
| var12 = state
| redir1 = DEU
| redir2 = GER
| related1 = German Empire
| related2 = Weimar Republic
| related3 = Nazi Germany
| related4 = Allied-occupied Germany
| related5 = East Germany
| related6 = West Germany
</noinclude>
}}
695461d74d0879d3c7c0a36011cd79fc74bc1a79
Template:Country data Gibraltar
10
135
268
2021-06-06T01:48:46Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Gibraltar]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Gibraltar
| flag alias = Flag of Gibraltar.svg
| flag alias-ensign = Government Ensign of Gibraltar.svg
| flag alias-ensign1875 = Government Ensign of Gibraltar (1875–1921).svg
| flag alias-ensign1921 = Government Ensign of Gibraltar (1921–1939).svg
| flag alias-ensign1939 = Government Ensign of Gibraltar (1939–1999).svg
| flag alias-civil = Civil Ensign of Gibraltar.svg
| flag alias-governor = Flag of the Governor of Gibraltar.svg
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = ensign
| var2 = ensign1875
| var3 = ensign1921
| var4 = ensign1939
| var5 = civil
| var6 = governor
| redir1 = GIB
</noinclude>
}}
22381d7b7d5e72ccc3cc576015bd5ca1fd5643aa
Template:Country data Greece
10
136
270
2021-06-06T01:48:47Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Greece]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Greece
| flag alias = Flag of Greece.svg
| flag alias-old = Flag of Greece (1822-1978).svg
| flag alias-1970 = Flag of Greece (1970-1975).svg
| flag alias-royal = State flag of Greece (1863–1924;1935–73).svg
| flag alias-otto = Flag of Greece (1822-1978).svg
| flag alias-army = Hellenic Army War Flag.svg
| link alias-army = Hellenic Army
| border-army=
| flag alias-air force=Fin Flash of Greece.svg
| link alias-air force=Hellenic Air Force
| flag alias-royalnavy = Naval Ensign of Kingdom of Greece.svg
| link alias-naval = Hellenic Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = old
| var2 = 1970
| var3 = royal
| var4 = otto
| var5 = royalnavy
| redir1 = GRC
| redir2 = GRE
</noinclude>
}}
88865b55fb862298e0dd45ac49300af78799eef9
Template:Country data Hungary
10
137
272
2021-06-06T01:48:47Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Hungary]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Hungary
| flag alias = Flag of Hungary.svg
| flag alias-1848 = Flag of Hungary (1848-1849, 1867-1869).svg
| flag alias-1849 = Flag of the Habsburg Monarchy.svg
| flag alias-1867 = Flag of Hungary (1848-1849, 1867-1869).svg
| flag alias-1869 = Flag of Hungary (1869-1874).svg
| flag alias-1874 = Flag of Hungary (1874-1896).svg
| flag alias-1896 = Flag of Hungary (1896-1915; angels).svg
| flag alias-1915 = Flag of Hungary (1915-1918; angels).svg
| flag alias-1918 = Flag of Hungary (1918-1919).svg
| flag alias-1919 = Flag of Hungary (1919).svg
| flag alias-1920 = Flag of Hungary (1915-1918, 1919-1946).svg
| flag alias-1946 = Flag of Hungary (1946-1949, 1956-1957; 1-2 aspect ratio).svg
| flag alias-1949 = Flag of Hungary (1949-1956; 1-2 aspect ratio).svg
| flag alias-1956 = Flag of Hungary (1946-1949, 1956-1957; 1-2 aspect ratio).svg
| flag alias-1957 = Flag of Hungary.svg
| flag alias-state = Flag of Hungary with arms (state).svg
| flag alias-civil = Civil Ensign of Hungary.svg
| flag alias-naval = Naval Ensign of Hungary.svg
| link alias-naval = Hungarian Defence Forces
| flag alias-military = Flag of the Hungarian Defence Forces.svg
| link alias-military = Hungarian Defence Forces
| flag alias-army = War Flag of Hungary.svg
| link alias-army = Hungarian Ground Forces
| link alias-air force = Hungarian Air Force
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1848
| var2 = 1849
| var3 = 1867
| var4 = 1869
| var5 = 1874
| var6 = 1896
| var7 = 1915
| var8 = 1918
| var9 = 1919
| var10 = 1920
| var11 = 1946
| var12 = 1949
| var13 = 1956
| var14 = 1957
| var15 = state
| var16 = civil
| redir1 = HUN
| related1 = Austria-Hungary
</noinclude>
}}
1854fdb5575461006dfcc628d241ee1fa2e46524
Template:Country data Ireland
10
138
274
2021-06-06T01:48:47Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Ireland]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = {{#if:{{{altvar|}}}|Ireland|{{#if:{{{variant|}}}|Ireland|Republic of Ireland}}}}
| shortname alias = Ireland
| flag alias = Flag of Ireland.svg
| flag alias-1783 = Saint Patrick's Saltire.svg
| flag alias-4prov = Four Provinces Flag.svg
| flag alias-green = Green harp flag of Ireland.svg
| flag alias-football = Saint Patrick's Saltire.svg
| link alias-football = Ireland national football team (1882–1950)
| flag alias-hockey = Flag of Ireland hockey team.svg
| flag alias-field hockey = Flag of Ireland hockey team.svg
| {{#ifeq:{{{altlink}}}|A national rugby union team|link alias-rugby union|empty}} = Ireland Wolfhounds
| flag alias-rugby union = IRFU flag.svg
| flag alias-rugby sevens = IRFU flag.svg
| flag alias-rugby league = Four Provinces Flag.svg
| flag alias-cricket = Cricket Ireland flag.svg
| link alias-cricket = Ireland {{{mw|}}} {{{age|}}} cricket team
| flag alias-quidditch = Flag of Quidditch Ireland.svg
| flag alias-air force=Flag of the Irish Air Corps.svg
| link alias-air force=Irish Air Corps
| link alias-naval=Irish Naval Service
| flag alias-military=Flag_of_the_Irish_Defence_Forces.svg
| link alias-military=Irish Defence Forces
| flag alias-army=Flag of the Irish Defence Forces.svg
| link alias-army=Irish Army
| flag alias-navy=Irish Naval Service Colour.svg
| link alias-navy=Irish Naval Service
| flag alias-coast guard=Coast Guard Flag (Ireland).svg
| link alias-coast guard=Irish Coast Guard
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1783
| var2 = green
| var3 = 4prov
| var4 = football
| var5 = rugby union
| var6 = hockey
| var7 = cricket
| redir1 = IRE
| redir2 = EIR
| related1 = Republic of Ireland
| related2 = Southern Ireland
| related3 = Kingdom of Ireland
| related4 = Lordship of Ireland
| related5 = Irish Free State
</noinclude>
}}
b01702e783a55449392d3f0a58bf81be9c0d65a3
Template:Country data Italy
10
139
276
2021-06-06T01:48:48Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Italy]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Italy
| flag alias = Flag of Italy.svg
| flag alias-1861 = Flag of Italy (1861–1946).svg
| flag alias-1943 = War flag of the Italian Social Republic.svg
| flag alias-2003 = Flag of Italy (2003–2006).svg
| flag alias-civil = Civil Ensign of Italy.svg
| flag alias-naval = Naval Ensign of Italy.svg
| link alias-naval = Italian Navy
| link alias-air force = Italian Air Force
| link alias-army = Italian Army
| link alias-roller hockey = Italy {{{mw}}} national roller hockey team
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
<noinclude>
| var1 = 1861
| var2 = 1943
| var4 = 2003
| var5 = civil
| redir1 = ITA
| related1 = Kingdom of Italy
| related2 = Italian Social Republic
| related3 = Napoleonic Italy
</noinclude>
}}
7535bd036cd745a55e39b2641ada76af06ed1c74
Template:Country data Latvia
10
140
278
2021-06-06T01:48:48Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Latvia]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Latvia
| flag alias = Flag of Latvia.svg
| flag alias-naval = Naval Ensign of Latvia.svg
| link alias-naval = Latvian Naval Forces
| link alias-army = Latvian Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| redir1 = LVA
| redir2 = LAT
| related1 = Latvian SSR
</noinclude>
}}
27faf443f0aadbad015306331fc0b6b2d24b4f3d
Template:Country data Lithuania
10
141
280
2021-06-06T01:48:48Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Lithuania]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Lithuania
| flag alias = Flag of Lithuania.svg
| flag alias-1918 = Flag of Lithuania 1918-1940.svg
| flag alias-1988 = Flag of Lithuania (1988-2004).svg
| flag alias-naval = Naval Ensign of Lithuania.svg
| link alias-naval = Lithuanian Naval Force
| flag alias-military=Flag of the Lithuanian Armed Forces.png
| link alias-military=Lithuanian Armed Forces
| flag alias-army = Flag of the Lithuanian Army.svg
| link alias-army = Lithuanian Land Force
| flag alias-navy=Flag of Lithuania (state).svg
| link alias-navy = Lithuanian Naval Force
| flag alias-air force=Air Force Ensign of Lithuania.svg
| link alias-air force=Lithuanian Air Force
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1918
| var2 = 1988
| redir1 = LTU
| related1 = Lithuanian SSR
</noinclude>
}}
ff73a63b7cb85165f1f72854a062d92b4a488078
Template:Country data Luxembourg
10
142
282
2021-06-06T01:48:49Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Luxembourg]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Luxembourg
| flag alias = Flag of Luxembourg.svg
| flag alias-civil = Civil Ensign of Luxembourg.svg
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| redir1 = LUX
| var1 = civil
</noinclude>
}}
9c76f01b95d0d97baea7583cf7d8cad58336978b
Template:Country data Malta
10
143
284
2021-06-06T01:48:49Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Malta]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Malta
| flag alias = Flag of Malta.svg
| flag alias-1875 = Flag of Malta (1875–1898).svg
| flag alias-1898 = Flag of Malta (1898–1923).svg
| flag alias-1923 = Flag of Malta (1923–1943).svg
| flag alias-1943 = Flag of Malta (1943–1964).svg
| flag alias-colonial = Flag of Malta (1943-1964).svg <!-- deprecated, but in use -->
| flag alias-civil = Civil Ensign of Malta.svg
| link alias-naval = Maritime Squadron of the Armed Forces of Malta
| link alias-navy = Maritime Squadron of the Armed Forces of Malta
| flag alias-navy =Naval Jack of Malta.svg
| flag alias-1814 = 19th Century Flag of Malta.svg
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1875
| var2 = 1898
| var3 = 1923
| var4 = 1943
| var5 = civil
| var6 = 1814
| redir1 = MLT
| related1 = Sovereign Military Order of Malta
</noinclude>
}}
b6af438432589b7057b3ad7df55d465baaee1f7e
Template:Country data Netherlands
10
144
286
2021-06-06T01:48:49Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Netherlands]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Netherlands
| flag alias = Flag of the Netherlands.svg
| flag alias-prinsengeus = Naval Jack of the Netherlands.svg
| flag alias-army =Flag of the Royal Netherlands Army.svg
| flag alias-air force=Flag of the Royal Netherlands Air Force.svg
| link alias-air force= Royal Netherlands Air Force
| link alias-army= Royal Netherlands Army
| link alias-naval = Royal Netherlands Navy
| flag alias-navy = Naval Jack of the Netherlands.svg
| link alias-navy=Royal Netherlands Navy
| flag alias-marines = Naval Jack of the Netherlands.svg
| link alias-marines = Netherlands Marine Corps
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = prinsengeus
| redir1 = NLD
| redir2 = NED
| redir3 = The Netherlands
| related1 = Kingdom of the Netherlands
| related2 = Dutch Republic
| related3 = Batavian Republic
</noinclude>
}}
1c723f169b6e9824c190beea044f0bdf8852db76
Template:Country data Poland
10
145
288
2021-06-06T01:48:49Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Poland]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Poland
| flag alias = Flag of Poland.svg
| flag alias-state = State Flag of Poland.svg
| flag alias-1815 = Flag of the Congress of Poland.svg
| flag alias-1919 = Flag of Poland (1919-1928).svg
| flag alias-1928 = Flag of Poland (1928–1980).svg
| flag alias-1955 = Flag of Poland (with coat of arms, 1955-1980).svg
| flag alias-1980 = Flag of Poland (with coat of arms, 1980-1990).svg
| flag alias-1990 = Flag of Poland (with coat of arms).svg
| flag alias-naval = Naval Ensign of Poland.svg
| border-naval =
| flag alias-naval-1919 = Naval Ensign of IIRP v1.svg
| border-naval-1919 =
| flag alias-naval-1946 = Naval Ensign of PRL v1.svg
| border-naval-1946 =
| flag alias-naval-auxiliary = Flaga pomocniczych jednostek pływających Polskiej Marynarki Wojennej.svg
| flag alias-naval-auxiliary-1955 = POL Bandera pjp PRL v1.svg
| link alias-naval = Polish Navy
| flag alias-marines = Flag of the Polish Land Forces.svg
| border-marines =
| link alias-marines = Polish 7th Coastal Defense Brigade
| flag alias-air force = PL air force flag IIIRP.svg
| border-air force =
| link alias-air force = Polish Air Force
| flag alias-army = Flag of the Polish Land Forces.svg
| border-army =
| link alias-army = Polish Land Forces
| size = {{{size|}}}
| size flag alias-naval = 25px
| size flag alias-naval-1919 = 25px
| size flag alias-naval-1946 = 25px
| size flag alias-air force = 25px
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = state
| var2 = 1815
| var3 = 1919
| var4 = 1928
| var5 = 1955
| var6 = 1980
| var7 = 1990
| var10 = naval-1919
| var11 = naval-1946
| var12 = naval-auxiliary
| var13 = naval-auxiliary-1955
| redir1 = POL
</noinclude>
}}
a16d1a4e3a8508f5a6de25926082743251e3d2c9
Template:Country data Portugal
10
146
290
2021-06-06T01:48:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Portugal]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Portugal
| flag alias = Flag of Portugal.svg
| flag alias-1248 = PortugueseFlag1248.svg
| flag alias-1385 = PortugueseFlag1385.svg
| flag alias-1495 = Flag Portugal (1495).svg
| flag alias-1578 = Flag Portugal (1578).svg
| flag alias-1640 = Flag Portugal (1640).svg
| flag alias-1707 = Flag Portugal (1707).svg
| flag alias-1750 = Flag of Portugal (1750).svg
| flag alias-1816 = Flag of the United Kingdom of Portugal, Brazil, and the Algarves.svg
| flag alias-1830 = Flag Portugal (1830).svg
| flag alias-civil = Flag Portugal sea (1830).svg
| flag alias-air force=Portugal Air force fin flash.svg
| flag alias-army = Military flag of Portugal.svg
| link alias-air force = Portuguese Air Force
| link alias-army = Portuguese Army
| link alias-naval = Portuguese Navy
| flag alias-navy=Naval Jack of Portugal.svg
| link alias-navy = Portuguese Navy
| flag alias-marines=Naval Jack of Portugal.svg
| link alias-marines=Portuguese Marine Corps
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1248
| var2 = 1385
| var3 = 1495
| var4 = 1578
| var5 = 1640
| var6 = 1707
| var7 = 1750
| var8 = 1816
| var9 = 1830
| var13 = civil
| redir1 = PRT
| redir2 = POR
| related1 = Portuguese Empire
</noinclude>
}}
208ba0708db45e46bb27b8b9f46d8c0b7b4bb9ed
Template:Country data Romania
10
147
292
2021-06-06T01:48:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Romania]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Romania
| flag alias = Flag of Romania.svg
| flag alias-1859 = Flag of the United Principalities of Wallachia and Moldavia (1859 - 1862).svg
| flag alias-1862 = Flag of the United Principalities of Romania (1862–1866).svg
| flag alias-1866 = Flag of Romania.svg
| flag alias-1948 = Flag of Romania (1948-1952).svg
| flag alias-1952 = Flag of Romania (1952-1965).svg
| flag alias-1965 = Flag of Romania (1965-1989).svg
| link alias-naval = Romanian Naval Forces
| flag alias-naval = Flag of the Romanian Naval Forces (Obverse).svg
| flag alias-air force = Flag of the Romanian Air Force (obverse).svg
| link alias-air force = Romanian Air Force
| flag alias-army = Flag of the Romanian Land Forces (Obverse).svg
| link alias-army = Romanian Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1859
| var2 = 1862
| var3 = 1866
| var4 = 1948
| var5 = 1952
| var6 = 1965
| redir1 = ROU
| redir2 = ROM
| related1 = Kingdom of Romania
</noinclude>
}}
5bf99c82ac26e215940efeab11d1dcc923a024bb
Template:Country data Slovakia
10
148
294
2021-06-06T01:48:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Slovakia]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Slovakia
| flag alias = Flag of Slovakia.svg
| flag alias-1939 = Flag of Slovakia (1939–1945).svg
| flag alias-1938 = Flag of Slovakia (1939–1945).svg
| link alias-army = Ground Forces of the Slovak Republic{{!}}Slovak Ground Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1939
| redir1 = SVK
| related1 = Czechoslovakia
</noinclude>
}}
4168cd2bbdeddd074275b89e8ec936288edb3960
Template:Country data Slovenia
10
149
296
2021-06-06T01:48:51Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Slovenia]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Slovenia
| flag alias = Flag of Slovenia.svg
| link alias-army = Slovenian Ground Force
| link alias-military=Slovenian Armed Forces
| flag alias-military=Flag of the Slovenian Armed Forces.svg
| flag alias-naval=Naval Jack of Slovenia.svg
| link alias-naval=Slovenian Navy
| link-alias-navy=Slovenian Navy
| size = {{{size|}}}
| variant = {{{variant|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
<noinclude>
| redir1 = SVN
| redir2 = SLO
| related1 = SR Slovenia
</noinclude>
}}
68574d7f8429700e25b2100ce323c396d0954025
Template:Country data Spain
10
150
298
2021-06-06T01:48:51Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Spain]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Spain
| flag alias = Flag of Spain.svg
| flag alias-1506 = Flag of Cross of Burgundy.svg
| flag alias-1701 = Bandera de España 1701-1748.svg
| flag alias-1748 = Bandera de España 1748-1785.svg
| flag alias-1785 = Flag of Spain (1785–1873, 1875–1931).svg
| flag alias-1873 = Flag of the First Spanish Republic.svg
| flag alias-1874 = Flag of Spain (1785–1873, 1875–1931).svg
| flag alias-1931 = Flag of Spain (1931–1939).svg
| flag alias-1936 = Bandera del bando nacional 1936-1938.svg
| flag alias-1938 = Flag of Spain (1938–1945).svg
| flag alias-1945 = Flag of Spain (1945–1977).svg
| flag alias-1977 = Flag of Spain (1977–1981).svg
| flag alias-civil = Flag of Spain (Civil).svg
| flag alias-civil-1785 = BandMercante1785.svg
| flag alias-navy=Naval Jack of Spain.svg
| link alias-navy=Spanish Navy
| flag alias-marines=Naval Jack of Spain.svg
| link alias-marines=Spanish Navy Marines
| link alias-army = Spanish Army
| link alias-naval = Spanish Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1506
| var2 = 1701
| var3 = 1748
| var4 = 1785
| var5 = 1873
| var6 = 1874
| var7 = 1931
| var8 = 1936
| var9 = 1938
| var10 = 1945
| var11 = 1977
| var12 = civil
| var13 = civil-1785
| redir1 = ESP
| redir2 = SPA
| related1 = Spanish Republic
| related2 = Spanish State
| related3=Francoist Spain
</noinclude>
}}
16bb8834fbab635236c00b6308d1ae53ba87a122
Template:Country data Sweden
10
151
300
2021-06-06T01:48:51Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Sweden]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Sweden
| flag alias = Flag of Sweden.svg
| flag alias-army = Naval Ensign of Sweden.svg
| flag alias-air force =Naval Ensign of Sweden.svg
| flag alias-1562 = Sweden-Flag-1562.svg
| border-1562 =
| flag alias-1818 = Swedish and Norwegian merchant flag 1818-1844.svg
| flag alias-1844 = Swedish civil ensign (1844–1905).svg
| flag alias-naval = Naval Ensign of Sweden.svg
| flag alias-naval-1844 = Naval Ensign of Sweden (1844-1905).svg
| flag alias-naval-1815 = Swedish and Norwegian naval ensign (1815-1844).svg
| link alias-army = Swedish Army
| border-army=
| border-air force=
| link alias-air force = Swedish Air Force
| border-naval =
| link alias-naval = Swedish Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1562
| var2 = 1818
| var3 = 1844
| var4 = naval-1844
| var5 = naval-1815
| redir1 = SWE
</noinclude>
}}
e5a616c0b56047a0767d5a0f26e072dc89214911
Template:Country data United Kingdom
10
152
302
2021-06-06T01:48:52Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_United_Kingdom]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = United Kingdom
| flag alias = Flag of the United Kingdom.svg
| flag alias-civil = Civil Ensign of the United Kingdom.svg
| flag alias-civil-air = Civil Air Ensign of the United Kingdom.svg
| flag alias-government = Government Ensign of the United Kingdom.svg
| flag alias-naval = Naval Ensign of the United Kingdom.svg
| flag alias-naval-RFA = British-Royal-Fleet-Auxiliary-Ensign.svg
| flag alias-naval-RMAS = British Royal Maritime Auxiliary Ensign.svg
| flag alias-naval-GS = Government Service Ensign.svg
| flag alias-naval-RNLI = Flag of the Royal National Lifeboat Institution.svg
| link alias-naval-RNLI = Royal National Lifeboat Institution
| flag alias-1707 = Flag of Great Britain (1707–1800).svg
| link alias-naval-1707 = Royal Navy
| flag alias-naval-reserve = Naval Ensign of the United Kingdom.svg
| flag alias-naval-merchant = Civil Ensign of the United Kingdom.svg
| link alias-naval = {{#switch:{{{variant|}}}|naval-RFA|RFA=Royal Fleet Auxiliary|naval-RMAS|RMAS=Royal Maritime Auxiliary Service|naval-RNLI|RNLI=Royal National Lifeboat Institution|naval-reserve|reserve=Royal Naval Reserve|naval-merchant|merchant=Merchant Navy (United Kingdom){{!}}Merchant Navy|#default=Royal Navy}}
| flag alias-naval-1707 = Naval ensign of Great Britain (1707–1800).svg
| flag alias-air force = Ensign of the Royal Air Force.svg
| link alias-air force = Royal Air Force
| flag alias-army = Flag of the British Army.svg
| link alias-army = British Army
| flag alias-military = Flag of the United Kingdom (3-5).svg
| link alias-military = British Armed Forces
| flag alias-marines = Flag of the Royal Marines.svg
| link alias-marines = Corps of Royal Marines
| flag alias-coast guard = Flag of Her Majesty's Coastguard.svg
| link alias-coast guard = Her Majesty's Coastguard
| size = {{{size|}}}
| name = {{#ifeq:{{{name|}}}|Britain|United Kingdom|{{{name|}}}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = civil
| var2 = government
| var3 = naval-RFA
| var4 = naval-RMAS
| var5 = naval-RNLI
| var6 = 1707
| var7 = civil-air
| redir1 = UK
| redir2 = U.K.
| redir3 = the United Kingdom
| related1 = Great Britain
| related2 = Kingdom of Great Britain
| related3 = British Empire
| related4 = United Kingdom of Great Britain and Ireland
| related5 = Kingdom of England
| related6 = Kingdom of Scotland
</noinclude>
}}
d86d62f4e23882357d8b0cfe71f84472ec148f3f
Template:Flagcountry
10
153
304
2021-06-06T01:48:53Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flagcountry]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{country data {{{1}}}|flagcountry/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}|name={{{name|}}}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flagcountry template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flagcountry]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | name | size | variant }}<noinclude>{{documentation}}</noinclude>
8e77099d5f28ae1a07d27fb07c9fac8684bd56cf
Template:Flagcountry/core
10
154
306
2021-06-06T01:48:53Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flagcountry/core]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span class="datasortkey" data-sort-value="{{{sortkey|{{{shortname alias|{{{alias}}}}}}}}}"><!--
--><span class="flagicon"><!--
-->[[File:{{{flag alias-{{{variant}}}|{{{flag alias}}}}}}|<!--
-->{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|<!--
-->{{{border-{{{variant}}}|{{{border|border}}}}}} |<!--
-->alt=|<!--
-->link=]] <!--
-->{{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg= }}<!--
-->{{#ifeq:{{{alias}}}|Nepal| }}<!--
--></span>[[{{{link alias-{{{variant}}}|{{{alias}}}}}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|{{{shortname alias|{{{alias}}}}}}}}]]<!--
--></span><noinclude>{{documentation}}</noinclude>
824af0b0d24c27a4f8444a4c761fda2d6a68ff4f
Template:Flagicon
10
155
308
2021-06-06T01:48:54Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flagicon]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly>{{safesubst<noinclude />:#ifeq: {{Yesno-no|{{{noredlink|}}}}}|yes<noinclude><!--
--></noinclude>|<noinclude><!--
#Check for existence of Template: Country data foo before invoking it
--></noinclude>{{safesubst<noinclude />:#ifexist: Template: Country data {{{1|}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It exists, so proceed
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It doesn't exist, so do nothing
--></noinclude>}}<noinclude><!--
--></noinclude>|<noinclude><!--
# DEFAULT call Template: Country data {{{1|}}}
# with no prior checks
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
# Track use where "Template:Country data Foo" does not exist
--></noinclude>{{safesubst<noinclude />:#ifexist: Template:Country data {{{1|}}}||{{safesubst<noinclude />:namespace detect showall
| 1 =
| 2 = [[Category:Flagicons with missing country data templates]]
| user = 1
| talk = 1
| other = 2
}}}}<noinclude><!--
--></noinclude>}}</includeonly>{{safesubst<noinclude />:#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flagicon template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flagicon]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | noredlink | size | variant }}<noinclude>
{{Documentation}}
</noinclude>
4ba00e607bb28194908c631e424736dd64374684
Template:Flatlist/microformat
10
48
94
2021-06-06T01:48:55Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flatlist/microformat]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<div class="hlist">{{{1}}}</div><noinclude>
{{documentation|content=A separate version of the flatlist template for use on the microformat documentation pages.}}
</noinclude>
f7b5a73d06bd6038b6f09a4b9317e4b8f77165be
Template:Flagicon/core
10
156
310
2021-06-06T01:48:55Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flagicon/core]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{safesubst<noinclude />:#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt={{{alias}}}|link={{{alias}}}]]</span><noinclude>{{documentation}}</noinclude>
14677aa18a0f6a866112637a51ba28adf4dd4bbe
Template:Hatnote
10
111
220
2021-06-06T01:48:56Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Hatnote]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote|hatnote}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
4a1d1028d07c9056022807a96051e1c82cf2a1c7
Template:Hidden begin
10
157
312
2021-06-06T01:48:56Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Hidden_begin]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly><div class="mw-collapsible {{#ifeq:{{{showhide|}}}{{{toggle|}}}|left|mw-collapsible-leftside-toggle}} {{#if:{{{expanded|}}} | |mw-collapsed}} {{{class|}}}" style="box-sizing:border-box;width:{{{width|100%}}};font-size:95%;padding:4px;border:{{{border|none}}};{{{style|}}}"><!--
--><div style="font-size:100%;line-height:1.6;font-weight:bold;background:{{{bg1|transparent}}};text-align:{{{ta1|left}}};{{{extra1|}}};{{{titlestyle|{{{headercss|}}}}}}">{{{header|}}}{{{title|}}}</div><!--
--><div class="mw-collapsible-content" style="background:{{{bg2|transparent}}};text-align:{{{ta2|left}}};{{{extra2|}}};{{{bodystyle|{{{contentstyle|{{{contentcss|}}}}}}}}}"></includeonly><noinclude>
{{hatnote|Templates {{noredirect|Template:Begin hidden|Begin hidden}}, {{noredirect|Template:Start hidden|Start hidden}} and {{noredirect|Template:Start hidden section|Start hidden section}} redirect here.}}
{{Documentation}}
</noinclude>
d2b26de163bb16c4fb6f3768180b0fc8e894343e
Template:Hidden end
10
158
314
2021-06-06T01:48:56Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Hidden_end]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<noinclude>{{hatnote|Templates {{noredirect|Template:End hidden|End hidden}} and {{noredirect|Template:End hidden section|End hidden section}} redirect here.}}<div><div></noinclude><!--
--></div></div><!--
--><noinclude>{{Documentation|Template:Hidden begin/doc}}</noinclude>
2f3def935d96317afd11ab0e072d64fd91d9c575
Template:If empty
10
4
6
2021-06-06T01:48:58Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:If_empty]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Template:Infobox
10
5
8
2021-06-06T01:49:00Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
b181da29e3e571777dffc29307761f8560ea76e5
Template:Infobox country/doc
10
161
320
2021-06-06T01:49:05Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox_country/doc]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{#ifeq:{{{nested|no}}}|no|{{documentation subpage}}{{hatnote|{{tl|Infobox geopolitical organisation}} and {{tl|Infobox former country}} redirect here; related parameters and examples are included below.}}}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters}}
This infobox template is used to generate an infobox for the right-hand side of two specific types of article: on a country or territory, or on a geopolitical organisation. Parameter syntax and examples are detailed in the collapsed sections immediately below.
__FORCETOC__
== Syntax ==
<!---------------------- Country/territory use ---------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Country or territory}}
<pre style="overflow:auto;">
{{Infobox country
|micronation = <!--yes if a micronation-->
|conventional_long_name = <!--Formal or official full name of the country in English-->
|native_name = <!--Country's name (usually full name) in its native language, hence in italics (double quotemarks)-->
|common_name = <!--Common name in English (used for wikilinks, captions, and to produce a default iso3166 code)-->
|status = <!--Status of country, especially useful for micronations-->
|image_flag = <!--e.g. Flag of country.svg-->
|alt_flag = <!--alt text for flag (text shown when pointer hovers over flag)-->
|flag_border = <!--set to no to disable border around the flag-->
|image_flag2 = <!--e.g. Second-flag of country.svg-->
|alt_flag2 = <!--alt text for second flag-->
|flag2_border = <!--set to no to disable border around the flag-->
|image_coat = <!--e.g. Coat of arms of country.svg-->
|alt_coat = <!--alt text for coat of arms-->
|symbol_type = <!--emblem, seal, etc (if not a coat of arms)-->
|national_motto = <!--in inverted commas and wikilinked if link exists-->
|englishmotto = <!--English language version of motto-->
|national_anthem = <!--in inverted commas and wikilinked if link exists-->
|royal_anthem = <!--in inverted commas and wikilinked if link exists-->
|other_symbol_type = <!--Use if a further symbol exists, e.g. hymn-->
|other_symbol =
|image_map = <!--e.g. LocationCountry.svg-->
|loctext = <!--text description of location of country-->
|alt_map = <!--alt text for map-->
|map_caption = <!--Caption to place below map-->
|image_map2 = <!--Another map, if required-->
|alt_map2 = <!--alt text for second map-->
|map_caption2 = <!--Caption to place below second map-->
|capital = <!--Name of country/territory's capital, wikilinked if link exists-->
|coordinates = <!-- Coordinates for capital, using {{tl|coord}} -->
|largest_city = <!--Name of country/territory's largest city. Use "capital" (without quotation marks) if it's the capital.-->
|largest_settlement_type = <!--Type of settlement if largest settlement not a city-->
|largest_settlement = <!--Name of largest settlement-->
|official_languages = <!--Languages recognised in legislation, constitution, etc-->
|national_languages = <!--Country/territory-wide languages recognised but not necessarily in country/territory-wide law, etc-->
|regional_languages = <!--Languages recognised or associated with particular regions within the country/territory-->
|languages_type = <!--Use to specify a further type of language, if not official, national or regional-->
|languages = <!--Languages of the further type-->
|languages_sub = <!--Is this further type of language a sub-item of the previous non-sub type? ("yes" or "no")-->
|languages2_type = <!--Another further type of language-->
|languages2 = <!--Languages of this second further type-->
|languages2_sub = <!--Is the second alternative type of languages a sub-item of the previous non-sub type? ("yes" or "no")-->
|ethnic_groups = <!--List/breakdown of ethnic groups within the country/territory-->
|ethnic_groups_year = <!--Year of ethnic groups data (if provided)-->
|ethnic_groups_ref = <!--(for any ref/s to associate with ethnic groups data)-->
|religion = <!--Religion-->
|religion_year = <!--Year of religion data (if provided)-->
|religion_ref = <!--(for any ref/s to associate with religion data)-->
|demonym = <!--Term/s describing those associated with the country/territory (e.g. "Belgian" for the country Belgium)-->
|government_type = <!--(often a compound multi-wikilinked term, e.g. "Federal semi-presidential constitutional republic", etc)-->
|leader_title1 = <!--(for a country, usually the head of state's (wikilinked) title, e.g. "President", "Monarch")-->
|leader_name1 =
|leader_title2 = <!--(could be "Vice President", otherwise "Prime Minster", etc, etc)-->
|leader_name2 =
|leader_title14 = <!--(up to 14 distinct leaders may be included)-->
|leader_name14 =
|legislature = <!--Name of the country/territory's governing body, e.g. "Parliament", "Congress", etc-->
|upper_house = <!--Name of governing body's upper house, if given (e.g. "Senate")-->
|lower_house = <!--Name of governing body's lower house, if given (e.g. "Chamber of Deputies")-->
|sovereignty_type = <!--Brief description of country/territory's status ("Independence [from...]", "Autonomous province [of...]", etc)-->
|sovereignty_note =
|established_event1 = <!--First key event in history of country/territory's status or formation-->
|established_date1 = <!--Date of first key event-->
|established_event2 = <!--Second key event-->
|established_date2 = <!--Date of second key event-->
|established_event13 = <!--(up to 13 distinct events may be included)-->
|established_date13 =
|area_rank =
|area = <!--Major area size (in [[Template:convert]] either km2 or sqmi first)-->
|area_km2 = <!--Major area size (in square km)-->
|area_sq_mi = <!--Area in square mi (requires area_km2)-->
|area_footnote = <!--Optional footnote for area-->
|percent_water =
|area_label = <!--Label under "Area" (default is "Total")-->
|area_label2 = <!--Label below area_label (optional)-->
|area_data2 = <!--Text after area_label2 (optional)-->
|population_estimate =
|population_estimate_rank =
|population_estimate_year =
|population_census =
|population_census_year =
|population_density_km2 =
|population_density_sq_mi =
|population_density_rank =
|nummembers = <!--An alternative to population for micronation-->
|GDP_PPP = <!--(Gross Domestic Product from Purchasing Power Parity)-->
|GDP_PPP_rank =
|GDP_PPP_year =
|GDP_PPP_per_capita =
|GDP_PPP_per_capita_rank =
|GDP_nominal =
|GDP_nominal_rank =
|GDP_nominal_year =
|GDP_nominal_per_capita =
|GDP_nominal_per_capita_rank =
|Gini = <!--(Gini measure of income inequality; input number only; valid values are between 0 and 100)-->
|Gini_ref = <!--(for any ref/s to associate with Gini number)-->
|Gini_rank =
|Gini_year =
|HDI_year = <!-- Please use the year to which the data refers, not the publication year-->
|HDI = <!--(Human Development Index; input number only; valid values are between 0 and 1)-->
|HDI_change = <!--increase/decrease/steady; rank change from previous year-->
|HDI_rank =
|HDI_ref = <!--(for any ref/s to associate with HDI number)-->
|currency = <!--Name/s of currency/ies used in country/territory-->
|currency_code = <!--ISO 4217 code/s for currency/ies (each usually three capital letters)-->
|time_zone = <!--e.g. GMT, PST, AST, etc, etc (wikilinked if possible)-->
|utc_offset = <!--in the form "+N", where N is number of hours offset-->
|time_zone_DST = <!--Link to DST (Daylight Saving Time) used, otherwise leave empty-->
|utc_offset_DST = <!--in the form "+N", where N is number of hours offset-->
|DST_note = <!--Optional note regarding DST use-->
|antipodes = <!--Place/s exactly on the opposite side of the world to country/territory-->
|date_format = <!--all-numeric date format and era, such as [[Common Era|CE]], [[Anno Domini|AD]], [[Hijri year|AH]], etc.; e.g. {{abbr|yyyy|year}}-{{abbr|mm|month}}-{{abbr|dd|day}} ([[Anno Domini|AD]]) -->
|electricity = <!--e.g. "230 V–50 Hz"-->
|drives_on = <!--"right" or "left" (side of road)-->
|cctld = <!--Internet country code top-level domain identifier (e.g. [[.br]], [[.de]], etc)
|iso3166code = <!--ISO code only; no extra text. Use to override default from common_name parameter above; omit using "omit".-->
|calling_code = <!--e.g. [[+1]], [[+531]], [[+44]], etc-->
|patron_saint = <!--Use patron_saints for multiple-->
|image_map3 = <!--Optional third map position, e.g. for use with reference to footnotes below it-->
|alt_map3 = <!--alt text for third map position-->
|footnote_a = <!--For any footnote <sup>a</sup> used above-->
|footnote_b = <!--For any footnote <sup>b</sup> used above-->
|footnote_h = <!--For any footnote <sup>h</sup> used above-->
|footnotes = <!--For any generic non-numbered footnotes-->
}}
</pre>
{{hidden begin |toggle=leftlink |title=France-specific parameters}}
Note: Now redundant.
<pre>
|metropole =
|metropole_area =
|metropole_area_rank =
|metropole_area_magnitude =
|metropole_areami² =
|metropole_population =
|metropole_population_estimate_rank =
|foot =
|foot2 =
|foot3 =
|foot4 =
|foot5 =
</pre>
{{hidden end}}<!--(France-specific parameters)-->
{{smaller|* If, on a particular page, the default widths provided for the flag and coat-of-arms/symbol images produce an unsatisfactory result, use ''flag_width'' (as % or px) to specify the width to be used for the flag image; the remaining width is then assigned to the coat-of-arms/symbol (if included).}}
{{hidden end}}
<!------------------------- Geopolitical use -------------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Geopolitical organization}}
<pre style="overflow:auto;">
{{Infobox geopolitical organization
|name = <!-- (in English) -->
|native_name = <!-- Long-form name in native or any/all non-English languages -->
|linking_name = <!-- For wikilinks, if diff from name -->
|image_flag = <!-- Flag image's filename -->
|alt_flag = <!-- alt text for flag-->
|flag_border = <!--set to no to disable border around the flag-->
|symbol_type = <!-- Symbol, Emblem, Logo, etc. -->
|image_symbol = <!-- Symbol image's filename -->
|alt_symbol = <!-- alt text for symbol -->
|symbol_width = <!-- Symbol image's width (default 85px) -->
|motto = <!-- "[motto]" -->
|englishmotto = <!--English language version of motto-->
|anthem = <!-- ''[anthem name]'' -->
|text_symbol_type = <!-- for other types of text symbol -->
|text_symbol = <!-- e.g. ''[hymn name]'' -->
|image_map = <!-- Map image's filename -->
|loctext = <!--text description of location of organization-->
|alt_map = <!-- alt text for map image -->
|map_width = <!-- Map image's width (default 250px) -->
|map_caption =
|org_type = <!-- e.g. Trade bloc -->
|membership_type = <!-- (default "Membership") -->
|membership = <!-- Type/s and/or number/s of members -->
|admin_center_type = <!-- e.g. "Administrative center" (default) -->
|admin_center = <!-- Location/s of administrative center/s -->
|languages_type = <!-- e.g. "[[Official language]]s" (default) -->
|languages =
|leader_title1 = <!-- e.g. "Chair", "President", etc. -->
|leader_name1 =
|leader_title2 = <!-- e.g. "Deputy chair", etc. -->
|leader_name2 =
|leader_title14 =
|leader_name14 =
|established = <!-- Usually a date, in lieu of event/s hereafter -->
|established_event1 =
|established_date1 =
|established_event2 =
|established_date2 =
|established_event9 =
|established_date9 =
|official_website =
|area_km2 = <!-- major area size (in sq_km) -->
|area_sq_mi = <!-- area in square mi (requires area_km2) -->
|area_footnote = <!-- optional footnote for area -->
|percent_water =
|area_label = <!-- label under "Area" (default is "Total") -->
|area_label2 = <!-- label below area_label (optional) -->
|area_dabodyalign = <!-- text after area_label2 (optional) -->
|population_estimate =
|population_estimate_year =
|population_density_km2 =
|population_density_sq_mi =
|GDP_PPP =
|GDP_PPP_rank =
|GDP_PPP_year =
|GDP_PPP_per_capita =
|GDP_nominal =
|GDP_nominal_year =
|GDP_nominal_per_capita =
|Gini = <!-- number only, 0-100 -->
|Gini_ref = <!-- for any ref/s to associate with Gini number -->
|Gini_year =
|HDI = <!-- number only, 0-1 -->
|HDI_ref = <!-- for any ref/s to associate with HDI number -->
|HDI_year =
|currency =
|currency_code =
|time_zone =
|utc_offset = <!-- +N, where N is number of hours -->
|footnote1 =
|footnote2 =
|footnote7 =
|footnotes = <!-- For generic non-numbered footnotes -->
}}
</pre>
{{hidden end}}
<!-------------------- Former country use ---------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Former country}}
<pre style="overflow:auto;">
{{Infobox former country
|native_name = <!-- Name in a modern syntax of native language(s). Leave blank if name is only in English.
Separate with line breaks<br/> or use Template:Plainlist. If language uses Latin characters, place name(s) in italics. -->
|conventional_long_name = <!-- Full name in English -->
|common_name = <!-- Name to be used in constructing links and category names; not for display -->
|iso3166code = omit <!-- For a country or geopolitical version of a country that ceased to exist prior to the introduction of iso3166-->
|era = <!-- Use: "Napoleonic Wars", "Cold War", etc. -->
|status = <!-- Status: see Category list on template page -->
|status_text = <!-- A free text to describe status at the top of the infobox. Use sparingly. -->
|empire = <!-- The empire or country to which the entity was in a state of dependency -->
|government_type = <!-- To generate categories: "Monarchy", "Republic", etc. to generate categories -->
<!-- Rise and fall, events, years and dates -->
<!-- only fill in the start/end event entry if a specific article exists. Don't just say "abolition" or "declaration" -->
|event_start = <!-- Default: "Established" -->
|date_start = <!-- Optional: Date of establishment, in format 1 January (no year) -->
|year_start = <!-- Year of establishment -->
|event_end = <!-- Default: "Disestablished" -->
|date_end = <!-- Optional: Date of disestablishment, in format 1 January (no year) -->
|year_end = <!-- Year of disestablishment -->
|year_exile_start = <!-- Year of start of exile (if dealing with exiled government: status="Exile") -->
|year_exile_end = <!-- Year of end of exile (leave blank if still in exile) -->
|event1 = <!-- Optional: other events between "start" and "end" -->
|date_event1 =
|event2 =
|date_event2 =
|event3 =
|date_event3 =
|event4 =
|date_event4 =
|event5 =
|date_event5 =
|event6 =
|date_event6 =
|event_pre = <!-- Optional: A crucial event that took place before "event_start" -->
|date_pre =
|event_post = <!-- Optional: A crucial event that took place after "event_end" -->
|date_post =
<!-- Flag navigation: Preceding and succeeding entities p1 to p5 and s1 to s5 -->
|p1 = <!-- Name of the article for preceding entity, numbered 1-5 -->
|flag_p1 = <!-- Default: "Flag of {{{p1}}}.svg" (size 30) -->
|image_p1 = <!-- Use: [[File:Sin escudo.svg|20px|Image missing]] -->
|p2 =
|flag_p2 =
|p3 =
|flag_p3 =
|p4 =
|flag_p4 =
|p5 =
|flag_p5 =
|s1 = <!-- Name of the article for succeeding entity, numbered 1-5 -->
|flag_s1 = <!-- Default: "Flag of {{{s1}}}.svg" (size 30) -->
|image_s1 = <!-- Use: [[File:Sin escudo.svg|20px|Image missing]] -->
|s2 =
|flag_s2 =
|s3 =
|flag_s3 =
|s4 =
|flag_s4 =
|s5 =
|flag_s5 =
|image_flag = <!-- Default: Flag of {{{common_name}}}.svg -->
|flag_alt = <!-- Alt text for flag -->
|image_flag2 = <!-- Second flag -->
|flag_alt2 = <!-- Alt text for second flag -->
|flag = <!-- Link target under flag image. Default: Flag of {{{common_name}}} -->
|flag2 = <!-- Link target under flag2 image. Default: Flag of {{{common_name}}} -->
|flag_type = <!-- Displayed text for link under flag. Default "Flag" -->
|flag2_type = <!-- Displayed text for link under flag2. Default "Flag" -->
|image_coat = <!-- Default: Coat of arms of {{{common_name}}}.svg -->
|coa_size = <!-- Size of coat of arms -->
|coat_alt = <!-- Alt text for coat of arms -->
|symbol_type = <!-- Displayed text for link under symbol. Default "Coat of arms" -->
|symbol_type_article = <!-- Link target under symbol image. Default: Coat of arms of {{{common_name}}} -->
|image_map =
|image_map_alt =
|image_map_caption =
|image_map2 = <!-- If second map is needed; does not appear by default -->
|image_map2_alt =
|image_map2_caption =
|capital =
|capital_exile = <!-- If status="Exile" -->
|national_motto =
|national_anthem =
|common_languages =
|religion =
|demonym =
|currency =
<!-- Titles and names of the first and last leaders and their deputies -->
|leader1 = <!-- Name of king or president -->
|leader2 =
|leader3 =
|leader4 =
|leader21 = <!--(up to 21 distinct leaders may be included)-->
|year_leader1 = <!-- Years served -->
|year_leader2 =
|year_leader3 =
|year_leader4 =
|year_leader21 =
|title_leader = <!-- Default: "King" for monarchy, otherwise "President" -->
|representative1 = <!-- Name of representative of head of state (e.g. colonial governor) -->
|representative2 =
|representative3 =
|representative4 =
|representative5 =
|year_representative1 = <!-- Years served -->
|year_representative2 =
|year_representative3 =
|year_representative4 =
|year_representative5 =
|title_representative = <!-- Default: "Governor" -->
|deputy1 = <!-- Name of prime minister -->
|deputy2 =
|deputy3 =
|deputy4 =
|year_deputy1 = <!-- Years served -->
|year_deputy2 =
|year_deputy3 =
|year_deputy4 =
|title_deputy = <!-- Default: "Prime minister" -->
<!-- Legislature -->
|legislature = <!-- Name of legislature -->
|house1 = <!-- Name of first chamber -->
|type_house1 = <!-- Default: "Upper house" -->
|house2 = <!-- Name of second chamber -->
|type_house2 = <!-- Default: "Lower house" -->
<!-- Area and population of a given year -->
|stat_year1 = <!-- year of the statistic, specify either area, population or both -->
|stat_area1 = <!-- area in square kílometres (w/o commas or spaces), area in square miles is calculated -->
|stat_pop1 = <!-- population (w/o commas or spaces), population density is calculated if area is also given -->
|stat_year2 =
|stat_area2 =
|stat_pop2 =
|stat_year3 =
|stat_area3 =
|stat_pop3 =
|stat_year4 =
|stat_area4 =
|stat_pop4 =
|stat_year5 =
|stat_area5 =
|stat_pop5 =
|today = <!-- Present-day countries that overlap with the territorial extent of the former country. Do not use this parameter if there are more than four such countries. --><!-- Do NOT add flags, per MOS:INFOBOXFLAG -->
|footnote_a = <!-- Accepts wikilinks -->
|footnote_b = <!-- Accepts wikilinks -->
...
|footnote_h = <!-- Accepts wikilinks -->
|footnotes = <!-- Accepts wikilinks -->
}}</pre>
{{hidden end}}<!----(Former country)---->
== Examples ==
<!------------------ Country/territory example ------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Country or territory}}
{{Infobox country
|conventional_long_name = Republic of Cameroon
|native_name = {{lang|fr|République du Cameroun}}
|common_name = Cameroon
|image_flag = Flag of Cameroon.svg
|alt_flag = Vertical tricolor (green, red, yellow) with a five-pointed gold star in the center of the red.
|image_coat = Coat of arms of Cameroon.svg
|symbol_type = Coat of arms
|image_map = Cameroon (orthographic projection).svg
|alt_map = Location of Cameroon on the globe.
|national_motto = <br/>{{native phrase|fr|"Paix – Travail – Patrie"|italics=off}}<br/>{{small|"Peace – Work – Fatherland"}}
|national_anthem = <br/>"{{native phrase|fr|[[O Cameroon, Cradle of our Forefathers|Ô Cameroun, Berceau de nos Ancêtres]]|nolink=yes|italics=off}}"<br/>{{raise|0.2em|{{small|''O Cameroon, Cradle of our Forefathers''}} {{lower|0.1em|<sup>a</sup>}}}}
|official_languages = {{hlist |[[French language|French]] |[[English language|English]]}}
|demonym = Cameroonian
|ethnic_groups =
{{unbulleted list
| {{nowrap|31% [[Ethnic groups in Cameroon|Cameroon Highlanders]]}}
| 19% [[Bantu peoples|Equatorial Bantu]]
| 11% [[Kirdi]]
| 10% [[Fula people|Fulani]]
| 8% [[Bantu peoples|Northwestern Bantu]]
| 7% Eastern Nigritic
| 13% other African
| <1% non-African
}}
|capital = [[Yaoundé]]
|coordinates = {{coord|3|52|N|11|31|E}}
|largest_city = [[Douala]]
|government_type = [[Republic]]
|leader_title1 = [[List of heads of state of Cameroon|President]]
|leader_name1 = [[Paul Biya]]
|leader_title2 = [[Prime Minister of Cameroon|Prime Minister]]
|leader_name2 = [[Philémon Yang]]
|legislature = [[National Assembly (Cameroon)|National Assembly]]
|area_rank = 54th <!--Demographic Yearbook 1.-->
|area_km2 = 475,442
|area_sq_mi = 183,568 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 1.3 <!--CIA World Factbook-->
|population_estimate = 20,129,878
|population_estimate_rank = 58th <!--UN World Population Prospects-->
|population_estimate_year = July 2012
|population_census = 17,463,836
|population_census_year = 2005
|population_density_km2 = 39.7
|population_density_sq_mi = 102.8 <!--Do not remove per [[WP:MOSNUM]]-->
|population_density_rank = 167th <!--UN World Population Prospects-->
|GDP_PPP = $47.251 billion
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $2,257
|GDP_PPP_per_capita_rank =
|GDP_nominal = $25.759 billion
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $1,230
|sovereignty_type = Independence {{nobold|from [[France]]}}
|established_event1 = Declared
|established_date1 = 1 January 1960
|established_event2 = {{nowrap|Annexation of former<br/>[[British Cameroons]]}}
|established_date2 = 1 October 1961
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.482 <!--number only-->
|HDI_ref =
|HDI_rank = 150th
|Gini_year = 2001
|Gini_change = <!--increase/decrease/steady-->
|Gini = 44.6 <!--number only-->
|Gini_ref =
|Gini_rank =
|currency = [[Central African CFA franc]]
|currency_code = XAF
|time_zone = [[West Africa Time|WAT]]
|utc_offset = +1
|time_zone_DST =
|utc_offset_DST =
|electricity =
|drives_on = right
|calling_code = [[+237]]
|cctld = [[.cm]]
|footnote_a = These are the titles as given in the ''Constitution of the Republic of Cameroon'', Article X. The French version of the song is sometimes called {{lang|fr|Chant de Ralliement}}, as in ''National Anthems of the World''; and the English version "O Cameroon, Cradle of Our Forefathers", as in DeLancey and DeLancey 61.
}}
<pre style="font-size:95%;overflow:auto;">
{{Infobox country
|conventional_long_name = Republic of Cameroon
|native_name = {{lang|fr|République du Cameroun}}
|common_name = Cameroon
|image_flag = Flag of Cameroon.svg
|alt_flag = Vertical tricolor (green, red, yellow) with a five-pointed gold star in the center of the red.
|image_coat = Coat of arms of Cameroon.svg
|symbol_type = Coat of arms
|image_map = Cameroon (orthographic projection).svg
|alt_map = Location of Cameroon on the globe.
|national_motto = <br/>{{native phrase|fr|"Paix – Travail – Patrie"|italics=off}}<br/>{{small|"Peace – Work – Fatherland"}}
|national_anthem = <br/>"{{native phrase|fr|[[O Cameroon, Cradle of our Forefathers|Ô Cameroun, Berceau de nos Ancêtres]]|nolink=yes|italics=off}}"<br/>{{raise|0.2em|{{small|''O Cameroon, Cradle of our Forefathers''}} {{lower|0.1em|<sup>a</sup>}}}}
|official_languages = {{hlist |[[French language|French]] |[[English language|English]]}}
|demonym = Cameroonian
|ethnic_groups =
{{unbulleted list
| {{nowrap|31% [[Ethnic groups in Cameroon|Cameroon Highlanders]]}}
| 19% [[Bantu peoples|Equatorial Bantu]]
| 11% [[Kirdi]]
| 10% [[Fula people|Fulani]]
| 8% [[Bantu peoples|Northwestern Bantu]]
| 7% Eastern Nigritic
| 13% other African
| <1% non-African
}}
|capital = [[Yaoundé]]
|coordinates = {{coord|3|52|N|11|31|E}}
|largest_city = [[Douala]]
|government_type = [[Republic]]
|leader_title1 = [[List of heads of state of Cameroon|President]]
|leader_name1 = [[Paul Biya]]
|leader_title2 = [[Prime Minister of Cameroon|Prime Minister]]
|leader_name2 = [[Philémon Yang]]
|legislature = [[National Assembly (Cameroon)|National Assembly]]
|area_rank = 54th <!--Demographic Yearbook 1.-->
|area_km2 = 475,442
|area_sq_mi = 183,568 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 1.3 <!--CIA World Factbook-->
|population_estimate = 20,129,878
|population_estimate_rank = 58th <!--UN World Population Prospects-->
|population_estimate_year = July 2012
|population_census = 17,463,836
|population_census_year = 2005
|population_density_km2 = 39.7
|population_density_sq_mi = 102,8 <!--Do not remove per [[WP:MOSNUM]]-->
|population_density_rank = 167th <!--UN World Population Prospects-->
|GDP_PPP = $47.251 billion
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $2,257
|GDP_PPP_per_capita_rank =
|GDP_nominal = $25.759 billion
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $1,230
|sovereignty_type = Independence {{nobold|from [[France]]}}
|established_event1 = Declared
|established_date1 = 1 January 1960
|established_event2 = {{nowrap|Annexation of former<br/>[[British Cameroons]]}}
|established_date2 = 1 October 1961
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.482 <!--number only-->
|HDI_ref =
|HDI_rank = 150th
|Gini_year = 2001
|Gini_change = <!--increase/decrease/steady-->
|Gini = 44.6 <!--number only-->
|Gini_ref =
|Gini_rank =
|currency = [[Central African CFA franc]]
|currency_code = XAF
|time_zone = [[West Africa Time|WAT]]
|utc_offset = +1
|time_zone_DST = not observed
|utc_offset_DST = +1
|electricity =
|drives_on = right
|calling_code = [[+237]]
|cctld = [[.cm]]
|footnote_a = These are the titles as given in the ''Constitution of the Republic of Cameroon'', Article X. The French version of the song is sometimes called {{lang|fr|Chant de Ralliement}}, as in ''National Anthems of the World''; and the English version "O Cameroon, Cradle of Our Forefathers", as in DeLancey and DeLancey 61.
}}
</pre>
{{hidden end}}
<!-------------- Geopolitical organization example --------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Geopolitical organization}}
{{Infobox geopolitical organization
|name =
{{collapsible list
|titlestyle = background:transparent;text-align:center;font-size:85%;
|title = {{resize|130%|European Union}}
|liststyle = text-align:center;
| {{smaller|{{native name|bg|Европейски съюз}}<br/><!--
-->{{native name|hr|Europska unija}}<br/><!--
-->{{native name|cs|Evropská unie}}<br/><!--
-->{{native name|da|Den Europæiske Union}}<br/><!--
-->{{native name|nl|Europese Unie}}<br /><!--
-->{{native name|et|Euroopa Liit}}<br/><!--
-->{{native name|fi|Euroopan unioni}}<br/><!--
-->{{native name|fr|Union européenne}}<br/><!--
-->{{native name|de|Europäische Union}}<br/><!--
-->{{native name|el|Ευρωπαϊκή Ένωση}}<br/><!--
-->{{native name|hu|Európai Unió}}<br/><!--
-->{{native name|ga|An tAontas Eorpach}}<br/><!--
-->{{native name|it|Unione europea}}<br/><!--
-->{{native name|lv|Eiropas Savienība}}<br/><!--
-->{{native name|lt|Europos Sąjunga}}<br/><!--
-->{{native name|mt|Unjoni Ewropea}}<br/><!--
-->{{native name|pl|Unia Europejska}}<br/><!--
-->{{native name|pt|União Europeia}}<br/><!--
-->{{native name|ro|Uniunea Europeană}}<br/><!--
-->{{native name|sk|Európska únia}}<br/><!--
-->{{native name|sl|Evropska unija}}<br/><!--
-->{{native name|es|Unión Europea}}<br/><!--
-->{{native name|sv|Europeiska unionen}}<!--
-->}}
}}
|linking_name = Europe
|image_flag = Flag of Europe.svg
|alt_flag = Circle of 12 gold stars on a blue background
|motto = "[[Motto of the European Union|United in diversity]]"
|anthem = <div style="padding-bottom:0.2em;">"[[Anthem of Europe|Ode to Joy]]" {{small|(orchestral)}}</div>[[File:Anthem of Europe (US Navy instrumental short version).ogg|center]]
|image_map = EU Globe No Borders.svg
|map_caption = An [[Orthographic projection (cartography)|orthographic projection]] of the world, highlighting the European Union and its Member States (green).
|map_width = 220px
|admin_center_type = Political centres
|admin_center = {{unbulleted list |[[Brussels]] ([[Brussels and the European Union|de facto capital]])|[[Luxembourg (city)|Luxembourg]] |[[Strasbourg]]}}
|largest_city = [[London]]
|official_languages =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = [[Languages of the European Union|24 languages]]
| {{hlist |[[Bulgarian language|Bulgarian]] |[[Croatian language|Croatian]] |[[Czech language|Czech]] |[[Danish language|Danish]] |[[Dutch language|Dutch]] |[[English language|English]] |[[Estonian language|Estonian]] |[[Finnish language|Finnish]] |[[French language|French]] |[[German language|German]] |[[Greek language|Greek]] |[[Hungarian language|Hungarian]] |[[Irish language|Irish]] |[[Italian language|Italian]] |[[Latvian language|Latvian]] |[[Lithuanian language|Lithuanian]] |[[Maltese language|Maltese]] |[[Polish language|Polish]] |[[Portuguese language|Portuguese]] |[[Romanian language|Romanian]] |[[Slovak language|Slovak]] |[[Slovene language|Slovene]] |[[Spanish language|Spanish]] |[[Swedish language|Swedish]]}}
}}
|demonym = [[Citizenship of the European Union|European]]
|membership_type = [[Member state of the European Union|Member state]]s
|membership =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = 28 states
|{{flagcountry|Austria}} |{{flagcountry|Belgium|state}} |{{flagcountry|Bulgaria}}
|{{flagcountry|Croatia}} |{{flagcountry|Cyprus}} |{{flagcountry|Czech Republic}}
|{{flagcountry|Denmark}} |{{flagcountry|Estonia}} |{{flagcountry|Finland}}
|{{flagcountry|France}} |{{flagcountry|Germany}} |{{flagcountry|Greece}}
|{{flagcountry|Hungary}} |{{flagcountry|Ireland}} |{{flagcountry|Italy}}
|{{flagcountry|Latvia}} |{{flagcountry|Lithuania}} |{{flagcountry|Luxembourg}}
|{{flagcountry|Malta}} |{{flagcountry|Netherlands}} |{{flagcountry|Poland}}
|{{flagcountry|Portugal}} |{{flagcountry|Romania}} |{{flagcountry|Slovakia}}
|{{flagcountry|Slovenia}} |{{flagcountry|Spain}} |{{flagcountry|Sweden}}
|{{flagcountry|United Kingdom}}
}}
|leader_title1 = [[President of the European Council|President of the European Council]]
|leader_name1 = {{nowrap|[[Charles Michel]] ([[Mouvement Réformateur|MR]])}}
|leader_title2 = [[President of the European Commission|President of the Commission]]
|leader_name2 = {{nowrap|[[Ursula von der Leyen]] ([[Christian Democratic Union of Germany|CDU]])}}
|legislature = [[Legislature of the European Union]]
|upper_house = {{nowrap|[[Council of the European Union]]}}
|lower_house = [[European Parliament]]
|established_event1 = [[Treaty of Paris (1951)|Treaty of Paris]]
|established_date1 = 23 July 1952
|established_event2 = [[Treaty of Rome]]
|established_date2 = 1 January 1958
|established_event3 = {{nowrap|[[Maastricht Treaty|Treaty of Maastricht]]}}
|established_date3 = 1 November 1993
|official_website = {{URL|europa.eu}}
|area_rank = 7th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|area_km2 = 4,381,376 <!--Do not remove per [[WP:MOSNUM]]-->
|area_sq_mi = 1,691,658 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 3.08
|population_estimate = 507,890,191
|population_estimate_rank = 3rd<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|population_estimate_year = 2012
|population_density_km2 = 116.2 <!--502,486,499 / 4,324,782km2 = 116.2 people/km2 (1 January 2011)-->
|population_density_sq_mi = 300.9 <!--502,486,499 / 1,669,807sq_mi = 300.9 people/sq_mi (1 January 2011)-->
|population_density_rank = <!--Calculated by taking out EU members from the list-->
<!--IMF GDP data published in September 2011; so please do not use the IMF *projections* for 2011-->
|GDP_PPP = $15.821 trillion
|GDP_PPP_rank = 1st<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $31,607<!--same ref as above-->
|GDP_PPP_per_capita_rank = 15th<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal = $17.577 trillion
|GDP_nominal_rank = 1st<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $35,116
|GDP_nominal_per_capita_rank = 14th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|Gini_year = 2010
|Gini_change = <!--increase/decrease/steady-->
|Gini = 30.4 <!--number only-->
|Gini_ref =
|Gini_rank =
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.876 <!--number only-->
|HDI_ref =
|HDI_rank = 13th<!--Calculated by taking out EU members from the list-->{{\}}25th<sup>a</sup><!--Calculated with EU members in the list-->
|currency =
{{hidden begin
|titlestyle = font-size:105%;font-weight:normal;
|title = {{pad|0.5em}}[[Euro]] and others
|bodystyle=font-size:90%;}}
<table cellspacing="0" cellpadding="0">
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Eurozone]]{{spaces|2}}{{nobold|{{small|(17 countries)}}}}</tr>
<tr style="height:22px;"><th>{{flagicon|EU}}<th>[[Euro]]<th>[[Euro sign|€]]<th><code>[[ISO 4217|EUR]]</code></tr>
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Currencies of the European Union|Other currencies]]</tr>
<tr style="height:22px;"><td>{{flagicon|Bulgaria}}<td>[[Bulgarian lev|Lev]]<td>лв<td><code>[[ISO 4217|BGN]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Croatia}}<td>[[Croatian kuna|Kuna]]<td>kn<td><code>[[ISO 4217|HRK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Czech Republic}}<td>[[Czech koruna|Koruna]]<td>Kč<td><code>[[ISO 4217|CZK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Denmark}}<td>[[Danish krone|Krone]]<td>kr<td><code>[[ISO 4217|DKK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Hungary}}<td>[[Hungarian forint|Forint]]<td>Ft<td><code>[[ISO 4217|HUF]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Latvia}}<td>[[Latvian lats|Lats]]<td>Ls<td><code>[[ISO 4217|LVL]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Lithuania}}<td>[[Lithuanian litas|Litas]]<td>Lt<td><code>[[ISO 4217|LTL]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Poland}}<td>[[Polish złoty|Złoty]]<td>zł<td><code>[[ISO 4217|PLN]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Romania}}<td>[[Romanian Leu|Leu]]<td><td><code>[[ISO 4217|RON]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Sweden}}<td>[[Swedish krona|Krona]]<td>kr<td><code>[[ISO 4217|SEK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|United Kingdom}}<td>[[Pound sterling]]<td>£<td><code>[[ISO 4217|GBP]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Gibraltar}}<td>[[Gibraltar pound|Pound]]<td>£<td><code>[[ISO 4217|GIP]]</code></tr>
</table>
{{hidden end}}
|time_zone =
|utc_offset = +0 to +2
|time_zone_DST =
|utc_offset_DST = +1 to +3
|date_format =
|cctld = [[.eu]]
|calling_code = [[Telephone numbers in the European Union|28 codes]]
|footnote_a = If considered as a single entity.
}}
<pre style="font-size:95%;overflow:auto;">
{{Infobox geopolitical organization
|name =
{{collapsible list
|titlestyle = background:transparent;text-align:center;font-size:85%;
|title = {{resize|130%|European Union}}
|liststyle = text-align:center;
| {{smaller|{{native name|bg|Европейски съюз}}<br/><!--
-->{{native name|hr|Europska unija}}<br/><!--
-->{{native name|cs|Evropská unie}}<br/><!--
-->{{native name|da|Den Europæiske Union}}<br/><!--
-->{{native name|nl|Europese Unie}}<br /><!--
-->{{native name|et|Euroopa Liit}}<br/><!--
-->{{native name|fi|Euroopan unioni}}<br/><!--
-->{{native name|fr|Union européenne}}<br/><!--
-->{{native name|de|Europäische Union}}<br/><!--
-->{{native name|el|Ευρωπαϊκή Ένωση}}<br/><!--
-->{{native name|hu|Európai Unió}}<br/><!--
-->{{native name|ga|An tAontas Eorpach}}<br/><!--
-->{{native name|it|Unione europea}}<br/><!--
-->{{native name|lv|Eiropas Savienība}}<br/><!--
-->{{native name|lt|Europos Sąjunga}}<br/><!--
-->{{native name|mt|Unjoni Ewropea}}<br/><!--
-->{{native name|pl|Unia Europejska}}<br/><!--
-->{{native name|pt|União Europeia}}<br/><!--
-->{{native name|ro|Uniunea Europeană}}<br/><!--
-->{{native name|sk|Európska únia}}<br/><!--
-->{{native name|sl|Evropska unija}}<br/><!--
-->{{native name|es|Unión Europea}}<br/><!--
-->{{native name|sv|Europeiska unionen}}<!--
-->}}
}}
|linking_name = Europe
|image_flag = Flag of Europe.svg
|alt_flag = Circle of 12 gold stars on a blue background
|motto = "[[Motto of the European Union|United in diversity]]"
|anthem = <div style="padding-bottom:0.2em;">''[[Anthem of Europe|Ode to Joy]]'' {{small|(orchestral)}}</div>{{center|[[File:Anthem of Europe (US Navy instrumental short version).ogg]]}}
|image_map = EU Globe No Borders.svg
|map_caption = An [[Orthographic projection (cartography)|orthographic projection]] of the world, highlighting the European Union and its Member States (green).
|map_width = 220px
|admin_center_type = Political centres
|admin_center = {{unbulleted list |[[Brussels]] ([[Brussels and the European Union|de facto capital]])|[[Luxembourg (city)|Luxembourg]] |[[Strasbourg]]}}
|largest_city = [[London]]
|official_languages =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = [[Languages of the European Union|24 languages]]
| {{hlist |[[Bulgarian language|Bulgarian]] |[[Croatian language|Croatian]] |[[Czech language|Czech]] |[[Danish language|Danish]] |[[Dutch language|Dutch]] |[[English language|English]] |[[Estonian language|Estonian]] |[[Finnish language|Finnish]] |[[French language|French]] |[[German language|German]] |[[Greek language|Greek]] |[[Hungarian language|Hungarian]] |[[Irish language|Irish]] |[[Italian language|Italian]] |[[Latvian language|Latvian]] |[[Lithuanian language|Lithuanian]] |[[Maltese language|Maltese]] |[[Polish language|Polish]] |[[Portuguese language|Portuguese]] |[[Romanian language|Romanian]] |[[Slovak language|Slovak]] |[[Slovene language|Slovene]] |[[Spanish language|Spanish]] |[[Swedish language|Swedish]]}}
}}
|demonym = [[Citizenship of the European Union|European]]
|membership_type = [[Member state of the European Union|Member state]]s
|membership =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = 28 states
|{{flagcountry|Austria}} |{{flagcountry|Belgium|state}} |{{flagcountry|Bulgaria}}
|{{flagcountry|Croatia}} |{{flagcountry|Cyprus}} |{{flagcountry|Czech Republic}}
|{{flagcountry|Denmark}} |{{flagcountry|Estonia}} |{{flagcountry|Finland}}
|{{flagcountry|France}} |{{flagcountry|Germany}} |{{flagcountry|Greece}}
|{{flagcountry|Hungary}} |{{flagcountry|Ireland}} |{{flagcountry|Italy}}
|{{flagcountry|Latvia}} |{{flagcountry|Lithuania}} |{{flagcountry|Luxembourg}}
|{{flagcountry|Malta}} |{{flagcountry|Netherlands}} |{{flagcountry|Poland}}
|{{flagcountry|Portugal}} |{{flagcountry|Romania}} |{{flagcountry|Slovakia}}
|{{flagcountry|Slovenia}} |{{flagcountry|Spain}} |{{flagcountry|Sweden}}
|{{flagcountry|United Kingdom}}
}}
|leader_title1 = [[President of the European Council|President of the European Council]]
|leader_name1 = {{nowrap|[[Charles Michel]] ([[Mouvement Réformateur|MR]])}}
|leader_title2 = [[President of the European Commission|President of the Commission]]
|leader_name2 = {{nowrap|[[Ursula von der Leyen]] ([[Christian Democratic Union of Germany|CDU]])}}
|legislature = [[Legislature of the European Union]]
|upper_house = {{nowrap|[[Council of the European Union]]}}
|lower_house = [[European Parliament]]
|established_event1 = [[Treaty of Paris (1951)|Treaty of Paris]]
|established_date1 = 23 July 1952
|established_event2 = [[Treaty of Rome]]
|established_date2 = 1 January 1958
|established_event3 = {{nowrap|[[Maastricht Treaty|Treaty of Maastricht]]}}
|established_date3 = 1 November 1993
|official_website = {{URL|europa.eu}}
|area_rank = 7th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|area_km2 = 4,381,376 <!--Do not remove per [[WP:MOSNUM]]-->
|area_sq_mi = 1,691,658 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 3.08
|population_estimate = 507,890,191
|population_estimate_rank = 3rd<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|population_estimate_year = 2012
|population_density_km2 = 116.2 <!--502,486,499 / 4,324,782km2 = 116.2 people/km2 (1 January 2011)-->
|population_density_sq_mi = 300.9 <!--502,486,499 / 1,669,807sq_mi = 300.9 people/sq_mi (1 January 2011)-->
|population_density_rank = <!--Calculated by taking out EU members from the list-->
<!--IMF GDP data published in September 2011; so please do not use the IMF *projections* for 2011-->
|GDP_PPP = $15.821 trillion
|GDP_PPP_rank = 1st<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $31,607
|GDP_PPP_per_capita_rank = 15th<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal = $17.577 trillion
|GDP_nominal_rank = 1st<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $35,116
|GDP_nominal_per_capita_rank = 14th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|Gini_year = 2010
|Gini_change = <!--increase/decrease/steady-->
|Gini = 30.4 <!--number only-->
|Gini_ref =
|Gini_rank =
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.876 <!--number only-->
|HDI_ref =
|HDI_rank = 13th<!--Calculated by taking out EU members from the list-->{{\}}25th<sup>a</sup><!--Calculated with EU members in the list-->
|currency =
{{hidden begin
|titlestyle = font-size:105%;font-weight:normal;
|title = {{pad|0.5em}}[[Euro]] and others
|bodystyle=font-size:90%;}}
<table cellspacing="0" cellpadding="0">
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Eurozone]]{{spaces|2}}{{nobold|{{small|(17 countries)}}}}</tr>
<tr style="height:22px;"><th>{{flagicon|EU}}<th>[[Euro]]<th>[[Euro sign|€]]<th><code>[[ISO 4217|EUR]]</tr>
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Currencies of the European Union|Other currencies]]</tr>
<tr style="height:22px;"><td>{{flagicon|Bulgaria}}<td>[[Bulgarian lev|Lev]]<td>лв<td><code>[[ISO 4217|BGN]]</tr>
<tr style="height:22px;"><td>{{flagicon|Croatia}}<td>[[Croatian kuna|Kuna]]<td>kn<td><code>[[ISO 4217|HRK]]</tr>
<tr style="height:22px;"><td>{{flagicon|Czech Republic}}<td>[[Czech koruna|Koruna]]<td>Kč<td><code>[[ISO 4217|CZK]]</tr>
<tr style="height:22px;"><td>{{flagicon|Denmark}}<td>[[Danish krone|Krone]]<td>kr<td><code>[[ISO 4217|DKK]]</tr>
<tr style="height:22px;"><td>{{flagicon|Hungary}}<td>[[Hungarian forint|Forint]]<td>Ft<td><code>[[ISO 4217|HUF]]</tr>
<tr style="height:22px;"><td>{{flagicon|Latvia}}<td>[[Latvian lats|Lats]]<td>Ls<td><code>[[ISO 4217|LVL]]</tr>
<tr style="height:22px;"><td>{{flagicon|Lithuania}}<td>[[Lithuanian litas|Litas]]<td>Lt<td><code>[[ISO 4217|LTL]]</tr>
<tr style="height:22px;"><td>{{flagicon|Poland}}<td>[[Polish złoty|Złoty]]<td>zł<td><code>[[ISO 4217|PLN]]</tr>
<tr style="height:22px;"><td>{{flagicon|Romania}}<td>[[Romanian Leu|Leu]]<td><td><code>[[ISO 4217|RON]]</tr>
<tr style="height:22px;"><td>{{flagicon|Sweden}}<td>[[Swedish krona|Krona]]<td>kr<td><code>[[ISO 4217|SEK]]</tr>
<tr style="height:22px;"><td>{{flagicon|United Kingdom}}<td>[[Pound sterling]]<td>£<td><code>[[ISO 4217|GBP]]</tr>
<tr style="height:22px;"><td>{{flagicon|Gibraltar}}<td>[[Gibraltar pound|Pound]]<td>£<td><code>[[ISO 4217|GIP]]</tr>
</table>
{{hidden end}}
|time_zone =
|utc_offset = +0 to +2
|time_zone_DST =
|utc_offset_DST = +1 to +3
|date_format =
|cctld = [[.eu]]
|calling_code = [[Telephone numbers in the European Union|28 codes]]
|footnote_a = If considered as a single entity.
}}
</pre>
{{hidden end}}
<!----(Geopolitical organization example)---->
<!------------------ Former country example ------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Former country}}
An example from [[German Empire]]:
{{Infobox former country
|native_name = ''Deutsches Reich''
|conventional_long_name = German Empire
|common_name = Germany
|iso3166code = omit
|status = Empire
|era = [[New Imperialism]]/[[World War I|WWI]]
|event_start = [[Unification of Germany|Unification]]
|date_start = 18 January
|year_start = 1871
|event_end = [[German Revolution of 1918–1919|Republic declared]]
|date_end = 9 November
|year_end = 1918
|event_post = Formal abdication
|date_post = 28 November 1918
|p1 = North German Confederation
|flag_p1 = Flag of the German Empire.svg
|p2 = Kingdom of Bavaria
|flag_p2 = Flag of Bavaria (striped).svg
|p3 = Kingdom of Württemberg
|flag_p3 = Flagge Königreich Württemberg.svg
|p4 = Grand Duchy of Baden
|flag_p4 = Flagge Großherzogtum Baden (1871-1891).svg
|p5 = Grand Duchy of Hesse
|flag_p5 = Flagge_Großherzogtum_Hessen_ohne_Wappen.svg
|p6 = Alsace-Lorraine
|flag_p6 = Flag of France.svg
|s1 = Weimar Republic
|s2 = Republic of Alsace-Lorraine
|s3 = Free City of Danzig
|s4 = Second Polish Republic
|s5 = Klaipėda Region
|s6 = Saar (League of Nations)
|s7 = Hlučín Region
|s8 = South Jutland County{{!}}Northern Schleswig
|s9 = Eupen-Malmedy
|flag_s1 = Flag of Germany (3-2 aspect ratio).svg
|flag_s2 = Flag of the Republic of Alsace-Lorraine.svg
|flag_s3 = Gdansk flag.svg
|flag_s4 = Flag of Poland.svg
|flag_s5 = Flag of Lithuania 1918-1940.svg
|flag_s6 = Flag of Saar 1920-1935.svg
|flag_s7 = Flag of Bohemia.svg
|flag_s8 = Flag of Denmark.svg
|flag_s9 = Flag of Belgium.svg
|image_flag = Flag of the German Empire.svg
|flag_alt = Horizontal tricolor (black, white, red)
|flag_caption = Flag of the German Empire
|image_coat = Wappen Deutsches Reich - Reichsadler 1889.svg
|symbol_type = Imperial Coat of arms
|coat_alt = Shield containing a black, one-headed, rightward-looking eagle with red beak, tongue and claws. On its breast is a shield with another eagle. Over its head is an imperial crown with two crossing ribbons.
|image_map = German Empire, Wilhelminian third version.svg
|image_map_alt = Located in north central Europe, containing modern Germany plus much of modern Poland
|image_map_caption = Territory of the German Empire in 1914, prior to [[World War I]]
|national_motto = ''[[Gott mit uns]]''<br/><small>"God with us"</small>
|national_anthem = {{plainlist|
*''(none official)''
*"[[Heil dir im Siegerkranz]]" (Imperial)
*"[[Deutschlandlied]]" (popular)
*"[[Die Wacht am Rhein]]" (unofficial)
}}
|capital = Berlin
|common_languages =
;Official language
:[[German language|German]]
;Unofficial minority languages
:[[Danish language|Danish]], [[French language|French]], [[Polish language|Polish]], [[Saterland Frisian language|Frisian]], [[Old Prussian language|Old Prussian]], [[Lithuanian language|Lithuanian]]
;Colonial languages
:[[Bantu languages|Bantu]], [[Oshiwambo]], [[Afrikaans]], [[Swahili language|Swahili]] (African Colonies)
:[[Chinese language|Chinese]] (Tsingtao & Jiaozhou bay)
:[[Papuan languages]] (German New Guinea)
:[[Samoan language|Samoan]] (German Samoa)
|government_type = Constitutional monarchy
|title_leader = [[German Emperor|Emperor]]
|leader1 = [[William I, German Emperor|William I]]
|year_leader1 = 1871–1888
|leader2 = [[Frederick III, German Emperor|Frederick III]]
|year_leader2 = 1888
|leader3 = [[Wilhelm II, German Emperor|Wilhelm II]]
|year_leader3 = 1888–1918
|title_deputy = [[List of Chancellors of Germany|Chancellor]]
|deputy1 = [[Otto von Bismarck]] (first)
|year_deputy1 = 1871–1890
|deputy2 = [[Friedrich Ebert]] (last)
|year_deputy2 = 8–9 Nov 1918
|legislature = [[Reichstag (German Empire)|Reichstag]]
|house1 = [[Reichsrat (Germany)|Reichsrat]]
|type_house1 = State council
|stat_year1 = 1871
|religion = {{plainlist|
*[[Lutherans]]~60%
*[[Roman Catholics]]~40%
}}
|stat_pop1 = 41058792
|stat_year2 = 1890
|stat_pop2 = 49428470
|stat_year4 = 1910
|stat_pop4 = 64925993
|stat_area4 = 540857.54
|currency = {{plainlist|
*[[Vereinsthaler]], [[South German gulden]], [[Bremen thaler]], [[Hamburg mark]], [[French franc]] <small>(until 1873, together)</small>
*[[German gold mark|Goldmark]] <small>(1873–1914)</small>
*[[German Papiermark|Papiermark]] <small>(after 1914)</small>
}}
|footnotes = Area and population not including colonial possessions
|today =
}}
<pre style="overflow:auto;">
{{Infobox former country
|native_name = ''Deutsches Reich''
|conventional_long_name = German Empire
|common_name = Germany
|iso3166code = omit
|status = Empire
|era = [[New Imperialism]]/[[World War I|WWI]]
|event_start = [[Unification of Germany|Unification]]
|date_start = 18 January
|year_start = 1871
|event_end = [[German Revolution of 1918–1919|Republic declared]]
|date_end = 9 November
|year_end = 1918
|event_post = Formal abdication
|date_post = 28 November 1918
|p1 = North German Confederation
|flag_p1 = Flag of the German Empire.svg
|p2 = Kingdom of Bavaria
|flag_p2 = Flag of Bavaria (striped).svg
|p3 = Kingdom of Württemberg
|flag_p3 = Flagge Königreich Württemberg.svg
|p4 = Grand Duchy of Baden
|flag_p4 = Flagge Großherzogtum Baden (1871-1891).svg
|p5 = Grand Duchy of Hesse
|flag_p5 = Flagge_Großherzogtum_Hessen_ohne_Wappen.svg
|p6 = Alsace-Lorraine
|flag_p6 = Flag of France.svg
|s1 = Weimar Republic
|s2 = Republic of Alsace-Lorraine
|s3 = Free City of Danzig
|s4 = Second Polish Republic
|s5 = Klaipėda Region
|s6 = Saar (League of Nations)
|s7 = Hlučín Region
|s8 = South Jutland County{{!}}Northern Schleswig
|s9 = Eupen-Malmedy
|flag_s1 = Flag of Germany (3-2 aspect ratio).svg
|flag_s2 = Flag of the Republic of Alsace-Lorraine.svg
|flag_s3 = Gdansk flag.svg
|flag_s4 = Flag of Poland.svg
|flag_s5 = Flag of Lithuania 1918-1940.svg
|flag_s6 = Flag of Saar 1920-1935.svg
|flag_s7 = Flag of Bohemia.svg
|flag_s8 = Flag of Denmark.svg
|flag_s9 = Flag of Belgium.svg
|image_flag = Flag of the German Empire.svg
|flag_alt = Horizontal tricolor (black, white, red)
|flag_caption = Flag of the German Empire
|image_coat = Wappen Deutsches Reich - Reichsadler 1889.svg
|symbol_type = Imperial Coat of arms
|coat_alt = Shield containing a black, one-headed, rightward-looking eagle with red beak, tongue and claws. On its breast is a shield with another eagle. Over its head is an imperial crown with two crossing ribbons.
|image_map = German Empire, Wilhelminian third version.svg
|image_map_alt = Located in north central Europe, containing modern Germany plus much of modern Poland
|image_map_caption = Territory of the German Empire in 1914, prior to [[World War I]]
|national_motto = ''[[Gott mit uns]]''<br/><small>"God with us"</small>
|national_anthem = {{plainlist|
*''(none official)''
*"[[Heil dir im Siegerkranz]]" (Imperial)
*"[[Deutschlandlied]]" (popular)
*"[[Die Wacht am Rhein]]" (unofficial)
}}
|capital = Berlin
|common_languages =
;Official language
:[[German language|German]]
;Unofficial minority languages
:[[Danish language|Danish]], [[French language|French]], [[Polish language|Polish]], [[Saterland Frisian language|Frisian]], [[Old Prussian language|Old Prussian]], [[Lithuanian language|Lithuanian]]
;Colonial languages
:[[Bantu languages|Bantu]], [[Oshiwambo]], [[Afrikaans]], [[Swahili language|Swahili]] (African Colonies)
:[[Chinese language|Chinese]] (Tsingtao & Jiaozhou bay)
:[[Papuan languages]] (German New Guinea)
:[[Samoan language|Samoan]] (German Samoa)
|government_type = Constitutional monarchy
|title_leader = [[German Emperor|Emperor]]
|leader1 = [[William I, German Emperor|William I]]
|year_leader1 = 1871–1888
|leader2 = [[Frederick III, German Emperor|Frederick III]]
|year_leader2 = 1888
|leader3 = [[Wilhelm II, German Emperor|Wilhelm II]]
|year_leader3 = 1888–1918
|title_deputy = [[List of Chancellors of Germany|Chancellor]]
|deputy1 = [[Otto von Bismarck]] (first)
|year_deputy1 = 1871–1890
|deputy2 = [[Friedrich Ebert]] (last)
|year_deputy2 = 8–9 Nov 1918
|legislature = [[Reichstag (German Empire)|Reichstag]]
|house1 = [[Reichsrat (Germany)|Reichsrat]]
|type_house1 = State council
|stat_year1 = 1871
|religion = {{plainlist|
*[[Lutherans]]~60%
*[[Roman Catholics]]~40%
}}
|stat_pop1 = 41058792
|stat_year2 = 1890
|stat_pop2 = 49428470
|stat_year4 = 1910
|stat_pop4 = 64925993
|stat_area4 = 540857.54
|currency = {{plainlist|
*[[Vereinsthaler]], [[South German gulden]], [[Bremen thaler]], [[Hamburg mark]], [[French franc]] <small>(until 1873, together)</small>
*[[German gold mark|Goldmark]] <small>(1873–1914)</small>
*[[German Papiermark|Papiermark]] <small>(after 1914)</small>
}}
|footnotes = Area and population not including colonial possessions
|today =
}}
</pre>
{{hidden end}}
== Errors ==
If the template generates errors when calculating data for the Gini or HDI fields, it will add the article to [[:Category:Country articles requiring maintenance]]. This only happens if the page is in the [[WP:MAINSPACE|main article space]], not any other [[WP:NAMESPACE|namespaces]].
== Microformat ==
{{UF-hcard-place}}
== Tracking categories ==
* {{clc|Country articles requiring maintenance}}
* {{clc|Pages using infobox country with unknown parameters}}
* {{clc|Pages using infobox country with syntax problems}}
* {{clc|Pages using infobox country or infobox former country with the flag caption or type parameters}}
* {{clc|Pages using infobox country or infobox former country with the symbol caption or type parameters}}
* {{clc|Former country articles using status text with Colony or Exile}}
== TemplateData ==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "This template produces an infobox for countries that covers their major attributes such as their flags, ethnic makeup, and political system.",
"params": {
"conventional_long_name": {
"label": "Conventional long name",
"type": "string",
"required": false,
"description": "Formal or official full name of the country in English. This entry should not be enclosed in brackets.",
"example": "The United States of America"
},
"common_name": {},
"linking_name": {},
"native_name": {
"label": "Native name",
"type": "string",
"required": false,
"example": "{{native name|Bundesrepublik Deutschland}}",
"description": "Country's name (usually full name) in its native language, hence in italics (double quotemarks). The template {{native name}} should be used with this parameter to automatically italicize the text."
},
"name": {
"label": "Geopolitical organisation name",
"type": "string",
"required": false,
"description": "Name of the geopolitical organisation in English."
},
"image_flag": {
"label": "Flag",
"type": "wiki-file-name",
"required": false,
"example": "Flag of Iceland.svg",
"description": "File name of an image file on Wikipedia or on Commons that contains the country's current flag. Do not enclose this entry in double brackets and do not give it a prefix such as File:"
},
"flag_width": {
"label": "Flag width",
"type": "string",
"required": false,
"description": "If the default widths provided for the flag and coat-of-arms/symbol images produce an unsatisfactory result, use this to specify the width to be used for the flag image; the remaining width is then assigned to the coat-of-arms/symbol (if included). Can be done as a % or px."
},
"alt_flag": {
"label": "Flag alt text",
"type": "string",
"required": false,
"description": "Alternate text for flag (text shown when pointer hovers over flag)."
},
"flag_border": {
"label": "Flag border",
"type": "string",
"required": false,
"description": "Set to no to disable border around the flag."
},
"flag_caption": {
"label": "Flag caption",
"type": "string",
"required": false,
"description": "Use this parameter to enter a caption for the flag, if one is necessary. Do not end this entry with a period.",
"example": "1992 version of the flag prior to the country's dissolution"
},
"image_flag2": {
"label": "Second flag",
"type": "wiki-file-name",
"required": false,
"example": "Secondflag of Namibia.svg",
"description": "If a country has a second flag— perhaps because of an ongoing civil war or a dispute over sovereignty— you can provide the file name of that second flag in this parameter. Do not include the prefix File:, and do not enclose it in double brackets."
},
"alt_flag2": {
"label": "Second flag alt text",
"type": "string",
"required": false,
"description": "Alt text for second flag (text shown when pointer hovers over flag)."
},
"flag2_border": {
"label": "Second flag border",
"type": "string",
"required": false,
"description": "Set to no to disable border around the flag."
},
"image_coat": {
"label": "Coat of arms",
"type": "wiki-file-name",
"aliases": [
"image_symbol"
],
"example": "Great Seal of the United States (obverse).svg"
},
"symbol_width": {
"label": "Symbol width",
"type": "string",
"required": false,
"description": "Symbol image's width.",
"default": "85px"
},
"alt_coat": {
"label": "Coat of arms alt text",
"type": "string",
"aliases": [
"alt_symbol",
"coat_alt"
],
"required": false,
"description": "Alt text for coat of arms."
},
"symbol_type": {
"label": "Symbol type",
"type": "string",
"required": false,
"description": "If not a coat of arms.",
"example": "emblem, seal, etc"
},
"symbol_type_article": {
"label": "Symbol type article",
"type": "string",
"description": "An article about the type of symbol of the country"
},
"text_symbol": {
"label": "Text symbol",
"type": "string",
"required": false,
"description": "For other types of text symbol.",
"example": "''[hymn name]''"
},
"text_symbol_type": {
"label": "Text symbol type",
"type": "string",
"required": false,
"description": "For other types of text symbol."
},
"other_symbol": {
"label": "Other symbol",
"type": "string",
"required": false,
"description": "Use if a further symbol exists."
},
"other_symbol_type": {
"label": "Other symbol type",
"type": "string",
"required": false
},
"national_motto": {
"label": "National motto",
"type": "string",
"required": false,
"example": "{{lang|de|''{{lang|de|[[Das Lied der Deutschen|Einigkeit und Recht und Freiheit]]}}''}}",
"description": "In inverted commas and wikilinked if link exists. Can also be used with the {{lang}} template and correct two-letter language code to designate the language of the motto where not provided in English."
},
"motto": {
"label": "Motto",
"type": "string",
"required": false
},
"national_anthem": {
"label": "National anthem",
"type": "string",
"required": false,
"description": "In inverted commas and wikilinked if link exists."
},
"anthem": {
"label": "Anthem",
"type": "string",
"required": false
},
"royal_anthem": {
"label": "Royal anthem",
"type": "string",
"required": false,
"description": "In inverted commas and wikilinked if link exists."
},
"image_map": {
"label": "Map",
"type": "string",
"required": false,
"example": "LocationCountry.svg"
},
"map_width": {
"label": "Map width",
"type": "string",
"required": false,
"description": "Map image's width.",
"default": "250px"
},
"alt_map": {
"label": "Map alt text",
"type": "string",
"required": false
},
"map_caption": {
"label": "Map caption",
"type": "string",
"required": false,
"description": "Caption to place below map."
},
"image_map2": {
"label": "Map 2",
"type": "string",
"required": false,
"description": "Another map, if required."
},
"map2_width": {
"label": "Map 2 width",
"type": "string",
"required": false
},
"alt_map2": {
"label": "Map 2 alt text",
"type": "string",
"required": false
},
"map_caption2": {
"label": "Map 2 caption",
"type": "string",
"required": false,
"description": "Caption to place below second map."
},
"image_map3": {},
"map3_width": {},
"alt_map3": {},
"map_caption3": {},
"capital": {
"label": "Capital",
"type": "string",
"required": false,
"description": "Name of country/territory's capital, wikilinked if link exists."
},
"capital_type": {
"label": "Capital type",
"type": "string",
"required": false
},
"coordinates": {
"label": "Coordinates",
"type": "string",
"required": false,
"description": "The geographic coordinates of the capital."
},
"latd": {
"label": "Latitude degrees",
"type": "string",
"required": false,
"description": "The degrees of the capital's latitude."
},
"latm": {
"label": "Latitude minutes",
"type": "string",
"description": "The minutes of the capital's latitude."
},
"latNS": {
"label": "Latitude NS",
"type": "string",
"description": "The direction of the capital's latitude."
},
"longd": {
"label": "Longitude degrees",
"type": "string",
"description": "The degrees of the capital's longitude."
},
"longm": {
"label": "Longitude minutes",
"type": "string",
"description": "The minutes of the capital's longitude."
},
"longEW": {
"label": "Longitude EW",
"type": "string",
"description": "The direction of the capital's longitude."
},
"admin_center": {
"label": "Administrative center",
"type": "string",
"required": false,
"description": "Location/s of administrative center/s."
},
"admin_center_type": {
"label": "Administrative center type",
"type": "string",
"required": false,
"default": "Administrative center"
},
"capital2": {
"label": "Capital 2",
"type": "string",
"required": false,
"description": "Name of country/territory's capital, wikilinked if link exists."
},
"capital_type2": {
"label": "Capital 2 type",
"type": "string",
"required": false
},
"admin_center2": {
"label": "Administrative center 2",
"type": "string",
"required": false
},
"admin_center_type2": {
"label": "Administrative center 2 type",
"type": "string",
"required": false
},
"largest_city": {
"label": "Largest city",
"type": "string",
"required": false,
"description": "Name of country/territory's largest city. Use \"capital\" (without quotemarks) if it's the capital."
},
"largest_settlement": {
"label": "Largest settlement",
"type": "string",
"required": false,
"description": "Name of largest settlement if not a city."
},
"largest_settlement_type": {
"label": "Largest settlement type",
"type": "string",
"required": false,
"description": "Type of settlement if largest settlement not a city."
},
"official_languages": {
"label": "Official languages",
"type": "string",
"required": false,
"description": "Languages recognised in legislation, constitution, etc."
},
"national_languages": {
"label": "National languages",
"type": "string",
"required": false,
"description": "Country/territory-wide languages recognised but not necessarily in country/territory-wide law, etc."
},
"regional_languages": {
"label": "Regional languages",
"type": "string",
"required": false,
"description": "Languages recognised or associated with particular regions within the country/territory."
},
"languages_type": {
"label": "Languages type",
"type": "string",
"description": "Use to specify a further type of language, if not official, national or regional."
},
"languages_sub": {
"label": "Languages sub",
"type": "string",
"required": false,
"description": "Is this further type of language a sub-item of the previous non-sub type?",
"example": "'yes' or 'no'"
},
"languages": {
"label": "Languages",
"type": "string",
"required": false,
"description": "Languages of the further type."
},
"languages2_type": {
"label": "2nd languages type",
"type": "string",
"description": "Use to specify a 2nd further type of language, if not official, national or regional."
},
"languages2_sub": {
"label": "Languages 2 sub",
"type": "string",
"required": false,
"description": "Is the second alternative type of languages a sub-item of the previous non-sub type?",
"example": "'yes or 'no'"
},
"languages2": {
"label": "Languages 2",
"type": "string",
"required": false,
"description": "Languages of the second further type."
},
"ethnic_groups": {
"label": "Ethnic groups",
"type": "string",
"required": false,
"description": "The primary ethnic groups of the country",
"example": "{{unbulleted list | 68.8% [[Bumiputera (Malaysia)|Bumiputera]] | 23.2% [[Malaysian Chinese|Chinese]] | 7.0% [[Malaysian Indian|Indian]] | 1.0% Others }}"
},
"ethnic_groups_ref": {
"label": "Ethnic groups reference",
"type": "string",
"required": false,
"description": "Reference, in <ref> format, of ethnic composition"
},
"ethnic_groups_year": {
"label": "Ethnic groups year",
"type": "number",
"required": false,
"description": "Year the ethnic group statistic is from",
"example": "2017"
},
"religion": {
"label": "Religions",
"type": "string",
"required": false,
"description": "List of religious affiliations in {{ublist}} format",
"example": "{{ublist|list_style=line-height:1.3em; |class=nowrap | 33.2% [[Buddhism in Singapore|Buddhism]]...}}"
},
"religion_ref": {
"label": "Religions reference",
"type": "string",
"required": false,
"description": "Reference, in <ref> format, of religious composition"
},
"demonym": {
"label": "Demonym",
"type": "string",
"required": false,
"description": "Name of residents of this country",
"example": "Singaporean",
"suggested": true
},
"org_type": {
"label": "Organization type",
"type": "string",
"required": false
},
"membership": {
"label": "membership",
"type": "string",
"required": false
},
"membership_type": {
"label": "membership_type",
"type": "string",
"required": false
},
"government_type": {
"label": "Type of government",
"type": "string",
"required": false,
"description": "The type of government, e.g. federal republic",
"example": "[[Monarchy]]"
},
"politics_link": {
"label": "Politics link",
"type": "string",
"required": false
},
"leader_title1": {
"label": "Leader 1 title",
"type": "line",
"required": false,
"description": "Title of principal leader",
"example": "[[President of Singapore|President]]"
},
"leader_name1": {
"label": "Leader 1 name",
"type": "line",
"required": false,
"description": "Name of principal leader",
"example": "[[Halimah Yacob]]"
},
"leader_title2": {
"label": "Leader 2 title",
"type": "line",
"required": false,
"description": "Title of 2nd leader",
"example": "[[Prime Minister of Singapore|Prime Minister]]"
},
"leader_name2": {
"label": "Leader 2 name",
"type": "line",
"description": "Name of 2nd leader",
"example": "[[Lee Hsien Loong]]"
},
"leader_title3": {
"label": "Leader 3 title",
"type": "line",
"required": false,
"description": "Title of 3rd leader",
"example": "[[Deputy Prime Minister of Singapore|Deputy Prime Ministers]]"
},
"leader_name3": {
"label": "Leader 3 name",
"type": "line",
"description": "Name of 3rd leader",
"example": "[[Teo Chee Hean]]<br>[[Tharman Shanmugaratnam]]"
},
"leader_title4": {
"label": "Leader 4 title",
"type": "line",
"required": false,
"description": "Title of the 4th leader",
"example": "[[President pro tempore of the United States Senate|President pro tempore]]"
},
"leader_name4": {
"label": "Leader 4 name",
"type": "line",
"description": "Name of the 4th leader"
},
"leader_title5": {
"label": "leader_title5",
"type": "string",
"required": false
},
"leader_name5": {
"label": "Leader name 5",
"type": "string"
},
"leader_title6": {
"label": "Leader title 6",
"type": "string",
"required": false
},
"leader_name6": {
"label": "Leader name 6",
"type": "string"
},
"leader_title7": {
"label": "Leader title7",
"type": "string",
"required": false
},
"leader_name7": {
"label": "Leader name 7",
"type": "string"
},
"leader_title8": {
"label": "Leader title 8",
"type": "string",
"required": false
},
"leader_name8": {
"label": "Leader name 8",
"type": "string"
},
"leader_title9": {
"label": "Leader title 9",
"type": "string",
"required": false
},
"leader_name9": {
"label": "Leader name 9",
"type": "string"
},
"leader_title10": {
"label": "Leader title 10",
"type": "string",
"required": false
},
"leader_name10": {
"label": "Leader name 10",
"type": "string"
},
"leader_title11": {
"label": "Leader title 11",
"type": "string",
"required": false
},
"leader_name11": {
"label": "Leader name 11",
"type": "string"
},
"leader_title12": {
"label": "Leader title 12",
"type": "string",
"required": false
},
"leader_name12": {
"label": "Leader name 12",
"type": "string"
},
"leader_title13": {
"label": "Leader title 13",
"type": "string",
"required": false
},
"leader_name13": {
"label": "Leader name 13",
"type": "string"
},
"leader_title14": {
"label": "Leader title 14",
"type": "string",
"required": false
},
"leader_name14": {
"label": "Leader name 14",
"type": "string"
},
"legislature": {
"label": "Legislature",
"type": "line",
"description": "Name of, and link to, the country's national legislature",
"example": "[[Parliament of Singapore|Parliament]]"
},
"upper_house": {
"description": "Upper house of the country or organization's legislature",
"type": "string",
"example": "[[United States House of Representatives|House of Representatives]]"
},
"lower_house": {
"description": "Lower house of the country or organization's legislature",
"label": "Lower house",
"type": "string",
"example": "[[United States House of Representatives|House of Representatives]]"
},
"sovereignty_type": {
"label": "Sovereignty type",
"type": "line",
"required": false,
"description": "Type of sovereignty this country has",
"example": "Independence"
},
"sovereignty_note": {
"label": "Sovereignty note",
"type": "content",
"required": false,
"description": "Note about this country's sovereignty",
"example": "from the [[United Kingdom]]"
},
"established": {
"label": "established",
"type": "string",
"required": false
},
"established_event1": {
"label": "Establishment event 1",
"type": "string",
"required": false
},
"established_date1": {
"label": "Establishment date 1",
"type": "string",
"required": false
},
"established_event2": {
"label": "Establishment event 2",
"type": "string",
"required": false
},
"established_date2": {
"label": "Establishment date 2",
"type": "string",
"required": false
},
"established_event3": {
"label": "Establishment event 3",
"type": "string",
"required": false
},
"established_date3": {
"label": "Establishment date 3",
"type": "string",
"required": false
},
"established_event4": {
"label": "Establishment event 4",
"type": "string",
"required": false
},
"established_date4": {
"label": "established_date4",
"type": "string",
"required": false
},
"established_event5": {
"label": "Establishment event 5",
"type": "string",
"required": false
},
"established_date5": {
"label": "established_date5",
"type": "string",
"required": false
},
"established_event6": {
"label": "established_event6",
"type": "string",
"required": false
},
"established_date6": {
"label": "established_date6",
"type": "string",
"required": false
},
"established_event7": {
"label": "established_event7",
"type": "string",
"required": false
},
"established_date7": {
"label": "established_date7",
"type": "string",
"required": false
},
"established_event8": {
"label": "established_event8",
"type": "string",
"required": false
},
"established_date8": {
"label": "established_date8",
"type": "string",
"required": false
},
"established_event9": {
"label": "established_event9",
"type": "string",
"required": false
},
"established_date9": {
"label": "established_date9",
"type": "string",
"required": false
},
"established_event10": {
"label": "established_event10",
"type": "string",
"required": false
},
"established_date10": {
"label": "established_date10",
"type": "string",
"required": false
},
"established_event11": {
"label": "established_event11",
"type": "string",
"required": false
},
"established_date11": {
"label": "established_date11",
"type": "string",
"required": false
},
"established_event12": {
"label": "established_event12",
"type": "string",
"required": false
},
"established_date12": {
"label": "established_date12",
"type": "string",
"required": false
},
"area_km2": {
"label": "Land area (km²)",
"type": "number",
"required": false,
"description": "Land area of the country in square kilometers",
"example": "722.5",
"suggested": true
},
"area_link": {
"label": "area_link",
"type": "string",
"required": false
},
"area_label": {
"label": "area_label",
"type": "string",
"required": false
},
"FR_foot4": {
"label": "FR_foot4",
"type": "string",
"required": false,
"deprecated": true
},
"area_footnote": {
"label": "area_footnote",
"type": "string",
"required": false
},
"area_rank": {
"label": "Area rank",
"type": "string",
"required": false,
"description": "Rank among countries of land area",
"example": "174th",
"suggested": true
},
"area_sq_mi": {
"label": "Land area (mi²)",
"type": "number",
"required": false,
"description": "Land area of the country in square miles",
"example": "290"
},
"percent_water": {
"label": "percent_water",
"type": "string",
"required": false
},
"area_label2": {
"label": "area_label2",
"type": "string",
"required": false
},
"area_data2": {
"label": "area_data2",
"type": "string",
"required": false
},
"area_label3": {
"label": "area_label3",
"type": "string",
"required": false
},
"area_data3": {
"label": "area_data3",
"type": "string",
"required": false
},
"FR_metropole": {
"label": "FR_metropole",
"type": "string",
"required": false,
"deprecated": true
},
"FR_foot2": {
"label": "FR_foot2",
"type": "string",
"required": false,
"deprecated": true
},
"FR_IGN_area_km2": {
"label": "FR_IGN_area_km2",
"type": "string",
"required": false,
"deprecated": true
},
"FR_IGN_area_rank": {
"label": "FR_IGN_area_rank",
"type": "string",
"required": false,
"deprecated": true
},
"FR_IGN_area_sq_mi": {
"label": "FR_IGN_area_sq_mi",
"type": "string",
"required": false,
"deprecated": true
},
"FR_foot3": {
"label": "FR_foot3",
"type": "string",
"required": false,
"deprecated": true
},
"FR_cadastre_area_km2": {
"label": "FR_cadastre_area_km2",
"type": "string",
"required": false,
"deprecated": true
},
"FR_cadastre_area_rank": {
"label": "FR_cadastre_area_rank",
"type": "string",
"required": false,
"deprecated": true
},
"FR_cadastre_area_sq_mi": {
"label": "FR_cadastre_area_sq_mi",
"type": "string",
"required": false,
"deprecated": true
},
"population_estimate": {
"label": "Population estimate",
"type": "number",
"required": false,
"description": "An estimate of the country's population",
"example": "24,000,000"
},
"population_census": {
"label": "Population census",
"type": "string"
},
"population_link": {
"label": "Population link",
"type": "url"
},
"population_estimate_year": {
"label": "Population estimate year",
"type": "number",
"description": "The year the population estimate is from",
"example": "2018"
},
"population_estimate_rank": {
"label": "Population estimate rank",
"type": "string",
"description": "Rank among countries in estimated population",
"example": "3rd"
},
"population_label2": {
"label": "population_label2",
"type": "string",
"required": false
},
"population_data2": {
"label": "Population data 2",
"type": "string",
"required": false
},
"population_label3": {
"label": "Population label 3",
"type": "string",
"required": false
},
"population_data3": {
"label": "Population data 3",
"type": "string",
"required": false
},
"population_census_year": {
"label": "Population census year",
"type": "number",
"required": false,
"description": "Year the population census statistics are from",
"example": "2010"
},
"population_census_rank": {
"label": "Population census rank",
"type": "string",
"description": "Rank among countries in census population",
"example": "3rd"
},
"population_density_km2": {
"label": "Population density per km²",
"type": "number",
"example": "20,212",
"description": "Population density per square kilometer"
},
"population_density_sq_mi": {
"label": "Population density per mi²",
"type": "number",
"description": "Population density per square mile",
"example": "20,212"
},
"pop_den_footnote": {
"label": "Population density footnote",
"type": "string",
"description": "footnote about the population density statistic"
},
"population_density_rank": {
"label": "Population density rank",
"type": "string",
"required": false,
"description": "Rank among countries in population density",
"example": "3rd"
},
"FR_metropole_population": {
"label": "FR_metropole_population",
"type": "string",
"required": false,
"deprecated": true
},
"FR_total_population_estimate_year": {
"label": "FR_total_population_estimate_year",
"type": "string",
"deprecated": true
},
"FR_foot": {
"label": "FR_foot",
"type": "string",
"deprecated": true
},
"FR_total_population_estimate": {
"label": "FR_total_population_estimate",
"type": "string",
"deprecated": true
},
"FR_total_population_estimate_rank": {
"label": "FR_total_population_estimate_rank",
"type": "string",
"deprecated": true
},
"FR_metropole_population_estimate_rank": {
"label": "FR_metropole_population_estimate_rank",
"type": "string",
"deprecated": true
},
"FR_foot5": {
"label": "FR_foot5",
"type": "string",
"required": false,
"deprecated": true
},
"GDP_PPP": {
"label": "GDP (PPP)",
"type": "line",
"required": false,
"description": "Gross domestic product (purchasing power parity)",
"example": "$554.855 billion",
"suggested": true
},
"GDP_PPP_year": {
"label": "GDP (PPP) year cited",
"type": "number",
"required": false,
"description": "Year the GDP (PPP) statistic is cited from",
"example": "2018",
"suggested": true
},
"GDP_PPP_rank": {
"label": "GDP (PPP) rank",
"type": "string",
"required": false,
"description": "Rank among countries for GDP PPP",
"example": "39th"
},
"GDP_PPP_per_capita": {
"label": "GDP_PPP_per_capita",
"type": "line",
"required": false,
"description": "Gross domestic product (purchasing power parity) per capita",
"example": "$98,014"
},
"GDP_PPP_per_capita_rank": {
"label": "GDP (PPP) per capita rank",
"type": "line",
"required": false,
"description": "Rank among countries for GDP PPP per capita",
"example": "3rd"
},
"GDP_nominal": {
"label": "GDP (nominal)",
"type": "string",
"required": false,
"description": "Nominal GDP of the country"
},
"GDP_nominal_year": {
"label": "GDP (nominal) year",
"type": "number",
"required": false,
"description": "Year cited for the country's nominal GDP statistic"
},
"GDP_nominal_rank": {
"label": "GDP (nominal) rank",
"type": "string",
"required": false,
"description": "Rank among countries for nominal GDP",
"example": "41st"
},
"GDP_nominal_per_capita": {
"label": "GDP (nominal) per capita",
"type": "string",
"required": false,
"description": "Nominal GDP per capita in the country",
"example": "$61,766"
},
"GDP_nominal_per_capita_rank": {
"label": "GDP (nominal) per capita rank",
"type": "string",
"required": false,
"description": "Rank among countries for nominal GDP per capita",
"example": "8th"
},
"Gini": {
"label": "Gini index",
"type": "number",
"required": false,
"description": "Gini index of the country",
"example": "46.4"
},
"Gini_year": {
"label": "Gini index year cited",
"type": "number",
"required": false,
"description": "Year the gini index statistic is cited for",
"example": "2014"
},
"Gini_change": {
"label": "Gini change",
"type": "string",
"required": false,
"description": "\"increase\" or \"decrease\" (over last year)",
"example": "increase"
},
"Gini_ref": {
"label": "Gini index reference",
"type": "line",
"required": false,
"description": "Reference for cited Gini index statistic"
},
"Gini_rank": {
"label": "Gini rank",
"type": "string",
"required": false,
"description": "Rank of Gini indices",
"example": "30th"
},
"HDI": {
"label": "Human development index",
"type": "number",
"required": false,
"example": "0.932",
"suggested": true,
"description": "The country's human development index (HDI)"
},
"HDI_year": {
"label": "Human Development Index year",
"type": "number",
"required": false,
"description": "Year to which the HDI statistic refers",
"example": "2017",
"suggested": true
},
"HDI_change": {
"label": "HDI change",
"type": "string",
"required": false,
"description": "\"increase\" or \"decrease\" from previous year",
"example": "increase"
},
"HDI_ref": {
"label": "Human Development Index reference",
"type": "line",
"required": false,
"description": "Reference for HDI statistic"
},
"HDI_rank": {
"label": "Human development index rank",
"type": "string",
"required": false,
"description": "Rank among countries for HDI score",
"example": "9th"
},
"currency": {
"label": "Currency",
"type": "line",
"required": false,
"description": "National/official currency name and article link",
"example": "[[Singapore dollar]]"
},
"currency_code": {
"label": "Currency code",
"type": "line",
"required": false,
"description": "Currency code of the official currency",
"example": "SGD"
},
"time_zone": {
"label": "Time zone",
"type": "line",
"required": false,
"description": "National time zone(s)",
"example": "[[Singapore Standard Time|SST]]"
},
"utc_offset": {
"label": "UTC offsets",
"type": "string",
"example": "−4 to −12, +10, +11"
},
"utc_offset_DST": {
"label": "UTF offsets (DST)",
"type": "string",
"example": "−4 to −10"
},
"DST_note": {
"label": "DST note",
"type": "string",
"example": "{{efn|name=\"time\"}}"
},
"time_zone_DST": {
"label": "Time zones (DST)",
"type": "string",
"required": false
},
"DST": {
"label": "Daylight savings time",
"type": "string",
"required": false
},
"antipodes": {
"label": "antipodes",
"type": "string",
"required": false
},
"date_format": {
"label": "Date format",
"type": "string",
"required": false
},
"electricity": {
"label": "Mains electricity",
"type": "string",
"required": false
},
"drives_on": {
"label": "drives on",
"type": "string",
"required": false
},
"rail gauge": {
"label": "Rail gauge",
"type": "string",
"required": false
},
"calling_code": {
"label": "Calling code",
"type": "string",
"example": "+1"
},
"patron_saint": {
"label": "Patron saint",
"aliases": [
"patron_saints"
],
"type": "string",
"required": false
},
"iso3166code": {
"label": "ISO 3166 code",
"type": "string",
"description": "ISO 3166 code for the country",
"example": "US"
},
"cctld": {
"label": "Country code top level domain",
"type": "string",
"example": ".se"
},
"official_website": {
"label": "official_website",
"type": "string",
"required": false,
"description": "For geopolitical entities: do not use government website (e.g. usa.gov) for countries (e.g. [[United States]])."
},
"footnote_a": {
"label": "footnote_a",
"type": "string",
"required": false
},
"footnote_b": {
"label": "footnote_b",
"type": "string",
"required": false
},
"footnote_c": {
"label": "footnote_c",
"type": "string",
"required": false
},
"footnote_d": {
"label": "footnote_d",
"type": "string",
"required": false
},
"footnote_e": {
"label": "footnote_e",
"type": "string",
"required": false
},
"footnote_f": {
"label": "footnote_f",
"type": "string",
"required": false
},
"footnote_g": {
"label": "footnote_g",
"type": "string",
"required": false
},
"footnote_h": {
"label": "footnote_h",
"type": "string",
"required": false
},
"footnote1": {
"label": "footnote1",
"type": "string",
"required": false
},
"footnote2": {
"label": "footnote2",
"type": "string",
"required": false
},
"footnote3": {
"label": "footnote3",
"type": "string",
"required": false
},
"footnote4": {
"label": "footnote4",
"type": "string",
"required": false
},
"footnote5": {
"label": "footnote5",
"type": "string",
"required": false
},
"footnote6": {
"label": "footnote6",
"type": "string",
"required": false
},
"footnote7": {
"label": "footnote7",
"type": "string",
"required": false
},
"footnote8": {
"label": "footnote8",
"type": "string",
"required": false
},
"footnotes": {
"label": "footnotes",
"type": "string",
"required": false
},
"navbar": {
"label": "navbar",
"type": "string",
"required": false
},
"micronation": {},
"status": {
"type": "line"
},
"status_text": {
"type": "line"
},
"empire": {},
"year_end": {
"type": "number"
},
"year_exile_start": {
"type": "number"
},
"year_exile_end": {
"type": "number"
},
"life_span": {
"type": "line"
},
"year_start": {
"type": "number"
},
"flag_size": {
"type": "line"
},
"flag_alt": {
"type": "string"
},
"flag_alt2": {
"type": "string"
},
"flag_type": {
"type": "string"
},
"coa_size": {
"type": "line"
},
"englishmotto": {
"type": "string",
"label": "Motto in English",
"description": "The country's motto translated into English"
},
"image_map_size": {
"type": "line"
},
"image_map_alt": {
"type": "string"
},
"image_map_caption": {
"type": "content"
},
"image_map2_size": {
"type": "line"
},
"image_map2_alt": {
"type": "string"
},
"image_map2_caption": {
"type": "content"
},
"loctext": {
"type": "string"
},
"capital_exile": {
"type": "string"
},
"recognized_languages": {
"aliases": [
"recognised_languages"
],
"type": "content",
"label": "Recognized languages",
"description": "Recognized languages of the country, possibly in list format"
},
"recognized_national_languages": {
"aliases": [
"recognised_national_languages"
],
"type": "content",
"label": "Recognized national languages",
"description": "Recognized national languages of the country, possibly in list format"
},
"recognized_regional_languages": {
"aliases": [
"recognised_regional_languages"
],
"type": "content",
"label": "Recognized regional languages",
"description": "Recognized regional languages of the country, possibly in list format"
},
"common_languages": {
"type": "content",
"label": "Common languages",
"description": "Common languages of the country, possibly in list format",
"example": "{{ublist|[[English language|English]]|[[Spanish language|Spanish]]|[[Chinese language|Chinese]]}}"
},
"religion_year": {
"type": "number",
"label": "Religion statistic year",
"description": "Year the religion statistic is from",
"example": "2015"
},
"leader_title15": {
"type": "line"
},
"leader_name15": {
"type": "line"
},
"title_leader": {
"type": "line",
"label": "Leader's title",
"description": "Title of the country's leader",
"example": "[[President of the United States|President]]"
},
"year_leader1": {
"type": "line",
"label": "Leader 1 years",
"description": "Years the first leader reigned",
"example": "1776-1795"
},
"leader1": {
"type": "line",
"label": "Leader 1",
"description": "The first leader of the country",
"example": "[[George Washington]]"
},
"year_leader2": {
"type": "line"
},
"leader2": {
"type": "line"
},
"year_leader3": {
"type": "line"
},
"leader3": {
"type": "line"
},
"year_leader4": {
"type": "line"
},
"leader4": {
"type": "line"
},
"year_leader5": {
"type": "line"
},
"leader5": {
"type": "line"
},
"year_leader6": {
"type": "line"
},
"leader6": {
"type": "line"
},
"year_leader7": {
"type": "line"
},
"leader7": {
"type": "line"
},
"year_leader8": {
"type": "line"
},
"leader8": {
"type": "line"
},
"year_leader9": {
"type": "line"
},
"leader9": {
"type": "line"
},
"year_leader10": {
"type": "line"
},
"leader10": {
"type": "line"
},
"year_leader11": {
"type": "line",
"label": "Leader 11 years",
"description": "Year of leader 11",
"example": "1980-1987"
},
"leader11": {
"type": "line"
},
"title_representative": {
"type": "line",
"label": "Representative title",
"description": "Title of the country's representative",
"example": "[[Governor General of Canada|Governor General]]"
},
"year_representative1": {
"type": "line",
"label": "Representative 1 years",
"description": "Year of representative 1",
"example": "1492-1506"
},
"representative1": {
"type": "line",
"label": "Representative 1",
"description": "First representative"
},
"year_representative2": {
"type": "line",
"label": "Representative 2 years",
"description": "Year of representative 2",
"example": "1552-1580"
},
"representative2": {
"type": "line"
},
"year_representative3": {
"type": "line",
"label": "Representative 3 years",
"description": "Year of representative 3",
"example": "1652-1666"
},
"representative3": {
"type": "line"
},
"year_representative4": {
"type": "line",
"label": "Representative 4 year",
"description": "Year of representative 4",
"example": "1652-1666"
},
"representative4": {
"type": "line"
},
"year_representative5": {
"type": "line",
"label": "Representative 5 years",
"description": "Year of representative 5",
"example": "1652-1666"
},
"representative5": {
"type": "line"
},
"title_deputy": {
"type": "line"
},
"year_deputy1": {
"type": "line",
"label": "Deputy 1 years",
"description": "Years of the 1st deputy",
"example": "2006-2009"
},
"deputy1": {
"type": "line",
"label": "Deputy 1",
"description": "First deputy"
},
"year_deputy2": {
"type": "line",
"label": "Deputy 2 years",
"description": "Years of the 2nd deputy",
"example": "2009-2011"
},
"deputy2": {
"type": "line"
},
"year_deputy3": {
"type": "line",
"label": "Deputy 3 years",
"description": "Years of the 3rd deputy",
"example": "2011-2013"
},
"deputy3": {
"type": "line"
},
"year_deputy4": {
"type": "line",
"label": "Deputy 4 years",
"description": "Years of the 4th deputy",
"example": "2013-2016"
},
"deputy4": {
"type": "line"
},
"year_deputy5": {
"type": "line",
"label": "Deputy 5 years",
"description": "Years of the 5th deputy",
"example": "2016-2018"
},
"deputy5": {
"type": "line"
},
"year_deputy6": {
"type": "line",
"label": "Deputy 6 years",
"description": "Years of the 6th deputy",
"example": "2018-"
},
"deputy6": {
"type": "line"
},
"type_house1": {
"type": "line"
},
"house1": {
"type": "line"
},
"type_house2": {
"type": "line"
},
"house2": {
"type": "line"
},
"event_pre": {
"type": "line"
},
"established_event13": {
"label": "Establishment event 13",
"type": "line"
},
"established_date13": {
"label": "Establishment date 13",
"type": "date"
},
"established_event14": {
"type": "line"
},
"established_date14": {
"type": "line"
},
"established_event15": {
"type": "line"
},
"established_date15": {
"type": "line"
},
"event_start": {
"label": "Starting event",
"description": "The foundational event of the country",
"example": "Established",
"type": "string"
},
"date_pre": {},
"date_start": {
"label": "Date established",
"description": "Date the country, dynasty or organization was established (date of event_start)",
"example": "601 CE",
"type": "string"
},
"event1": {
"label": "Event 1",
"description": "First significant event",
"example": "Signing of the [[Chanyuan Treaty]] with [[Liao dynasty|Liao]]",
"type": "string"
},
"date_event1": {
"label": "Event 1 date",
"description": "Date of the first significant event",
"example": "601",
"type": "date"
},
"event2": {
"label": "Event 2",
"description": "Second significant event",
"example": "[[Alliance Conducted at Sea|Alliance with Jin]]",
"type": "string"
},
"date_event2": {
"label": "Event 2 date",
"description": "Date of the second significant event",
"type": "string"
},
"event3": {
"label": "Event 3",
"description": "Third significant event",
"example": "[[Jingkang Incident]]",
"type": "string"
},
"date_event3": {},
"event4": {
"label": "Event 4",
"description": "Fourth significant event",
"example": "Beginning of [[Mongol conquest of the Song dynasty|Mongol invasion]]",
"type": "string"
},
"date_event4": {},
"event5": {
"label": "Event 5",
"description": "Fifth significant event",
"example": "Fall of [[Hangzhou|Lin'an]]",
"type": "string"
},
"date_event5": {},
"event6": {
"label": "Event 6",
"description": "Sixth significant event",
"example": "[[Krystallnacht]]",
"type": "string"
},
"date_event6": {},
"event_end": {
"label": "Event ending the country",
"description": "The event that caused the country to stop existing or transition, if applicable",
"example": "[[Battle of Yamen]] (end of dynasty)",
"type": "string"
},
"date_end": {
"label": "End date",
"description": "Date the country stopped existing or transitioned, if applicable",
"example": "1433",
"type": "date"
},
"event_post": {},
"date_post": {},
"area_ha": {},
"area_acre": {},
"area_land_km2": {},
"area_land_ha": {},
"area_land_sq_mi": {},
"area_land_acre": {},
"area_water_km2": {},
"area_water_ha": {},
"area_water_sq_mi": {},
"area_water_acre": {},
"stat_area1": {},
"stat_area2": {},
"stat_area3": {},
"stat_area4": {},
"stat_area5": {},
"area_land_footnote": {},
"area_water_footnote": {},
"stat_year1": {},
"ref_area1": {},
"stat_year2": {},
"ref_area2": {},
"stat_year3": {},
"ref_area3": {},
"stat_year4": {},
"ref_area4": {},
"stat_year5": {
"label": "Statistic 5 year",
"description": "Year of statistic 5",
"example": "1933",
"type": "number"
},
"ref_area5": {},
"stat_pop1": {},
"stat_pop2": {},
"stat_pop3": {},
"stat_pop4": {},
"stat_pop5": {},
"ref_pop1": {},
"ref_pop2": {},
"ref_pop3": {},
"ref_pop4": {},
"ref_pop5": {},
"nummembers": {},
"p1": {},
"s1": {},
"flag_p1": {},
"image_p1": {},
"border_p1": {},
"flag_p2": {},
"image_p2": {},
"p2": {},
"border_p2": {},
"flag_p3": {},
"image_p3": {},
"p3": {},
"border_p3": {},
"flag_p4": {},
"image_p4": {},
"p4": {},
"border_p4": {},
"flag_p5": {},
"image_p5": {},
"p5": {},
"border_p5": {},
"flag_p6": {},
"image_p6": {},
"p6": {},
"border_p6": {},
"flag_p7": {},
"image_p7": {},
"p7": {},
"border_p7": {},
"flag_p8": {},
"image_p8": {},
"p8": {},
"border_p8": {},
"flag_p9": {},
"image_p9": {},
"p9": {},
"border_p9": {},
"flag_p10": {},
"image_p10": {},
"p10": {},
"border_p10": {},
"flag_p11": {},
"image_p11": {},
"p11": {},
"border_p11": {},
"flag_p12": {},
"image_p12": {},
"p12": {},
"border_p12": {},
"flag_p13": {},
"image_p13": {},
"p13": {},
"border_p13": {},
"flag_p14": {},
"image_p14": {},
"p14": {},
"border_p14": {},
"flag_p15": {},
"image_p15": {},
"p15": {},
"border_p15": {},
"flag_s1": {},
"image_s1": {},
"border_s1": {},
"flag_s2": {},
"image_s2": {},
"s2": {},
"border_s2": {},
"flag_s3": {},
"image_s3": {},
"s3": {},
"border_s3": {},
"flag_s4": {},
"image_s4": {},
"s4": {},
"border_s4": {},
"flag_s5": {},
"image_s5": {},
"s5": {},
"border_s5": {},
"flag_s6": {},
"image_s6": {},
"s6": {},
"border_s6": {},
"flag_s7": {},
"image_s7": {},
"s7": {},
"border_s7": {},
"flag_s8": {},
"image_s8": {},
"s8": {},
"border_s8": {},
"flag_s9": {},
"image_s9": {},
"s9": {},
"border_s9": {},
"flag_s10": {},
"image_s10": {},
"s10": {},
"border_s10": {},
"flag_s11": {},
"image_s11": {},
"s11": {},
"border_s11": {},
"flag_s12": {},
"image_s12": {},
"s12": {},
"border_s12": {},
"flag_s13": {},
"image_s13": {},
"s13": {},
"border_s13": {},
"flag_s14": {},
"image_s14": {},
"s14": {},
"border_s14": {},
"flag_s15": {},
"image_s15": {},
"s15": {},
"border_s15": {},
"today": {
"label": "Today part of",
"description": "For former countries, a list of countries of which the former country's territories are now part, if no more than four.",
"example": "{{plainlist| *[[Czech Republic]] *[[Denmark]] *[[France]] *[[Germany]] }}",
"type": "content",
"suggested": true
},
"footnotes2": {},
"symbol_caption": {},
"nested": {}
}
}
</templatedata>
{{cob}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Country infobox templates| ]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
f0add634a25f1dbf63f13654a3f8dbcb354a4b67
Template:Infobox former country
10
117
232
2021-06-06T01:49:08Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox_former_country]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox country]]
{{r from merger}}
d1a087676a1c1fbf80c00fb58bf83cff967f7de4
Template:Infobox geopolitical organization
10
162
322
2021-06-06T01:49:08Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox_geopolitical_organization]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox country]]{{R from alternate name}}
<!-- see Template:Infobox Geopolitical organization -->
4d4892c38a22f1866ca7a29f81ddbc7fc26967f5
Template:Lua
10
62
122
2021-06-06T01:49:09Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Lua]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Lower
10
164
326
2021-06-06T01:49:09Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Lower]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span style="position: relative; top: {{safesubst<noinclude />:#if:{{{2|}}}|{{{1}}}|0.6em}};">{{{2|{{{1}}}}}}</span><noinclude>
{{documentation}}
</noinclude>
8c1373e7c520b1f0a9dd17ea8a02e8922e84bb99
Template:Main other
10
6
10
2021-06-06T01:49:10Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Main_other]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c8e5526da7586aff37928206e183ceef44ed7829
Template:Native name
10
165
328
2021-06-06T01:49:10Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Native_name]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly><!--
Name/Phrase:
-->{{lang |{{{1}}}{{#if:{{{script|}}}|-{{{script}}}|}} |italic={{#switch:{{{italics|{{{italic|}}}}}}|off|no=no|{{{italics|{{{italic|}}}}}}}}|{{{2}}}|template=Native name}}<!--
Language:
-->{{#switch:{{{paren|{{{icon|}}}}}}
|omit|off|no=
|#default= {{#switch:{{{italics|{{{italic|}}}}}} |off|no= |{{#switch:{{{nbsp|}}}|omit|no=| }}}}<!--
--><span class="languageicon" style="font-size:{{{parensize|{{{fontsize|100%}}}}}};font-weight:normal;"><!--
-->{{#if:{{{nolink|}}} |({{#invoke:lang|name_from_tag|{{{1}}}|template=Native name}})
| {{#if:{{#invoke:lang|is_ietf_tag|{{{1}}}}}|({{#invoke:lang|name_from_tag|{{{1}}}|template=Native name|link=yes}}) |(language?)}}<!--
-->}}<!--
--></span><!--
-->}}</includeonly><noinclude>{{Documentation}}</noinclude>
04fed5fe3f20675042a5f062b3bcd72defc1c83d
Template:Native phrase
10
166
330
2021-06-06T01:49:10Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Native_phrase]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#redirect [[Template:Native name]]
561f2c45647b28659d991f0a467779366e7ec49e
Template:Nobold
10
118
234
2021-06-06T01:49:11Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Nobold]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Plainlist
10
108
214
2021-06-06T01:49:12Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Plainlist]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<div class="plainlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cd6b6a5ffb75fb4f0a5b0f4e3a9aabbbf2213353
Template:Pad
10
168
334
2021-06-06T01:49:12Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Pad]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly><span style="padding-left:{{{1|1.0em}}};"> </span></includeonly><noinclude>{{Documentation}}</noinclude>
2599d1d54987c7f7e949b4a843acdb9f1c6af259
Template:Remove first word
10
71
140
2021-06-06T01:49:13Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Remove_first_word]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:Raise
10
169
336
2021-06-06T01:49:13Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Raise]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span style="position:relative; bottom:{{#if:{{{2|}}} |{{{1}}} |0.6em}};">{{{2|{{{1}}}}}}</span><noinclude>{{Documentation}}</noinclude>
da747eda753555e094baeeb84eeca1be020ee399
Template:Resize
10
170
338
2021-06-06T01:49:13Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Resize]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{safesubst<noinclude />:#if:{{{2|}}}
|<span style="font-size:{{{1|}}};">{{{2|}}}</span>
|<span style="font-size:90%;">{{{1}}}</span>
}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
</noinclude>
d8a072f6a053371ba39a7306e2a001d420383b0d
Template:Str left
10
76
150
2021-06-06T01:49:15Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Str_left]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:Smaller
10
116
230
2021-06-06T01:49:15Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Smaller]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span style="font-size:90%;">{{{1}}}</span><noinclude>
{{Documentation|Template:Resize/doc}}
{{/TemplateData}}
</noinclude>
80dc8a92243bfd5e11e2a27670f9d10384234809
Template:Spaces
10
172
342
2021-06-06T01:49:15Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Spaces]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<span class="nowrap">{{#iferror:{{#expr:{{{1|1}}}}}
|{{#switch:{{{1}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}
|{{#invoke:String|rep|{{#switch:{{{2}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}|{{{1|1}}}}}
}}</span><noinclude>
{{documentation}}
</noinclude>
a9ed762825e7579f15dcb9b171b0c1c3bf524b3f
Template:Template link
10
78
154
2021-06-06T01:49:16Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Template_link]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
91be693cd63410db06fc933eddb412ba433564dc
Template:Tl
10
80
158
2021-06-06T01:49:16Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Tl]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
fb9a6b420e13178e581af6e7d64274cd30a79017
Template:URL
10
82
162
2021-06-06T01:49:17Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:URL]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
<includeonly>{{#invoke:URL|url|1={{{1|}}}|2={{{2|}}}}}</includeonly><noinclude>{{documentation}}</noinclude>
60d805865ce290072e475e5fc37e50fb47b7fd11
Template:UF-hcard-place
10
173
344
2021-06-06T01:49:17Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:UF-hcard-place]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
The HTML mark up produced by this template includes an [[HCard|hCard microformat]], which makes the place-name and location [[Parsing|parsable]] by computers, either acting automatically to catalogue article across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to an address book. For more information about the use of [[microformat]]s on Wikipedia, please see [[WP:UF|the microformat project]].
If the place or venue has an "established", "founded", "opened" or similar date that is specific to the day, use {{tl|start date}} [[Wikipedia:WikiProject Microformats/dates|unless the date is before 1583 CE]]. If it has a URL, use {{tl|URL}}.
hCard uses HTML classes including:
{{flatlist/microformat |
* adr
* category
* country-name
* extended-address
* fn
* label
* locality
* nickname
* note
* org
* street-address
* url
* vcard
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<includeonly>{{sandbox other||[[Category:Templates generating hCards]]}}</includeonly><noinclude>
[[Category:Templates generating hCards]]
[[Category:Microformat (uF) message templates]]
</noinclude>
4b191f1687db6dff942a47261bce5bc7c83da0b5
Template:Yesno
10
9
16
2021-06-06T01:49:18Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Yesno]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Template:Yesno-no
10
84
166
2021-06-06T01:49:18Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Yesno-no]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Template:\
10
174
346
2021-06-06T01:49:18Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:\]]: ADDING TEMPLATES. AGAIN
wikitext
text/x-wiki
/ <noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
8cbfbe9d6f2aaa7726dfacfb2ee3c213dae39921
Module:Arguments
828
10
18
2021-06-06T01:49:19Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Arguments]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Collapsible list
828
93
184
2021-06-06T01:49:20Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Collapsible_list]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
-- This module implements {{collapsible list}}
local p = {}
local function gettitlestyletracking( ts )
if not ts then return '' end
ts = mw.ustring.gsub(mw.ustring.lower(ts), '%s', '')
local tsvals = mw.text.split(ts, ';')
table.sort(tsvals)
local skey = table.concat(tsvals,';')
skey = mw.ustring.gsub(skey, '^;', '')
skey = mw.text.encode(mw.text.encode(skey),'%c%[%]=')
if (mw.ustring.match(';' .. ts, ';background:') or mw.ustring.match(';' .. ts, ';background%-color:'))
and mw.ustring.match(';' .. ts, ';text%-align:') then
return '[[Category:Pages using collapsible list with both background and text-align in titlestyle|' .. skey .. ' ]]'
end
return '[[Category:Pages using collapsible list without both background and text-align in titlestyle|' .. skey .. ' ]]'
end
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- Get class, style and title data.
local div1class = formatAttributes( 'class', 'mw-collapsible', not args.expand and 'mw-collapsed' )
local div1style = formatAttributes(
'style',
'text-align: center; font-size: 95%;',
args.frame_style,
args.framestyle
)
local div2class = '' -- no classes, just for the sake of consistency
local div2style = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
'font-size: 105%;',
'text-align: left;',
args.title_style,
args.titlestyle
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
not args.bullets and 'list-style: none none; margin-left: 0;',
args.list_style,
args.liststyle,
not ( args.list_style or args.liststyle ) and 'text-align: left;',
'font-size: 105%; margin-top: 0; margin-bottom: 0; line-height: inherit;'
)
-- Build the list.
return mw.ustring.format(
'<div%s%s>\n<div%s%s>%s</div>\n<ul%s%s>%s</ul>\n</div>',
div1class, div1style, div2class, div2style, title, ulclass, ulstyle, listItems
) .. gettitlestyletracking(args.title_style or args.titlestyle)
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
return buildList( args )
end
return p
67c79401452a13a78084f8a9fd57943cc8391bd8
Module:Coordinates
828
94
186
2021-06-06T01:49:22Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Coordinates]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('Module:No globals')
local math_mod = require("Module:Math")
local coordinates = {};
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = '//tools.wmflabs.org/geohack/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(s, notes)
local l = "[[Geographic coordinate system|Coordinates]]: " .. s
local co = '<span id="coordinates">' .. l .. notes .. '</span>';
return '<span style="font-size: small;">' .. co .. '</span>';
end
--[[ Helper function, Replacement for {{coord/display/inline}} ]]
local function displayinline(s, notes)
return s .. notes
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
local errorHTML = '<strong class="error">Coordinates: ' .. v[2] .. '</strong>'
result = result .. errorHTML .. "<br />"
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "°S"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "°N"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "°W"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "°E"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
return '<span class="plainlinks nourlexpansion">' ..
'[' .. coord_link .. uriComponents .. ' ' .. inner .. ']' .. '</span>'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "°"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}})
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories()
local ret
if mw.wikibase and current_page.namespace == 0 then
local entity = mw.wikibase.getEntityObject()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1] then
local snaktype = entity.claims.P625[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if (not args[1] or not tonumber(args[1])) and not args[2] and mw.wikibase.getEntityObject() then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject()
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1]=entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2]=entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision=-math_mod._round(math.log(precision)/math.log(10),0)
args[1]=math_mod._round(args[1],precision)
args[2]=math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. displayinline(contents, Notes)
end
if isInTitle(Display) then
text = text
.. displaytitle(contents, Notes)
.. makeWikidataCategories()
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates.coord2text(frame)
if frame.args[1] == '' or frame.args[2] == '' or not frame.args[2] then return nil end
frame.args[2] = mw.text.trim(frame.args[2])
if frame.args[2] == 'lat' or frame.args[2] == 'long' then
local result, negative = mw.text.split((mw.ustring.match(frame.args[1],'[%.%d]+°[NS] [%.%d]+°[EW]') or ''), ' ')
if frame.args[2] == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
result = mw.text.split(result, '°')
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(frame.args[1], 'params=.-_'..frame.args[2]..':(.-)[ _]')
end
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | … }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
for i, v in ipairs(frame.args) do
if i ~= 1 then
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3')
frame.args[1] = mw.ustring.gsub(frame.args[1], '(¶ms=[^&"<>%[%] ]*) ', '%1&title=' .. mw.uri.encode(namestr) .. ' ')
end
end
return frame.args[1]
end
return coordinates
1c162f7517e37472db591bc25a076d91cbb416f3
Module:InfoboxImage
828
15
28
2021-06-06T01:49:28Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:InfoboxImage]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
elseif mw.title.getCurrentTitle().namespace == 0 then
return image .. "[[Category:Pages using deprecated image syntax]]";
else
return image;
end
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center= frame.args["center"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
elseif alt ~= "" and alt ~= nil then
result = result .. "|" .. alt;
end
result = result .. "]]";
return result;
end
end
return i;
c6018d106ec773313bcbb1e6e5e9af23ebc87680
Module:Lang/data
828
98
194
2021-06-06T01:49:29Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Lang/data]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
local lang_data = {};
--[[--------------------------< O V E R R I D E >--------------------------------------------------------------
Language codes and names in this table override the BCP47 names in Module:Language/name/data.
code indexes in this table shall always be lower case
]]
local override = {
-- ISO 639-1 codes
["ab"] = {"Abkhazian"}, -- IANA name is Abkhazian; override wp_languages {"Abkhaz"}; to achieve this, use |label=
["bh"] = {"Bihari languages"}, -- only ISO 639-1 collective; defined here to override improper redefinition (Bihari) in wp_languages
["cu"] = {"Church Slavonic"}, -- 2nd IANA name;
["de-at"] = {"Austrian German"}, -- these code-region and code-variant to match en.wiki article names
["de-ch"] = {"Swiss German"},
["en-au"] = {"Australian English"},
["en-ca"] = {"Canadian English"},
["en-emodeng"] = {"Early Modern English"},
["en-gb"] = {"British English"},
["en-ie"] = {"Irish English"},
["en-nz"] = {"New Zealand English"},
["en-us"] = {"American English"},
["en-za"] = {"South African English"},
["fy"] = {"West Frisian"}, -- IANA name is Western Frisian
["ps"] = {"Pashto"}, -- IANA name is Pushto
["si"] = {"Sinhala"}, -- IANA name is Sinhala, Sinhalese; override wp_languages {"Sinhalese"}; see Module talk:Language/data/wp languages#Request to undo an edit
["sr-cyrl"] = {"Serbian"}, -- override wp_languages Serbian Cyrillic; to achieve this, use |label=
-- ISO 639-2, -3 codes
["arc"] = {"Aramaic"}, -- IANA names are: Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE);
["ber"] = {"Berber languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["bla"] = {"Blackfoot"}, -- IANA, ISO 639-2, -3 name is Siksika; to match en.wiki article title
["bua"] = {"Buryat"}, -- IANA name Buriat; this is a macro language; these four use wp preferred transliteration;
["bxm"] = {"Mongolian Buryat"}, -- IANA name Mongolia Buriat; these three all redirect to Buryat
["bxr"] = {"Russian Buryat"}, -- IANA name Russia Buriat;
["bxu"] = {"Chinese Buryat"}, -- IANA name China Buriat;
["byr"] = {"Yipma"}, -- IANA names are Baruya and Yipma
["cel"] = {"Celtic languages"}, -- ISO 639-2 collective; defined here to override improper redefinition ('Proto-Celtic') in wp_languages; use cel-x-proto instead
["egy"] = {"Ancient Egyptian"}, -- IANA name is Egyptian (Ancient); distinguish from contemporary arz: Egyptian Arabic
["frr"] = {"North Frisian"}, -- IANA name is Northern Frisian
["frs"] = {"East Frisian Low Saxon"}, -- IANA name is Eastern Frisian
["gem"] = {"Germanic languages"}, -- ISO 639-2 collective; defined here to override improper redefinition ('Proto-Germanic') in wp_languages; use gem-x-proto instead
["ilo"] = {"Ilocano"}, -- IANA, ISO 639-2, -3 name is Iloko; to match en.wiki article title
["jam"] = {"Jamaican Patois"}, -- IANA name is Jamaican Creole English
["mhr"] = {"Meadow Mari"}, -- IANA name is Eastern Mari
["mid"] = {"Modern Mandaic"}, -- IANA name is Mandaic
["mla"] = {"Tamambo"}, -- wp_languages name is Medieval Latin; IANA and ISO 639-1 name is Malo
["myn"] = {"Mayan languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["nah"] = {"Nahuatl languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["nan-tw"] = {"Taiwanese Hokkien"}, -- make room for IANA / 639-3 nan Min Nan Chinese; match en.wiki article title
["nrf"] = {"Norman"}, -- not quite a collective - IANA name: Jèrriais; categorizes to Norman-language text
["nzi"] = {"Nzema"}, -- IANA, ISO 639-2, -3 name is Nzima; to match en.wiki article title
["orv"] = {"Old East Slavic"}, -- IANA name is Old Russian
["pms"] = {"Piedmontese"}, -- IANA / 639-3 name is Piemontese; to match en.wiki article title
["pra"] = {"Prakrit languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["roa"] = {"Romance languages"}, -- ISO 639-2 collective; defined here to override improper redefinition (Jèrriais) in wp_language; IANA name is "Romance languages"
["sal"] = {"Salishan languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["sla"] = {"Slavic languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["son"] = {"Songhai languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["stq"] = {"Saterland Frisian"}, -- IANA name is Saterfriesisch
["und"] = {"undetermined"}, -- capitalization to match existing category
["wen"] = {"Sorbian languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["wrg"] = {"Warrongo"}, -- IANA name is Warungu
["xal-ru"] = {"Kalmyk"}, -- to match en.wiki article title
-- private use codes
["cel-x-proto"] = {"Proto-Celtic"}, -- cel in IANA is Celtic languages
["gem-x-proto"] = {"Proto-Germanic"}, -- gem in IANA is Germanic languages
["grc-x-aeolic"] = {"Aeolic Greek"}, -- these grc-x-... codes are preferred alternates to the non-standard catchall code grc-gre
["grc-x-attic"] = {"Attic Greek"},
["grc-x-biblical"] = {"Biblical Greek"},
["grc-x-byzant"] = {"Byzantine Greek"},
["grc-x-classic"] = {"Classical Greek"},
["grc-x-doric"] = {"Doric Greek"},
["grc-x-hellen"] = {"Hellenistic Greek"},
["grc-x-ionic"] = {"Ionic Greek"},
["grc-x-koine"] = {"Koinē Greek"},
["grc-x-medieval"] = {"Medieval Greek"},
["grc-x-patris"] = {"Patristic Greek"},
["grk-x-proto"] = {"Proto-Greek"}, -- grk in IANA is Greek languages
["iir-x-proto"] = {"Proto-Indo-Iranian"}, -- iir in IANA is Indo-Iranian Languages
["ira-x-proto"] = {"Proto-Iranian"}, -- ira in IANA is Iranian languages
["itc-x-proto"] = {"Proto-Italic"}, -- itc in IANA is Italic languages
["ksh-x-colog"] = {"Colognian"}, -- en.wiki article is Colognian; ksh (Kölsch) redirects there
["mis-x-ripuar"] = {"Ripuarian"}, -- replaces improper use of ksh in wp_languages
["sla-x-proto"] = {"Proto-Slavic"}, -- sla in IANA is Slavic languages
["yuf-x-hav"] = {"Havasupai"}, -- IANA name for these three is Havasupai-Walapai-Yavapai
["yuf-x-wal"] = {"Walapai"},
["yuf-x-yav"] = {"Yavapai"},
}
--[[--------------------------< A R T I C L E _ L I N K >------------------------------------------------------
for those rare occasions when article titles don't fit with the normal '<language name>-language', this table
maps language code to article title. Use of this table should be avoided and the use of redirects preferred as
that is the long-standing method of handling article names that don't fit with the normal pattern
]]
local article_name = {
["lij"] = {"Ligurian (Romance language)"}, -- see Template_talk:Lang#Ligurian_dab
['mnh'] = {"Mono language (Congo)"}, -- see Template_talk:Lang#Mono_languages
['mnr'] = {"Mono language (California)"},
['mru'] = {"Mono language (Cameroon)"},
['mte'] = {"Mono-Alu language"},
["xlg"] = {"Ligurian language (ancient)"}, -- see Template_talk:Lang#Ligurian_dab
}
--[=[-------------------------< R T L _ S C R I P T S >--------------------------------------------------------
ISO 15924 scripts that are written right-to-left. Data in this table taken from [[ISO 15924#List of codes]]
last update to this list: 2017-12-24
]=]
local rtl_scripts = {
'adlm', 'arab', 'aran', 'armi', 'avst', 'cprt', 'egyd', 'egyh', 'hatr', 'hebr',
'hung', 'inds', 'khar', 'lydi', 'mand', 'mani', 'mend', 'merc', 'mero', 'narb',
'nbat', 'nkoo', 'orkh', 'palm', 'phli', 'phlp', 'phlv', 'phnx', 'prti', 'rohg',
'samr', 'sarb', 'sogd', 'sogo', 'syrc', 'syre', 'syrj', 'syrn', 'thaa', 'wole',
};
--[[--------------------------< T R A N S L I T T I T L E S >------------------------------------------------
This is a table of tables of transliteration standards and the language codes or language scripts that apply to
those standards. This table is used to create the tool-tip text associated with the transliterated text displayed
by some of the {{lang-??}} templates.
These tables are more-or-less copied directly from {{transl}}. The standard 'NO_STD' is a construct to allow for
the cases when no |std= parameter value is provided.
]]
local translit_title_table = {
['ahl'] = {
['default'] = 'Academy of the Hebrew Language transliteration',
},
['ala'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['ala-lc'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['batr'] = {
['default'] = 'Bikdash Arabic Transliteration Rules',
},
['bgn/pcgn'] = {
['default'] = 'Board on Geographic Names / Permanent Committee on Geographical Names transliteration',
},
['din'] = {
['ar'] = 'DIN 31635 Arabic',
['fa'] = 'DIN 31635 Arabic',
['ku'] = 'DIN 31635 Arabic',
['ps'] = 'DIN 31635 Arabic',
['tg'] = 'DIN 31635 Arabic',
['ug'] = 'DIN 31635 Arabic',
['ur'] = 'DIN 31635 Arabic',
['arab'] = 'DIN 31635 Arabic',
['default'] = 'DIN transliteration',
},
['eae'] = {
['default'] = 'Encyclopaedia Aethiopica transliteration',
},
['hepburn'] = {
['default'] = 'Hepburn transliteration',
},
['iast'] = {
['default'] = 'International Alphabet of Sanskrit transliteration',
},
['iso'] = { -- when a transliteration standard is supplied
['ab'] = 'ISO 9 Cyrillic',
['ba'] = 'ISO 9 Cyrillic',
['be'] = 'ISO 9 Cyrillic',
['bg'] = 'ISO 9 Cyrillic',
['kk'] = 'ISO 9 Cyrillic',
['ky'] = 'ISO 9 Cyrillic',
['mn'] = 'ISO 9 Cyrillic',
['ru'] = 'ISO 9 Cyrillic',
['tg'] = 'ISO 9 Cyrillic',
['uk'] = 'ISO 9 Cyrillic',
['bua'] = 'ISO 9 Cyrillic',
['sah'] = 'ISO 9 Cyrillic',
['tut'] = 'ISO 9 Cyrillic',
['xal'] = 'ISO 9 Cyrillic',
['cyrl'] = 'ISO 9 Cyrillic',
['ar'] = 'ISO 233 Arabic',
['ku'] = 'ISO 233 Arabic',
['ps'] = 'ISO 233 Arabic',
['ug'] = 'ISO 233 Arabic',
['ur'] = 'ISO 233 Arabic',
['arab'] = 'ISO 233 Arabic',
['he'] = 'ISO 259 Hebrew',
['yi'] = 'ISO 259 Hebrew',
['hebr'] = 'ISO 259 Hebrew',
['el'] = 'ISO 843 Greek',
['grc'] = 'ISO 843 Greek',
['ja'] = 'ISO 3602 Japanese',
['hira'] = 'ISO 3602 Japanese',
['hrkt'] = 'ISO 3602 Japanese',
['jpan'] = 'ISO 3602 Japanese',
['kana'] = 'ISO 3602 Japanese',
['zh'] = 'ISO 7098 Chinese',
['chi'] = 'ISO 7098 Chinese',
['pny'] = 'ISO 7098 Chinese',
['zho'] = 'ISO 7098 Chinese',
-- ['han'] = 'ISO 7098 Chinese', -- unicode alias of Hani? doesn't belong here? should be Hani?
['hans'] = 'ISO 7098 Chinese',
['hant'] = 'ISO 7098 Chinese',
['ka'] = 'ISO 9984 Georgian',
['kat'] = 'ISO 9984 Georgian',
['arm'] = 'ISO 9985 Armenian',
['hy'] = 'ISO 9985 Armenian',
['th'] = 'ISO 11940 Thai',
['tha'] = 'ISO 11940 Thai',
['ko'] = 'ISO 11941 Korean',
['kor'] = 'ISO 11941 Korean',
['bn'] = 'ISO 15919 Indic',
['dra'] = 'ISO 15919 Indic',
['gu'] = 'ISO 15919 Indic',
['hi'] = 'ISO 15919 Indic',
['inc'] = 'ISO 15919 Indic',
['kn'] = 'ISO 15919 Indic',
['ml'] = 'ISO 15919 Indic',
['mr'] = 'ISO 15919 Indic',
['sa'] = 'ISO 15919 Indic',
['ta'] = 'ISO 15919 Indic',
['te'] = 'ISO 15919 Indic',
['beng'] = 'ISO 15919 Indic',
['brah'] = 'ISO 15919 Indic',
['deva'] = 'ISO 15919 Indic',
['default'] = 'ISO transliteration',
},
['mr'] = {
['default'] = 'McCune–Reischauer transliteration',
},
['nihon-shiki'] = {
['default'] = 'Nihon-shiki transliteration',
},
['no_std'] = { -- when no transliteration standard is supplied
['akk'] = 'Semitic transliteration',
['sem'] = 'Semitic transliteration',
['phnx'] = 'Semitic transliteration',
['xsux'] = 'Cuneiform transliteration',
},
['pinyin'] = {
['default'] = 'Pinyin transliteration',
},
['rr'] = {
['default'] = 'Revised Romanization of Korean transliteration',
},
['rtgs'] = {
['default'] = 'Royal Thai General System of Transcription',
},
['satts'] = {
['default'] = 'Standard Arabic Technical Transliteration System transliteration',
},
['ungegn'] = {
['default'] = 'United Nations Group of Experts on Geographical Names transliteration',
},
['wehr'] = {
['default'] = 'Hans Wehr transliteration',
},
};
return
{
override = override,
article_name = article_name,
rtl_scripts = rtl_scripts,
is_rtl_script = is_rtl_script,
translit_title_table = translit_title_table,
};
e924d3608871be8cc6736961960ec7f51586bc33
Module:Math
828
102
202
2021-06-06T01:49:31Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Math]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
orig_precision = p._precision(value_string)
if order + orig_precision >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
dd7cebda2e11c3484347fe3cde5b36ae515187f9
Module:No globals
828
20
38
2021-06-06T01:49:32Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:No_globals]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
8ce3969f7d53b08bd00dabe4cc9780bc6afd412a
Module:URL
828
104
206
2021-06-06T01:49:34Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:URL]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
--
-- This module implements {{URL}}
--
-- See unit tests at [[Module:URL/tests]]
local p = {}
local function safeUri(s)
local success, uri = pcall(function()
return mw.uri.new(s)
end)
if success then
return uri
end
end
function p._url(url, text)
url = mw.text.trim(url or '')
text = mw.text.trim(text or '')
if url == '' then
if text == '' then
return mw.getCurrentFrame():expandTemplate{ title = 'tlx', args = { 'URL', "''example.com''", "''optional display text''" } }
else
return text
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error
url = mw.ustring.gsub(url, '#$', '')
url = mw.ustring.gsub(url, '%?$', '')
-- If it's an HTTP[S] URL without the double slash, fix it.
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
-- Handle URLs from Wikidata of the format http://
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?)://', 'http%1://')
local uri = safeUri(url)
-- Handle URL's without a protocol and URL's that are protocol-relative,
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = 'http://' .. url
uri = safeUri(url)
end
if text == '' then
if uri then
if uri.path == '/' then uri.path = '' end
local port = ''
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. (uri.relativePath or '')
-- Add <wbr> before _/.-# sequences
text = mw.ustring.gsub(text,"(/+)","<wbr/>%1") -- This entry MUST be the first. "<wbr/>" has a "/" in it, you know.
text = mw.ustring.gsub(text,"(%.+)","<wbr/>%1")
-- text = mw.ustring.gsub(text,"(%-+)","<wbr/>%1") -- DISABLED for now
text = mw.ustring.gsub(text,"(%#+)","<wbr/>%1")
text = mw.ustring.gsub(text,"(_+)","<wbr/>%1")
else -- URL is badly-formed, so just display whatever was passed in
text = url
end
end
return mw.ustring.format('<span class="url">[%s %s]</span>', url, text)
end
function p.url(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args;
local url = templateArgs[1] or parentArgs[1] or ''
local text = templateArgs[2] or parentArgs[2]
if not text then
url = url or extractUrl(templateArgs) or extractUrl(parentArgs);
end
text = text or ''
return p._url(url, text)
end
function extractUrl(args)
for name, val in pairs(args) do
local url = name .. "=" .. val;
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url);
if uri and uri.host then
return url
end
end
end
return p
2539ef10e49d4590a83b652588529e0ac2349b1d
Module:Yesno
828
21
40
2021-06-06T01:49:35Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Yesno]]: ADDING TEMPLATES. AGAIN
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Template:Infobox military conflict
10
228
454
2021-06-06T02:03:48Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox_military_conflict]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Infobox military conflict|main}}</includeonly><noinclude>{{documentation}}</noinclude>
d340eca466eb5d0a69c1f4ac57d0f34d306ed031
Template:Abbr
10
274
546
2021-06-06T02:03:48Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Abbr]]
wikitext
text/x-wiki
<abbr {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} title="{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|"|"}}}}">{{{1|}}}</abbr><noinclude>{{Documentation}}
</noinclude>
5fd53aa19ba927ce3eea9092a4fa31f881df0a6e
Template:Big
10
275
548
2021-06-06T02:03:49Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Big]]
wikitext
text/x-wiki
<span style="font-size: 120%;">{{{1}}}</span><noinclude>
{{Documentation}}
<!-- Please add categories to the /doc subpage; interwikis go to Wikidata, thank you. -->
</noinclude>
921a29fc5d6c9a23b246400fe247ba4f2e0f2aaf
Template:Blue
10
276
550
2021-06-06T02:03:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Blue]]
wikitext
text/x-wiki
<span style="color:blue">{{{1}}}</span><noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}</noinclude>
89f3353953a76d63c4ba5cd23af400b64ef178f4
Template:Campaign/doc
10
277
552
2021-06-06T02:03:51Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Campaign/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Campaignbox/doc]]
96204735bd25c964b25be72f9fe56c67b3302279
Template:Campaignbox
10
278
554
2021-06-06T02:03:52Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Campaignbox]]
wikitext
text/x-wiki
<includeonly>{{Military navigation
|name = {{#if:{{{raw_name|}}} |{{{raw_name|}}} |{{#if:{{{title|}}} |{{{name|}}} |}} }}
|state = {{{state|}}}
|border = {{{border|}}}
|title = <span style="line-height:1.6em">{{#if:{{{title|}}}|{{{title}}}|{{{name}}}}}</span>
|bodyclass = {{{bodyclass|}}}
|listclass = {{{listclass|}}}
|list1 = {{{battles|}}}
|below = {{{notes|}}}
}}{{#ifeq:{{NAMESPACE}}|Template|[[Category:Campaignbox templates]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
bd5acf07aa1526d63d10975ff20fe9d70de2f838
Template:Campaignbox/doc
10
279
556
2021-06-06T02:03:52Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Campaignbox/doc]]
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes |
| {{Documentation subpage}}
== Usage ==
}}
{{#switch:{{ARTICLESPACE}}
| Wikipedia =
====Campaignboxes====
| #default =
===Campaignboxes===
}}
One common type of navigational template in articles concerning conflicts, wars and related topics is the '''campaignbox''' template, intended to provide context and convenient navigation among articles on the [[battles]] in a [[Military campaign|campaign]], [[Front (military)|front]], [[Theater (warfare)|theater]] or [[war]] (or, more rarely, among several campaigns or wars).
<div style="float:right;width:26.7em;margin-bottom:1.0em;">
{{Campaignbox Second Punic War}}
{{Campaignbox Punic Wars}}
</div>
If the article includes an [[Help:Infobox|infobox]], the campaignbox/es are usually placed immediately after it (i.e. just below it). If available, as with infoboxes such as {{tl|Infobox military conflict}}, use the infobox's {{para|campaignbox}} parameter:
<div style="width:25.0em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<pre>
{{Infobox military conflict
...
}}
{{Campaignbox XXXX}}
</pre>or<pre>
{{Infobox military conflict
...
| campaignbox = {{campaignbox XXXX}}
}}
</pre></div>
Articles may include multiple campaignboxes; typically, these are stacked under the infobox. The most common scenario occurs when two levels of campaignboxes are present – for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater or war during which the battle took place. Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.
=== Creating campaignboxes ===
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|Campaignbox template category]] to which campaignboxes are added automatically. If a new campaignbox becomes necessary, it should be named ''Template:Campaignbox XXXX'' (where XXXX is the (shortened) name of the campaign) and should use {{tlf|Campaignbox}} thus:
<div style="width:16.7em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<pre>
{{Campaignbox
| name =
| title =
| battles =
| notes =
}}
</pre>
</div>
==== Parameters ====
; ''name'' : The name by which Wikipedia refers to the template, i.e. "Template:Campaignbox XXXX". This can be produced by using <code><nowiki>{{subst:PAGENAME}}</nowiki></code>.
; ''title'' : The name of the campaign or war, which, if an article about the campaign or war exists, should link to it. Dates should not be indicated unless needed for clarity. Note that long links may cause alignment problems; see [[WP:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for more information.
; ''battles'' : A chronological list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>. A convenient and accessible way to separate the items in the list is to add <code>| listclass = hlist</code> and then use the standard <kbd>*</kbd> (asterisk)-based [[Help:List|listing format]].
; ''notes'' : (optional) Any explanatory notes needed to clarify the list. This option should be used sparingly.
; (''raw_name'') : (optional; deprecated) This parameter overrides the use of the title in determining the template name and exists for the sake of backward compatibility. When creating a new campaignbox, both title and name should be specified as above and this parameter omitted.
The following optional parameters are passed on to the templates {{tl|Military navigation}} or {{tl|Navbox}} used to create campaignboxes and so can affect their styling. See these two templates' documentation pages for further details.
; ''state'' : To set whether the campaignbox appears fully visible or collapsed (to titlebar only) when it is first presented by a page.
; ''bodyclass'' : CSS styling to affect the whole template.
; ''listclass'' : CSS styling to affect the list of battles, operations, etc. (e.g. to affect {{para|battles}}).
The use of special formatting (such as bolding or changes in font size) in the list of battles{{spaced ndash}}particularly to mark battles as "important"{{spaced ndash}}is generally discouraged; while there are a ''few'' cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are usually both unnecessary and potentially confusing. Similarly, dividing the list of battles into multiple blocks by inserting heading-like separations should be exceptional; if such a division is felt to be needed, a better solution may be to split the one campaignbox into two or more.<noinclude>
[[Category:WikiProject Military history template instructions|Campaignbox]]
</noinclude><includeonly>{{Sandbox other||
[[Category:Campaignbox templates| ]]
[[Category:Exclude in print]]
{{#ifeq:{{{noheader|}}}|yes | |
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes|Campaignbox]]
[[Category:Templates that add a category]]
}}}}</includeonly>
4e121140866d6bb53b2bff8342df0cb90c170bd6
Template:Campaignbox Punic Wars
10
280
558
2021-06-06T02:03:53Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Campaignbox_Punic_Wars]]
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Punic Wars
| title = [[Punic Wars]]
| listclass = hlist
| battles =
* [[First Punic War|First]]
* [[Mercenary War|Mercenary]]
* [[Second Punic War|Second]]
* [[Third Punic War|Third]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Punic wars]]
</noinclude>
68f988c5de0f66decd657e0721bfd60f1b4c7798
Template:Campaignbox Second Punic War
10
281
560
2021-06-06T02:03:53Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Campaignbox_Second_Punic_War]]
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Second Punic War
| title = [[Second Punic War|{{Wrap|Second Punic War}}]]
| listclass = hlist
| battles =
; Prelude
* [[Siege of Saguntum|Saguntum]]
* [[Battle of Rhone Crossing|Rhone]]
* [[Hannibal's crossing of the Alps|Crossing of the Alps]]
; Italy
* [[Battle of Ticinus|Ticinus]]
* [[Battle of the Trebia|Trebia]]
* [[Siege of Mutina (218 BC)|Mutina]]
* [[Battle of Placentia (217 BC)|Placentia]]
* [[Battle of Victumulae|Victumulae]]
* [[Battle of Lake Trasimene|Lake Trasimene]]
* [[Battle of Umbrian Lake|Umbrian Lake]]
* [[Hannibal's crossing of the Apennines|Crossing of the Apennines]]
* [[Battle of Ager Falernus|Ager Falernus]]
* [[Battle of Geronium|Geronium]]
* [[Battle of Cannae|Cannae]]
* [[Battle of Silva Litana|Silva Litana]]
* [[Battle of Nola (216 BC)|1st Nola]]
* [[Siege of Nuceria Alfaterna|Nuceria Alfaterna]]
* [[Siege of Casilinum (216–215 BC)|1st Casilinum]]
* [[Battle of Hamae|Hamae]]
* [[Siege of Petelia|1st Petelia]]
* [[Battle of Cumae (215 BC)|Cumae]]
* [[Battle of Nola (215 BC)|2nd Nola]]
* [[Battle of Beneventum (214 BC)|1st Beneventum]]
* [[Battle of Nola (214 BC)|3rd Nola]]
* [[Siege of Casilinum (214 BC)|2nd Casilinum]]
* [[Battle of Lucania|Lucania]]
* [[Siege of Arpi|Arpi]]
* [[Battle of Tarentum (212 BC)|1st Tarentum]]
* [[Battle of Beneventum (212 BC)|2nd Beneventum]]
* [[Battle of Campi Veteres|Campi Veteres]]
* [[Battle of Capua|1st Capua]]
* [[Battle of the Silarus|Silarus]]
* [[Battle of Herdonia (212 BC)|1st Herdonia]]
* [[Siege of Capua (211 BC)|2nd Capua]]
* [[Hannibal's raid to Rome|Rome]]
* [[Battle of Sapriportis|Sapriportis]]
* [[Battle of Herdonia (210 BC)|2nd Herdonia]]
* [[Battle of Numistro|Numistro]]
* [[Battle of Canusium|Canusium]]
* [[Siege of Manduria|Manduria]]
* [[Siege of Caulonia|Caulonia]]
* [[Battle of Tarentum (209 BC)|2nd Tarentum]]
* [[Battle of Locri (208 BC)|Locri]]
* [[Battle of Petelia|2nd Petelia]]
* [[Battle of Venusia|Venusia]]
* [[Battle of Grumentum|Grumentum]]
* [[Battle of the Metaurus|Metaurus]]
* [[Battle of Crotona|Crotona]]
* [[Battle of Insubria|Insubria]]
; Iberia
* [[Battle of Cissa|Cissa]]
* [[Battle of Ebro River|Ebro River]]
* [[Battle of Ibera|Ibera]]
* [[Siege of Illiturgis|Illiturgis]]
* [[Battle of Munda (214 BC)|Munda]]
* [[Battle of Orongi|Orongi]]
* [[Battle of the Upper Baetis|Upper Baetis]]
* [[Battle of Cartagena (209 BC)|1st New Carthage]]
* [[Battle of Baria|Baria]]
* [[Battle of Baecula|Baecula]]
* [[Battle of Carmona|Carmona]]
* [[Battle of Ilipa|Ilipa]]
* [[Mutiny at Sucro|Sucro]]
* [[Battle of Carteia|1st Carteia]]
* [[Battle of Carteia (naval)|2nd Carteia]]
* [[Battle of Cartagena (206 BC)|2nd New Carthage]]
; Sicily and Sardinia
* [[Battle of Lilybaeum|Lilybaeum]]
* [[Capture of Malta (218 BC)|Malta]]
* [[Battle of Decimomannu|Decimomannu]]
* [[Battle of Leontini|Leontini]]
* [[Siege of Syracuse (213–212 BC)|Syracuse]]
* [[Battle of Himera (211 BC)|Himera]]
* [[Siege of Agrigentum (210 BC)|Agrigentum]]
; North Africa
* [[Battle of Clupea|Clupea]]
* [[Siege of Utica (204 BC)|1st Utica]]
* [[Battle of Utica (203 BC)|2nd Utica]]
* [[Battle of the Great Plains|Great Plains (Bagradas)]]
* [[Battle of Cirta|Cirta]]
* [[Battle of Zama|Zama]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Second Punic War]]
[[Category:Ancient Rome campaignbox templates|Campaign]]
</noinclude>
da197d04be3bb328fd8ec7bd3e37e2254141a9b3
Template:Convert to use Infobox
10
282
562
2021-06-06T02:03:56Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Convert_to_use_Infobox]]
wikitext
text/x-wiki
{{Ombox
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| small = {{{small|}}}
| type = style
| image = [[File:Template-info.png|45px|]]
| text = This template may be suitable for conversion to use {{Tl|Infobox}} as a base.
}}<includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:10}}|{{When on basepage|[[Category:Templates suitable for conversion to use Template:Infobox]]}}}}</includeonly><noinclude>
{{documentation}}</noinclude>
f990edfd50e312fc7c407de1328dd09c0b1fe41b
Template:Country data Electorate of Saxony
10
283
564
2021-06-06T02:03:56Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Electorate_of_Saxony]]
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Electorate of Saxony
| shortname alias = Saxony
| flag alias = Flag of Electoral Saxony.svg
| size = {{{size|}}}
| name = {{{name|}}}
<noinclude>
| related1 = Kingdom of Saxony
| related2 = Saxony
| cat = Saxony electorate
</noinclude>
}}
92d992249b05224909f6fc125f5b07f9889af451
Template:Country data Holy Roman Empire
10
284
566
2021-06-06T02:03:57Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Country_data_Holy_Roman_Empire]]
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Holy Roman Empire
| flag alias = Banner of the Holy Roman Emperor (after 1400).svg
| flag alias-1200 = Flag of the Holy Roman Empire (1200-1350).svg
| flag alias-old = Heiliges Römisches Reich - Reichssturmfahne vor 1433.svg
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1200
| var2 = old
</noinclude>
}}
c24cc53598b544658ee4420e6aa0370eca6c4d78
Template:DOW
10
285
568
2021-06-06T02:03:58Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:DOW]]
wikitext
text/x-wiki
[[Killed in action|({{abbr|DOW|Died of wounds}})]]<noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}
</noinclude>
945cfa24d42c2b4cb9ad9be625edaad13a09b10c
Template:Dummy reference
10
286
570
2021-06-06T02:03:59Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Dummy_reference]]
wikitext
text/x-wiki
<sup class="reference nowrap ltr" style="color:#002bb8;">[{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|<span style="font-style:italic">}}{{#if:{{{txtcol|}}}|<span style="color:{{{txtcol|}}}">}}{{{1|1}}}{{#if:{{{txtcol|}}}|</span>}}{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|</span>}}]</sup><noinclude>
{{documentation}}
</noinclude>
7be6798eb28af3f887fa775b50dc87e0c575cde9
Template:Flag
10
46
90
2021-06-06T02:04:00Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flag]]
wikitext
text/x-wiki
{{country data {{{1|}}}|flag/core|name={{{name|{{{1|}}}}}}|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude>{{documentation}}{{En-WP attribution notice|Template:Flag}}</noinclude>
a8b9f59a7a7b787931b414e617f8dc54670afc59
Template:Fakeref
10
287
572
2021-06-06T02:04:00Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Fakeref]]
wikitext
text/x-wiki
#REDIRECT [[Template:Dummy reference]]
c85c391fe2de3ebfd2154c56303a2085c57e9dd2
Template:Flag/core
10
47
92
2021-06-06T02:04:01Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flag/core]]
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|23x15px}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] {{#ifeq:{{{size}}}|23x16px| }}{{#ifeq:{{{alias}}}|Nepal| }}</span>[[{{{alias}}}|{{{name}}}]]<noinclude>{{documentation}}</noinclude>
c8210dc8b9b4298a5c5ed98d56ddb436db5e7688
Template:Flagicon image
10
288
574
2021-06-06T02:04:03Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Flagicon_image]]
wikitext
text/x-wiki
<span class="flagicon">[[File:{{#if:{{{1|}}}|{{{1}}}|Flag placeholder.svg}}|{{{size|23x15px}}}|{{{border|{{#if:{{{1|}}}|border}}}}} |alt=|link={{{link|}}}]]</span><noinclude>{{documentation}}</noinclude>
057d0b94a9367359ad010c3da1fcdcb1e880dcb5
Template:Infobox military operation
10
291
580
2021-06-06T02:04:07Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox_military_operation]]
wikitext
text/x-wiki
{{infobox
|bodyclass = vevent
|bodystyle = {{WPMILHIST Infobox style|main_box_raw}}
|abovestyle = {{WPMILHIST Infobox style|header_raw}}
|aboveclass = summary
| headerstyle = {{WPMILHIST Infobox style|header_raw}}
|above = {{if empty|{{{title|}}}|{{{name|}}}|{{PAGENAMEBASE}}}}
|subheaderstyle = {{WPMILHIST Infobox style|sub_header_raw}}
|subheader = {{br separated entries|{{{subtitle|}}}|{{#if:{{{partof|}}}{{{conflict|}}}|Part of {{if empty|{{{conflict|}}}|{{{partof|}}}}} }}}}
|labelstyle = padding-right: 1em;
|imagestyle = {{WPMILHIST Infobox style|image_box_raw}}
|image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|upright={{{image_upright|1}}}|alt={{{alt|}}}}}
|caption = {{{caption|}}}
| label1 = {{#if:{{{scope|}}}|Operational scope|Type}}
| data1 = {{if empty|{{{scope|}}}|{{{type|}}}}}
| label2 = Location{{#if:{{{location2|}}}|s}}
| data2 = {{br separated entries
|1 = {{#if:{{{location|{{{place|}}}}}}|<div style="display:inline;" class="location">{{{location|{{{place|}}}}}}</div>}}
|2 = {{{coordinates|}}}
|3 = {{#if:{{{location2|}}}|<div style="display:inline;" class="location">{{{location2|}}}</div>}}
|4 = {{#if:{{{location2|}}}|{{{coordinates2|}}}</div>}}
|5 = {{#if:{{{location3|}}}|<div style="display:inline;" class="location">{{{location3|}}}</div>}}
|6 = {{#if:{{{location3|}}}|{{{coordinates3|}}}</div>}}
|7 = {{#if:{{{location4|}}}|<div style="display:inline;" class="location">{{{location4|}}}</div>}}
|8 = {{#if:{{{location4|}}}|{{{coordinates4|}}}</div>}}
|9 = {{#if:{{{location5|}}}|<div style="display:inline;" class="location">{{{location5|}}}</div>}}
|10= {{#if:{{{location5|}}}|{{{coordinates5|}}}</div>}}
|11= {{#if:{{{location6|}}}|<div style="display:inline;" class="location">{{{location6|}}}</div>}}
|12= {{#if:{{{location6|}}}|{{{coordinates6|}}}</div>}}
|13= {{#if:{{{location7|}}}|<div style="display:inline;" class="location">{{{location7|}}}</div>}}
|14= {{#if:{{{location7|}}}|{{{coordinates7|}}}</div>}}
|15= {{#if:{{{location8|}}}|<div style="display:inline;" class="location">{{{location8|}}}</div>}}
|16= {{#if:{{{location8|}}}|{{{coordinates8|}}}</div>}}
|17= {{#if:{{{location9|}}}|<div style="display:inline;" class="location">{{{location9|}}}</div>}}
|18= {{#if:{{{location9|}}}|{{{coordinates9|}}}</div>}}
|19= {{#if:{{{location10|}}}|<div style="display:inline;" class="location">{{{location10|}}}</div>}}
|20= {{#if:{{{location10|}}}|{{{coordinates10|}}}</div>}}
}}
| label3 = Planned
| data3 = {{{planned|}}}
| label4 = Planned by
| data4 = {{{planned_by|}}}
| label5 = Commanded by
| data5 = {{{commanded_by|}}}
| label6 = {{#if:{{{target|}}}|Target|Objective}}
| data6 = {{if empty|{{{target|}}}|{{{objective|}}}}}
| label7 = Date
| data7 = {{br separated entries
|1 = {{if empty|{{{executed|}}}|{{{date|}}}}}
|2 = {{{time|}}}
|3 = {{#if:{{{time-begin|}}}|{{{time-begin}}} – {{{time-end|}}}}}
}} {{#if:{{{timezone|}}}|({{{timezone}}})}}
| label8 = Executed by
| data8 = {{if empty|{{{instigator|}}}|{{{executed_by|}}}}}
| label9 = Outcome
| data9 = {{{outcome|}}}
| label10 = Casualties
| data10 = {{if empty|{{{casualties|}}}|{{br separated entries
|1 = {{#if:{{{fatalities|}}}|{{{fatalities|}}} killed}}
|2 = {{#if:{{{injuries|}}}|{{{injuries|}}} injured}}
}} }}
| header27 = {{#if:{{{map_type|}}}|<nowiki />}}
| data28 = {{#if:{{{map_type|}}}|
{{#if:{{{coordinates2|}}}|
{{Location map many|{{{map_type}}}|coordinates1={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label1={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}}
|coordinates2={{{coordinates2|}}}|label2={{{map_label2|}}}
{{#if:{{{coordinates3|}}}|{{!}}coordinates3={{{coordinates3|}}}{{!}}label3={{{map_label3|}}} }}
{{#if:{{{coordinates4|}}}|{{!}}coordinates4={{{coordinates4|}}}{{!}}label4={{{map_label4|}}} }}
{{#if:{{{coordinates5|}}}|{{!}}coordinates5={{{coordinates5|}}}{{!}}label5={{{map_label5|}}} }}
{{#if:{{{coordinates6|}}}|{{!}}coordinates6={{{coordinates6|}}}{{!}}label6={{{map_label6|}}} }}
{{#if:{{{coordinates7|}}}|{{!}}coordinates7={{{coordinates7|}}}{{!}}label7={{{map_label7|}}} }}
{{#if:{{{coordinates8|}}}|{{!}}coordinates8={{{coordinates8|}}}{{!}}label8={{{map_label8|}}} }}
{{#if:{{{coordinates9|}}}|{{!}}coordinates9={{{coordinates9|}}}{{!}}label9={{{map_label9|}}} }}
{{#if:{{{coordinates10|}}}|{{!}}coordinates10={{{coordinates10|}}}{{!}}label10={{{map_label10|}}} }}
}}
|{{Location map|{{{map_type}}}|coordinates={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}} }}
}}
}}
}}{{{campaignbox|}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox military operation with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox military operation]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | campaignbox | caption | casualties | commanded_by | conflict | coordinates | date | executed | executed_by | fatalities | image | image_size | image_upright | injuries | instigator | location | map_caption | map_coord | map_label | map_size | map_type | name | objective | outcome | partof | planned | planned_by | scope | target | time | time-begin | time-end | timezone | title | type | coordinates2 | coordinates3 | coordinates4 | coordinates5 | coordinates6 | coordinates7 | coordinates8 | coordinates9 | coordinates10 | map_label2 | map_label3 | map_label4 | map_label5 | map_label6 | map_label7 | map_label8 | map_label9 | map_label10 | location2 | location3 | location4 | location5 | location6 | location7 | location8 | location9 | location10 }}<noinclude>
{{template doc}}
</noinclude>
42edcbcfd7a943e543c35cd3640094e83b834ddc
Template:Infobox military operation/doc
10
292
582
2021-06-06T02:04:09Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Infobox_military_operation/doc]]
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
}}
This infobox may be used to describe a particular planned or executed military operation or attack. For operations that resulted in combat, it can be used as an auxiliary template to the {{tl|infobox military conflict}}, if necessary; for other types of operations, including those that were planned but never executed, it may be used alone. In the case of conflicts that consisted of multiple independent operations, multiple copies of the box may be used on a single article.
__TOC__
=== Usage ===
{{Parameter names example|_template = Infobox military operation |title |name |partof |conflict |image |image_size |image_upright |alt |caption |coordinates = {{coord|0|0}} |map_type=Earth |map_size= |map_label |map_caption |scope |type |location |coordinates |planned |planned_by |commanded_by |target |objective |date |time |time-begin |time-end |timezone |executed_by |outcome |casualties |fatalities |injuries}}
<pre style="overflow:auto;">
{{Infobox military operation
|name = Eastern European War
|partof = War on Communism
|subtitle =
|image =
|image_upright =
|alt =
|caption =
|scope =
|type =
|location =
|location2 = <!-- 2 through 10 for more locations -->
|coordinates =
|coordinates2 = <!-- 2 through 10 for more locations -->
|map_type =
|map_size =
|map_caption =
|map_label =
|map_label2 = <!-- 2 through 10 for more locations -->
|planned =
|planned_by =
|commanded_by =
|objective =
|target =
|date = <!-- {{start date|YYYY|MM|DD|df=y}} -->
|time =
|time-begin =
|time-end =
|timezone =
|executed_by =
|outcome =
|casualties =
|fatalities =
|injuries =
}}</pre>
=== Example ===
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}
<pre style="overflow:auto;">
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}</pre>
=== Parameters ===
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''name''' – the name of the operational plan; names in multiple languages may be provided.
* '''subtitle''' – alternative name of the conflict being described.
* '''partof''' – ''optional'' – the larger conflict containing the event described in the article.
* '''image''' – ''optional'' – an image for the warbox. Given in the form <code>File:Example.jpg</code>
* '''image_upright''' – ''optional'' – image upright scaling factor.
* '''alt''' – ''optional'' – [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' – ''optional'' – the text to be placed below the image.
* '''location''' – ''optional'' – the location of the operation.
* '''coordinates''' – ''optional'' – the coordinates for the location above, given as {{tl|coord}} with ''|display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter. If coordinates for several locations are given, consider if hany shall have the title display.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''scope''' – ''optional'' – the scope of the operation, such as "Strategic", "Operational", or "Tactical".
* '''type''' – ''optional'' – as an alternative to the '''scope''' field above, the type of operation, such as "Suicide attack" or "Ambush".
* '''planned''' – ''optional'' – the date(s) on which the plan was developed.
* '''planned_by''' – ''optional'' – the person or group responsible for developing the plan.
* '''commanded_by''' – ''optional'' – the person commanding the operation.
* '''objective''' – ''optional'' – the objective(s) of the operation.
* '''target''' – ''optional'' – as an alternative to the '''objective''' field above, the target(s) of the operation.
* '''date''' – ''optional'' – the date(s), if any, on which the operation was executed. use {{Tl|Start date}} (and {{Tl|End date}} if required)
* '''time''' – ''optional'' – the time, if any, at which the operation was executed.
* '''time-begin''' and '''time-end''' – ''optional'' – as an alternative to the '''time''' field above, the start and end times, respectively.
* '''timezone''' – ''optional'' – the timezone of the location of the operation; [[UTC]]+X, [[UTC]]-X, or [[UTC]] (i.e. offset from [[UTC]]) is preferred.
* '''executed_by''' – ''optional'' – the people, groups, units, or formations responsible for executing the operation.
* '''outcome''' – ''optional'' – the outcome of the operation from the perspective of the planners.
* '''casualties''' – ''optional'' – any casualties occurring during the execution of the operation.
* '''fatalities''' – ''optional'' – as an alternative to the '''casualties''' field above, the number of fatalities occurring during the execution of the operation.
* '''injuries''' – ''optional'' – as an alternative to the '''casualties''' field above, the number of injuries occurring during the execution of the operation.
=== Microformat ===
{{UF-hcal}}
=== See also ===
* {{tl|Infobox civil conflict}}
* {{tl|Infobox civilian attack}}
* {{tl|Infobox military conflict}}<noinclude>
[[Category:WikiProject Military history template instructions|Military operation]]
</noinclude><includeonly>{{Sandbox other||{{#ifeq:{{{noheader|}}}|yes||
[[Category:Military auxiliary infobox templates|Military operation]]
[[Category:Templates that add a tracking category]]
}}}}</includeonly>
73201007b374b23cccc982f6d8d1ce14cfa81cbf
Template:Location map
10
61
120
2021-06-06T02:04:10Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Location_map]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
732416b8068d2dc3549db5aa5ffa786beb502886
Template:KIA
10
293
584
2021-06-06T02:04:10Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:KIA]]
wikitext
text/x-wiki
[[<!---(link:)-->{{{1|Killed in action}}}<!--
-->|<!--(label:)-->{{#ifeq:{{{alt|}}}|yes |(KIA) |<span style="font-family:'Times New Roman','Old English Text MT',serif">{{#ifeq:{{{bold|}}}|no |† |'''†'''}}</span>}}<!--
-->]]<noinclude>
{{Documentation}}
</noinclude>
40db638380717ea2f21d23962d35f009deec5b20
Template:Longitem
10
294
586
2021-06-06T02:04:11Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Longitem]]
wikitext
text/x-wiki
<div style="display:inline-block; padding:0.1em 0;line-height:1.2em;{{{style|}}}">{{{1}}}</div><includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
603b32e39380822d40ff4fa75e8b2759cc4280e7
Template:Microformat message
10
295
588
2021-06-06T02:04:13Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Microformat_message]]
wikitext
text/x-wiki
The [[Help:HTML in wikitext|HTML mark-up]] produced by this template includes {{#if:{{{type|}}} |{{{type}}} |an [[{{{format}}} microformat]]}} that makes {{{data}}} readily [[Parsing|parsable]] by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit [[Wikipedia:WikiProject Microformats|the Microformat WikiProject]].<!--
-->{{#if:{{{subtemplates<includeonly>|</includeonly>}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{big|Subtemplates}}
{{{subtemplates}}}
'''''Please do not remove instances of these subtemplates.'''''
</div>}}<!--
-->{{#if:{{{subsection1|}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;"><!--(newline in case subsection begins with heading:)-->
{{{subsection1}}}
</div>}}<!--
-->{{#if:{{{1<includeonly>|</includeonly>}}} <!--(i.e. if at least one unnamed parameter supplied:)-->
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{big|Classes used}}
The [[HTML attribute|HTML class]]es of this microformat include:
: {{hlist
|item_style=font-size:110%;{{{itemstyle|}}}
|{{{1}}} |{{{2<includeonly>|</includeonly>}}} |{{{3|<noinclude>{{nobold|……}}</noinclude>}}}
|{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}}
}} </div>
{{longitem|style=line-height:1.3em|'''''Please do not rename or remove these classes{{#if:{{{nocollapse<includeonly>|</includeonly>}}} |<br/>nor collapse nested elements which use them}}.'''''}}<!--
-->}}<!--(end #if:[1])--><noinclude>
{{Documentation}}
</noinclude>
bfb8605b8917ea8a940634ca79c9c1a4c9c50ef0
Template:Military navigation
10
296
590
2021-06-06T02:04:13Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Military_navigation]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Military navigation|main}}</includeonly><noinclude>
{{Documentation|Wikipedia:WikiProject Military history/Military navigation}}
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes| ]]
</noinclude>
a97cde0f2435f325e6cebabd17c16bb26a783300
Template:PAGENAMEBASE
10
7
12
2021-06-06T02:04:15Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:PAGENAMEBASE]]
wikitext
text/x-wiki
{{{{{|safesubst:}}}#Invoke:String|replace|{{{1|{{{{{|safesubst:}}}PAGENAME}}}}}|%s+%b()$||1|false}}<noinclude>
{{documentation}}
</noinclude>
f23a5d434cb5b0baac5e1f58e9ceef9118e6873f
Template:Operational plan/doc
10
297
592
2021-06-06T02:04:15Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Operational_plan/doc]]
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox military operation/doc]]
10b255654acded6663dadad8d9084ba41f66bd68
Template:Para
10
28
54
2021-06-06T02:04:16Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Para]]
wikitext
text/x-wiki
<code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
96ef5dce1fb3a5c1b6648eac125a2496944a852e
Template:Spaced en dash
10
298
594
2021-06-06T02:04:18Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Spaced_en_dash]]
wikitext
text/x-wiki
<noinclude>{{Template for discussion/dated|action=|page=Spaced en dash|otherpage=|link=Wikipedia:Templates for discussion/Log/2021 June 5#Template:Spaced en dash|type=tiny|help=off|bigbox={{#invoke:Noinclude|noinclude|text=yes}}}}</noinclude> – <noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
162f72ca1872e84ce0cdc6d557639dd1b26d8bda
Template:Spaced ndash
10
299
596
2021-06-06T02:04:18Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Spaced_ndash]]
wikitext
text/x-wiki
#REDIRECT [[Template:Spaced en dash]]
{{R from move}}
943ce837a48a4907650d7398e8d10271b21dde62
Template:Start date
10
300
598
2021-06-06T02:04:19Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Start_date]]
wikitext
text/x-wiki
<includeonly>{{#if: {{{4|}}}
|{{#if: {{{5|}}}
|{{padleft:{{{4}}}|2|0}}:{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
|:{{padleft:{{{6}}}|2|0}} }}, }} }}<!--ABOVE FOR TIME; BELOW FOR DATE
-->{{#if: {{{1|}}}
|{{#if: {{{2|}}}
|{{#if: {{{3|}}}
|{{#if: {{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{{1}}}|{{MONTHNAME|{{{2}}}}} {{{1}}}}}|{{{1}}}}}}}{{#if: {{{7|}}}
| ({{#ifeq: {{{7}}}|Z|UTC|{{{7}}}}})}}<!-- BELOW FOR hCalendar
--><span style="display:none"> (<span class="bday dtstart published updated">{{#if: {{{1|}}}
| {{{1}}}{{#if: {{{2|}}}
| -{{padleft:{{{2}}}|2|0}}{{#if: {{{3|}}}
| -{{padleft:{{{3}}}|2|0}} }} }}<!--
-->{{#if: {{{4|}}}
| T{{padleft:{{{4}}}|2|0}}{{#if: {{{5|}}}
| :{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
| :{{padleft:{{{6}}}|2|0}} }} }} }} }}{{{7|}}}</span>)</span></includeonly><noinclude>
{{documentation}}
</noinclude>
2bdc464c20f7d568f3d482c9fb2d04f5d266f982
Template:UF-hcal
10
301
600
2021-06-06T02:04:22Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:UF-hcal]]
wikitext
text/x-wiki
{{Microformat message
| format = hCalendar
| data = event details
| subtemplates =
{{#if:{{{hide_subtemplates}}} |<noinclude>}}
Dates will only be included if you use {{tl|start date}} (for single dates) or {{tl|end date}}. Do not, however, use these templates [[Wikipedia:WikiProject Microformats/dates|if a date before 1583 CE is involved]].
To include URLs, use {{tl|URL}}.
{{#if:{{{hide_subtemplates}}} |</noinclude>}}
|attendee |contact |description |dtend |dtstart |location |organiser |summary |url |vevent
| nocollapse = on
}}<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars|{{PAGENAME}}]]}} }}</includeonly><noinclude>
{{Documentation |content={{Microformat message templates}}}}
[[Category:Microformat (uF) message templates]]
</noinclude>
f453b47f676a5c474e14155f7013b69b4716748b
Template:UF-hcal-geo
10
302
602
2021-06-06T02:04:22Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:UF-hcal-geo]]
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[hCalendar|hCalendar microformat]], which makes the event details [[parsing|parsable]] by computers, either acting automatically to catalogue article across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to a calendar or diary application. Within the hCalendar is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
Dates will only be included if you use {{tl|Start date}} or {{tl|End date}} (use the former for single dates, [[Wikipedia:WikiProject Microformats/dates|but do not use any of these if the date is before 1583 CE]]). {{tl|End date}} requires that a time be specified, but display of this time may be suppressed by adding {{para|nodate|yes}} to the end.
To include a URL, use {{tl|URL}}.
hCalendar uses HTML classes including:
{{Flatlist/microformat|indent=1|
*attendee
*dtend
*dtstart
*location
*summary
*url
*vevent
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist/microformat|indent=1|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<br/>Also, when giving coordinates, please don't be [[wikipedia:WikiProject Geographical coordinates#Precision|overly precise]].
<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars and Geo|{{PAGENAME}}]]}} }}</includeonly><noinclude>
[[Category:Microformat (uF) message templates]]
</noinclude>
edfbf3e672c2ee4cfb945f299b5cc960ea00e7ae
Template:WPMILHIST Infobox style
10
303
604
2021-06-06T02:04:23Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:WPMILHIST_Infobox_style]]
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}
|main_box=class="{{#if:{{{2|}}}|infobox {{{2}}}|infobox}}" style="{{#invoke:Data|Module:WPMILHIST Infobox style|main_box_raw}}"
|{{#invoke:Data|Module:WPMILHIST Infobox style|{{{1|}}}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
b117547056afc703e2f1371497b0a53fa5a22751
Template:Wrap
10
304
606
2021-06-06T02:04:24Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Wrap]]
wikitext
text/x-wiki
<includeonly><span class="wrap">{{{1| }}}</span></includeonly><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
aa85f77c2939e3f50fa04a160b08510cf331ee11
Template:Yes/no
10
305
608
2021-06-06T02:04:24Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Yes/no]]
wikitext
text/x-wiki
#REDIRECT [[Template:Yesno]]
80e458cd4d851471d13896c26ecf96ce6dcdd579
Module:Data
828
306
610
2021-06-06T02:04:27Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Data]]
Scribunto
text/plain
local mt = {}
function mt.__index(t, k)
return function(frame)
local data = mw.loadData(k)
local i = 1
for _,v in ipairs(frame.args) do
local ty = type(data)
if ty ~= 'table' then
local args = {}
for j = 1, i - 1 do
args[j] = frame.args[j]
end
if frame.args.softfail then
return '<span class="error">[[Category:Pages with failed Module:Data lookups]]Error: Tried to read index "' .. mw.text.nowiki(v) .. '" of mw.loadData("' .. mw.text.nowiki(k) .. '").' .. mw.text.nowiki(table.concat(args, '.')) .. ', which is a ' .. ty .. '</span>'
else
error('Tried to read index "' .. v .. '" of mw.loadData("' .. k .. '").' .. table.concat(args, '.') .. ', which is a ' .. ty)
end
end
data = data[v]
i = i + 1
end
return data
end
end
return setmetatable({}, mt)
654c5ba2e0c73e7415457ca7a67fe0dfacfdba3b
Module:Infobox military conflict
828
307
612
2021-06-06T02:04:29Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Infobox_military_conflict]]
Scribunto
text/plain
require('Module:No globals')
local infoboxStyle = mw.loadData('Module:WPMILHIST Infobox style')
local templatestyles = 'Module:Infobox military conflict/styles.css'
local IMC = {}
IMC.__index = IMC
function IMC:renderPerCombatant(builder, headerText, prefix, suffix)
prefix = prefix or ''
suffix = suffix or ''
local colspans = {}
-- This may result in colspans[1] getting set twice, but
-- this is no big deal. The second set will be correct.
local lastCombatant = 1
for i = 1,self.combatants do
if self.args[prefix .. i .. suffix] then
colspans[lastCombatant] = i - lastCombatant
lastCombatant = i
end
end
local jointText = self.args[prefix .. (self.combatants + 1) .. suffix]
if headerText and (colspans[1] or jointText) then
builder:tag('tr')
:tag('th')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(headerText)
end
-- The only time colspans[1] wouldn't be set is if no
-- combatant has a field with the given prefix and suffix.
if colspans[1] then
-- Since each found argument set the colspan for the previous
-- one, the final one wasn't set above, so set it now.
colspans[lastCombatant] = self.combatants - lastCombatant + 1
builder = builder:tag('tr')
for i = 1,self.combatants do
-- At this point, colspans[i] will be set for i=1 unconditionally, and for
-- any other value of i where self.args[prefix .. i .. suffix] is set.
if colspans[i] then
builder:tag('td')
-- don't bother emitting colspan="1"
:attr('colspan', colspans[i] ~= 1 and colspans[i] or nil)
:css('width', math.floor(100 / self.combatants * colspans[i] + 0.5) .. '%')
-- no border on the right of the rightmost column
:css('border-right', i ~= lastCombatant and infoboxStyle.internal_border or nil)
-- no padding on the left of the leftmost column
:css('padding-left', i ~= 1 and '0.25em' or nil)
-- don't show the border if we're directly under a header
:css('border-top', not headerText and infoboxStyle.internal_border or nil)
:newline()
:wikitext(self.args[prefix .. i .. suffix])
end
end
end
if jointText then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('text-align', 'center')
-- don't show the border if we're directly under a header
:css('border-top', (not headerText or colspans[1]) and infoboxStyle.internal_border or nil)
:newline()
:wikitext(jointText)
end
end
function IMC:renderHeaderTable(builder)
builder = builder:tag('table')
:css('width', '100%')
:css('margin', 0)
:css('padding', 0)
:css('border', 0)
if self.args.date then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Date')
:done()
:tag('td')
:wikitext(self.args.date)
end
builder = builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Location')
:done()
:tag('td')
:tag('div')
:addClass('location')
:wikitext(self.args.place or '{{{place}}}') -- hack so that people who don't know Lua know that this parameter is required
:done()
if self.args.coordinates then
builder:wikitext(self.args.coordinates)
end
builder = builder:done():done()
-- only for "Putsch"
if self.args.action then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.action and 'Action')
:done()
:tag('td')
:wikitext(self.args.action)
end
if self.args.status or self.args.result then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.status and 'Status' or 'Result')
:done()
:tag('td')
:addClass('status')
:newline()
:wikitext(self.args.status or self.args.result)
end
if self.args.territory then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Territorial<br />changes')
:done()
:tag('td')
:newline()
:wikitext(self.args.territory)
end
end
function IMC:render()
local builder = mw.html.create()
if self.args.campaignbox then
-- this should be the same as using {{stack|clear=right|...}}
builder:wikitext(self.frame:expandTemplate{ title = 'stack begin', args = { clear='true'} })
end
builder = builder:tag('table')
:addClass('infobox vevent')
:cssText(infoboxStyle.main_box_raw)
:css('width', self.args.width or nil)
builder:tag('tr')
:tag('th')
:addClass('summary')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(self.args.conflict or mw.title.getCurrentTitle().text)
if self.args.partof then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.sub_header_raw)
:wikitext('Part of ' .. self.args.partof)
end
if self.args.image then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.image_box_raw)
:wikitext(string.format('%s%s%s',
require('Module:InfoboxImage').InfoboxImage{args = {
image = self.args.image,
size = self.args.image_size,
sizedefault = 'frameless',
upright = 1,
alt = self.args.alt
}},
self.args.caption and '<br />' or '',
self.args.caption or ''
))
end
self:renderHeaderTable(builder:tag('tr'):tag('td'):attr('colspan', self.combatants))
self:renderPerCombatant(builder, self.args.combatants_header or 'Belligerents', 'combatant')
-- can be un-hardcoded once gerrit:165108 is merged
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'combatant', v)
end
self:renderPerCombatant(builder, 'Commanders and leaders', 'commander')
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'commander', v)
end
self:renderPerCombatant(builder, 'Units involved', 'units')
self:renderPerCombatant(builder, 'Strength', 'strength')
self:renderPerCombatant(builder, 'Political support', 'polstrength')
self:renderPerCombatant(builder, 'Military support', 'milstrength')
self:renderPerCombatant(builder, 'Casualties and losses', 'casualties')
if self.args.notes then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.section_border)
:newline()
:wikitext(self.args.notes)
end
if self.args.map_type then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.internal_border)
:node(require('Module:Location map').main(self.frame, {
self.args.map_type,
relief = self.args.map_relief,
coordinates = self.args.coordinates,
width = self.args.map_size or 220,
float = 'center',
border = 'none',
mark = self.args.map_mark,
marksize = self.args.map_marksize or 8,
label = self.args.map_label,
alt = self.args.map_alt,
caption = self.args.map_caption or ('Location within '
.. (require('Module:Location map').data(self.frame, {self.args.map_type, 'name'})))
}))
end
builder = builder:done()
if self.args.campaignbox then
builder = builder:done()
builder:wikitext(self.args.campaignbox .. self.frame:expandTemplate{ title = 'stack end'})
end
return builder
end
function IMC.new(frame, args)
if not args then
args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Infobox military conflict'})
end
local obj = {
frame = frame,
args = args
}
-- until gerrit:165108 is merged, there's still a cap on combatants, but as soon as it merges, we can update this little bit of code to uncap it
-- also, don't try to make this more efficient, or references could be in the wrong order
obj.combatants = 2
for _,v in ipairs{'', 'a', 'b', 'c', 'd'} do
for i = 1,5 do
if args['combatant' .. i .. v] then
obj.combatants = math.max(obj.combatants, i)
end
end
end
return setmetatable(obj, IMC)
end
local p = {}
function p.main(frame)
return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(IMC.new(frame):render())
end
return p
5977f9959e2b25b7630a8f3da9612c9e362545aa
Module:Location map
828
99
196
2021-06-06T02:04:30Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Location_map]]
Scribunto
text/plain
require('Module:No globals')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
elseif mw.title.new('Template:Location map ' .. map).exists then
local cache = {}
if type(frame) ~= 'table' or type(frame.expandTemplate) ~= 'function' then
error('A frame must be provided when using a legacy location map')
end
return function(name, params)
if params then
return frame:expandTemplate{title = 'Location map ' .. map, args = { name, unpack(params) }}
else
if name == nil then
return 'Template:Location map ' .. map
elseif cache[name] == nil then
cache[name] = frame:expandTemplate{title = 'Location map ' .. map, args = { name }}
end
return cache[name]
end
end
else
error('Unable to find the specified location map definition. Neither "Module:Location map/data/' .. map .. '" nor "Template:Location map ' .. map .. '" exists', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+°[NS] %-?[%.%d]+°[EW]') or '', '[ °]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then return error('Malformed coordinates value', 2) end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief and map('image1') ~= '' then
return map('image1')
else
return map('image')
end
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = args.float == 'center' and '<div class="center">' or ''
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="noviewer thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
retval = string.format(
'%s[[File:%s|%spx|%s%s]]',
retval,
image,
width,
args.alt or ((args.label or mw.title.getCurrentTitle().text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div>'
else
retval = retval .. '<div style="font-size:90%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or mw.title.getCurrentTitle().text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv)
return mw.html.create('div')
:cssText('position:absolute;top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:cssText('position:absolute;left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px;line-height:0')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):cssText('font-size:0%;position:absolute'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('font-size:' .. label_size .. '%;line-height:110%;position:absolute;width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
local spanCss
if position == 'top' then -- specified top
builder:cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em;text-align:center')
elseif position == 'bottom' then -- specified bottom
builder:cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em;text-align:center')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:cssText('top:-0.75em;right:' .. distance .. 'px;text-align:right')
spanCss = 'float:right'
else -- specified right or autodetected to right
builder:cssText('top:-0.75em;left:' .. distance .. 'px;text-align:left')
spanCss = 'float:left'
end
builder = builder:tag('span')
:cssText('padding:1px')
:cssText(spanCss)
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
local builder = mw.html.create()
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
local key = frame:preprocess('{{FULLPAGENAME}}')
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, args.label_size or 90, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
fc8518382f53f2a840579e90111baa688e35f872
Module:Location map/data/Earth
828
309
616
2021-06-06T02:04:30Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Location_map/data/Earth]]
Scribunto
text/plain
return {
name = 'Earth',
top = 90,
bottom = -90,
left = -180,
right = 180,
image = 'World location map (equirectangular 180).svg',
image1='World location map (equirectangular 180).svg'}
0c7a9c4349065ea43134d0a61037d31862f2a042
Module:Navbar/configuration
828
193
384
2021-06-06T02:04:32Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Navbar/configuration]]
Scribunto
text/plain
local configuration = {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
return configuration
7f1b6300bc4a690ecfb1c83b582f36c603bd1dff
Module:Military navigation
828
310
618
2021-06-06T02:04:32Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Military_navigation]]
Scribunto
text/plain
local p = { }
local Navbox = require('Module:Navbox')
local Styles = require('Module:WPMILHIST Infobox style')
local function isblank(s)
return (not s) or s == ''
end
local function isnotblank(s)
return s and s ~= ''
end
function p.main(frame)
local args = { }
local pargs = frame:getParent().args
local sargs = {}
local tcats = ''
-- process bodystyle and titlestyle
if (pargs['style'] or '') == 'wide' then
args['titlestyle'] = Styles['nav_box_wide_header']
args['bodystyle'] = Styles['nav_box_wide']
else
args['titlestyle'] = Styles['nav_box_header']
if (pargs['border'] or '') == 'child' or
(pargs['border'] or '') == 'subgroup' then
args['bodystyle'] = Styles['nav_box_child']
tcats = tcats .. '[[Category:Pages using military navigation subgroups without wide style]]'
else
args['bodystyle'] = Styles['nav_box']
end
end
sargs['titlestyle'] = 1
sargs['bodystyle'] = 1
-- process groupstyle, abovestyle, belowstyle
args['groupstyle'] = Styles['nav_box_label'] .. (pargs['groupstyle'] or '')
sargs['groupstyle'] = 1
args['abovestyle'] = Styles['nav_box_label'] .. (pargs['abovestyle'] or '')
sargs['abovestyle'] = 1
args['belowstyle'] = Styles['nav_box_label'] .. (pargs['belowstyle'] or '')
sargs['belowstyle'] = 1
-- process oddstyle, evenstyle
args['oddstyle'] = isnotblank(pargs['odd_color'])
and ('background:' .. pargs['odd_color']) or nil
sargs['oddstyle'] = 1
args['evenstyle'] = isnotblank(pargs['even_color'])
and ('background:' .. pargs['even_color']) or nil
sargs['evenstyle'] = 1
-- process name and rawname
args['name'] = (isnotblank(pargs['name']) and pargs['name']) or pargs['rawname']
if isblank(args['name']) then args['navbar'] = 'plain' end
sargs['name'] = 1
sargs['rawname'] = 1
-- copy the remaining args
for k, v in pairs(pargs) do
if v and v ~= '' and sargs[k] == nil then
args[k] = v
end
end
-- add allow wrap
if args['title'] and (pargs['style'] or '') ~= 'wide' then
if not mw.ustring.match(args['title'], '<span class="wrap">') then
-- probably a more efficient way to match 15 or more characters
local m = '[^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|]'
m = m .. m .. m
args['title'] = mw.ustring.gsub(args['title'],
'%[%[(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%1</span>]]')
args['title'] = mw.ustring.gsub(args['title'],
'%[%[([^%[%]<>|]*)|(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%2</span>]]')
end
end
-- add navbox-vertical for non-wide format
if (pargs['style'] or '') ~= 'wide' then
args['bodyclass'] = 'navbox-vertical' .. (args['bodyclass'] and (' ' .. args['bodyclass']) or '')
end
return tcats .. Navbox._navbox(args)
end
return p
26dd1b8952c65fbc4d05e418e8d7c3daed93fa49
Module:WPMILHIST Infobox style
828
311
620
2021-06-06T02:04:36Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:WPMILHIST_Infobox_style]]
Scribunto
text/plain
local retval = {
main_box_raw_auto_width = 'border-spacing:2px;',
header_raw = 'background-color:#C3D6EF;text-align:center;vertical-align:middle;font-size:110%;',
sub_header_raw = 'background-color:#DCDCDC;text-align:center;vertical-align:middle;',
header_color = 'background-color:#C3D6EF;',
nav_box = 'margin:0;float:right;clear:right;width:25.5em;margin-bottom:0.5em;margin-left:1em;',
nav_box_child = 'margin:0;float:right;clear:right;width:25em;margin-bottom:0.5em;',
nav_box_wide = '',
nav_box_header = 'background-color:#C3D6EF;',
nav_box_wide_header = 'background-color:#C3D6EF;',
nav_box_label = 'background-color:#DCDCDC;',
image_box_raw = 'text-align:center;border-bottom:1px solid #aaa;line-height:1.5em;',
image_box_plain_raw = 'text-align:center;line-height:1.5em;',
internal_border = '1px dotted #aaa;',
section_border = '1px solid #aaa;'
}
retval.main_box_raw = 'width:25.5em;' .. retval.main_box_raw_auto_width
retval.header_bar = 'style="' .. retval.header_raw .. '"'
retval.sub_header_bar = 'style="' .. retval.sub_header_raw .. '"'
retval.image_box = 'style="' .. retval.image_box_raw .. '"'
retval.image_box_plain = 'style="' .. retval.image_box_plain_raw .. '"'
return retval
0f9ea47bc17e40cdabbae6de54f63e40ae502f8e
Module:Infobox military conflict/styles.css
828
308
614
2021-06-06T02:53:50Z
mh>AlathraMC
0
AlathraMC changed the content model of the page [[Module:Infobox military conflict/styles.css]] from "plain text" to "Sanitized CSS": Made it so it works with TemplateStyles.
text
text/plain
/* {{pp-template}} */
@media all and (min-width:720px) {
.desktop-float-right {
box-sizing: border-box;
float: right;
clear: right;
}
}
.infobox.vevent .status > p:first-child {
margin: 0;
}
1acb4afebca5f88c4679a397575d07b5de04407d
Template:Self reference
10
177
352
2021-06-06T16:27:37Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Self_reference]]
wikitext
text/x-wiki
{{#switch:{{{2|NONE}}}
|NONE|hatnote|hat={{Hatnote|extraclasses=plainlinks selfreference noprint|1={{{1}}}}}
|inline=<div class="plainlinks selfreference" style="display:inline; font-style: italic;"><!--Same style as class hatnote.-->{{{1}}}</div>
|<!--Matching the empty string here for unprintworthy content is for backwards compatibility with the 2006-2008 version. Do not depend on it!-->=<div style="display:inline;" class="plainlinks selfreference noprint">{{{1}}}</div>
|#default={{error|Second parameter must be <code>hatnote</code>, <code>hat</code>, or <code>inline</code>}}
}}<noinclude>
{{Documentation}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES THE /doc SUBPAGE, AND INTERWIKIS TO WIKIDATA, THANKS -->
</noinclude>
0c4a08f880070e918c3edcaa50cc493f99841e98
Template:As of
10
200
398
2021-06-06T16:27:37Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:As_of]]
wikitext
text/x-wiki
<!--{{As of}} begin--><includeonly><!--
## param 1 is the year
## optional param 2 is the month
## optional param 3 is the day of the month
## optional named parameter alt=[text] is alternative display text (may include wiki markup)
## optional named parameter df=US produces American date format in displayed text
## optional named parameter lc=on gives lower-case-first output
## optional named parameter url=[URL] gives statement reference
## displayed text ([A/a]s of [Start date] by default)
-->{{#if: {{{alt|}}} | {{{alt}}} | {{#if:{{{since|}}}|{{#ifeq: {{{lc}}} | {{{lc|}}} | s | S }}ince | {{#ifeq: {{{lc}}} | {{{lc|}}} | a | A }}s of}} {{#if:{{{pre|}}}|{{{pre}}} }}{{#if: {{{3|}}} | {{#ifeq:{{lc:{{{df|}}}}}|us|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}}, |{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}} }}{{{1}}}|{{#if: {{{2|}}} |{{MONTHNAME|{{{2}}}}} }}{{{1}}}}}}}{{#if:{{{post|}}}|<nowiki />{{{post}}}}}<!--
#### That nowiki is required or, various characters (:, ;, #, and *} will be parsed as wikisyntax for list items.
## ref/update inline banner (hidden by default)
--><sup class="plainlinks noexcerpt noprint asof-tag {{#if:{{{url|}}}|ref|update}}" style="display:none;">[{{#if:{{{url|}}}|{{{url}}} [ref]|{{fullurl:{{PAGENAME}}|action=edit}} [update]}}]</sup><!--
## categorisation disabled outside main namespace
-->{{DMCA|Articles containing potentially dated statements|from|<!--
## temporal category for template (word method)
-->{{#if: {{#ifexpr: {{{1}}} = 1 }} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 2004 | {{{1}}} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 1989 | {{#time:Y|{{{1}}}}} | before 1990 }}}} | <!--
## temporal category for template (parameter method)
-->{{#ifexpr: {{{1}}} > 2004 | {{#if:{{{2|}}} | {{MONTHNAME|{{{2}}}}} }} {{{1}}} | {{#ifexpr:{{{1}}} > 1989 | {{{1}}} | before 1990 }}}}}}|<!--
## global category for template
-->All articles containing potentially dated statements}}</includeonly><!--{{As of}} end--><noinclude><!--
## dynamic example (as of today, self ref)
-->{{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}<sup class="plainlinks">[https://en.wikipedia.org/wiki/Template:As_of [ref]]</sup>
{{documentation}}
<!-- Add categories and inter-wikis to the /doc subpage, not here! -->
</noinclude>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using as of template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:As of]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | alt | df | lc | post | pre | since | url }}
e9f5197664e88118b4669c3e17a7dddeb8e14163
Template:DMCA
10
201
400
2021-06-06T16:27:38Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:DMCA]]
wikitext
text/x-wiki
{{Dated maintenance category
|onlyarticles=yes
|1={{{1|}}}
|2={{{2|}}}
|3={{{3|}}}
|4={{{4|}}}
|5={{{5|}}}
}}<noinclude>
{{documentation|Template:Dated maintenance category/doc}}
</noinclude>
6bbc57c75cc28708a0e71dd658224d5945d80d68
Template:Dated maintenance category
10
202
402
2021-06-06T16:27:38Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Dated_maintenance_category]]
wikitext
text/x-wiki
<nowiki/><!--This nowiki helps to prevent whitespace at the top of articles-->{{#ifeq:{{FULLROOTPAGENAME}}|Wikipedia:Template messages|<!--Do not categorize-->|<!--
-->{{#ifexpr:{{#if:{{NAMESPACE}}|0|1}}+{{#ifeq:{{{onlyarticles|no}}}|yes|0|1}}
|{{#if:{{{3|}}}
|[[Category:{{{1}}} {{{2}}} {{{3}}}]]<!--
-->{{#ifexist:Category:{{{1}}} {{{2}}} {{{3}}}
|<!--
-->|[[Category:Articles with invalid date parameter in template]]<!--
-->}}
|[[Category:{{#if:{{{5|}}}
|{{{5}}}<!--
-->|{{{1}}}<!--
-->}}]]<!--
-->}}{{#if:{{{4|}}}
|[[Category:{{{4}}}]]}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
41e7d4000124d4f718ddf222af0b72825048c4c4
Template:Dc2
10
203
404
2021-06-06T16:27:39Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Dc2]]
wikitext
text/x-wiki
<del class="deprecated-content {{{class|}}}" style="color:{{#if:{{{red|}}}|#B26F5A|#A9A9A9}}; text-decoration:line-through; {{#if:{{{style|}}}|{{{style}}}|}}" {{#if:{{{id|}}}|id="{{{id}}}|}}" {{#if:{{{title|{{{2|}}}}}}|title="{{{title|{{{2}}}}}}"|}}><span style="color:{{#if:{{{red|}}}|#8B0000|#696969}};">{{{1}}}</span></del><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
418df0517ccca7496d9d4056e488cc574f7817a8
Template:FULLROOTPAGENAME
10
205
408
2021-06-06T16:27:41Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:FULLROOTPAGENAME]]
wikitext
text/x-wiki
{{ {{{|safesubst:}}}#if: {{ {{{|safesubst:}}}Ns has subpages | {{ {{{|safesubst:}}}#if:{{{1|}}}|{{ {{{|safesubst:}}}NAMESPACE:{{{1}}}}}|{{ {{{|safesubst:}}}NAMESPACE}}}} }}
| {{ {{{|safesubst:}}}#titleparts:{{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|{{ {{{|safesubst:}}}FULLPAGENAME}}}}|1}}
| {{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|{{ {{{|safesubst:}}}FULLPAGENAME}}}}
}}<noinclude>
{{documentation}}
</noinclude>
f9584dc5ed14e997ad5a07cfd50b58abd1b0db91
Template:Navbox
10
196
390
2021-06-06T16:27:45Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Navbox]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Navbox|navbox}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
fe9b964401f895918ee4fe078678f1722a3c41ec
Template:Navbox hatnote templates
10
210
418
2021-06-06T16:27:45Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Navbox_hatnote_templates]]
wikitext
text/x-wiki
#REDIRECT [[Template:Hatnote templates]]
{{R from move}}
26939c8223b6e0617eb1e6b2e9990c178cbf8ac5
Template:Never substitute
10
211
420
2021-06-06T16:27:47Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Never_substitute]]
wikitext
text/x-wiki
{{Ombox
|type=notice
|text='''This template should {{em|not}} be [[Wikipedia:Substitution|substituted]].''' {{{1|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
ed10c57c4f8088f4a40cd7d066ae311218883d20
Template:Ns has subpages
10
212
422
2021-06-06T16:27:48Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Ns_has_subpages]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Ns has subpages|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
060d2d01af26cb67fd90a7c346a0d2d5e450a040
Template:Self reference/doc
10
213
424
2021-06-06T16:27:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Self_reference/doc]]
wikitext
text/x-wiki
{{distinguish|Template:Self reference cleanup}}
{{Documentation subpage}}
{{High-use|2060}}
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE, AND INTERWIKIS TO WIKIDATA. -->
{{never substitute}}
The {{tlf|Self reference}} template generates a [[WP:HAT|hatnote]] that will ''not'' appear in any [[WP:Reusing Wikipedia content|reuse of Wikipedia article content]], including the [[Wikipedia:Keyboard_shortcuts#List_of_access_keys|printable version]] of an article. The template's intended purpose is to display information that is relevant only to a reader viewing the article directly within Wikipedia. Such information might include a [[WP:DAB|disambiguation]] statement that points to a [[WP:H|Wikipedia help]] page or an instruction to editors. (In [[WP:Glossary|Wikipedia terminology]], these are forms of self-reference.)
Unlike many hatnote templates, {{tlf|Self reference}} has no preset text, link generation, or formatting other than italics. <code><nowiki>{{Self reference|Foo}}</nowiki></code> simply returns ''Foo''. Many hatnote templates that ''do'' contain helpful preset text and linking, such as {{t|for}} and {{t|about}}, support a {{para|selfref}} parameter that gives them the same functionality as {{tlf|Self reference}}, making them better options in most circumstances.
In most cases, references to the Wikipedia project are discouraged, and the valid uses for this template are rare. Consultation of the list of [[Wikipedia:Self-references to avoid|Self-references to avoid]] is advisable.
== Usage ==
In most cases, {{tlf|Selfref}} is used to create a disambiguation link to a page in the "Wikipedia:" namespace from article-space; for instance, the page [[Objectivity (disambiguation)]] could have a self-referential "[[WP:HATNOTE|hatnote]]" link at the top: <code><nowiki>{{Selfref|For Wikipedia's policy on avoiding bias, see [[Wikipedia:Neutral point of view]].}}</nowiki></code>.
When using {{tlf|Selfref}} in this way, use the following format:
<pre>
{{Selfref|The self-referential notice to display, including [[MOS:LINK|links]].}}
</pre>
which produces:
{{Selfref|The self-referential notice to display, including [[MOS:LINK|links]].}}
italicized (Wikipedia house style for self-referential notes), and both preceded and followed by a linebreak.
For inline use (in body text, mid-sentence, and {{em|not}} in hatnotes), without the indentation and line breaking, use {{tlx|Selfref inline}}:
<pre>
{{Selfref inline|the self-referential text to display, including [[MOS:LINKS|links]]}}
</pre>
which produces: {{Selfref inline|the self-referential text to display, including [[MOS:LINKS|links]]}} (illustrated here on the same line as other content).
Template {{tnull|Selfref}} also has the parameter {{para||inline}}:
<pre>
{{Selfref|the self-referential text to display, including [[MOS:LINKS|links]]|inline}}
</pre>
However, {{as of |alt=as of early 2019|2019|01|post=,}} it does not always function properly, and may cause a line break under some circumstances.
=== Unprintworthy content ===
Rarely, there is other, non-self-referential content which shouldn't appear in mirrors, print editions, or other off-Wikipedia reuses of Wikipedia content, and which shouldn't be italicized as a self-reference.
It is preferable to mark such unprintworthy content with the {{tl|Unprintworthy inline}} template (which includes the <code>noprint</code> CSS class, but not the <code>plainlinks</code> class, since links in such content will not be internal self-references). Although not all [[WP:Mirrors and forks|mirror sites]] do so, the content in question can be removed by reusers of WP content, without any reformatting, by ignoring or removing content marked up by this template, or more accurately by the <code>selfreference</code> CSS class that it (and some other templates) use.
'''Note: The following syntax has been obsolete since 2008, and if you see it, replace it as described below.'''
There was a {{em|deprecated}}, pre-2008 legacy usage of {{tlf|Selfref}} that was used for such unprintworthy cases, and pre-dates the {{tl|Unprintworthy inline}} template. This is to simply end the template with a pipe character – <code>|</code>:
{{dc2|1=<pre>
{{Selfref|the unprintworthy text to display without self-ref styling|}}</pre>}}
This method cannot be depended upon. For one thing, many editors would interpret the ending pipe as an error and remove it, turning the template into an indented self-ref hatnote! It also has not been used since 2008. Any remaining uses of it should be replaced with {{tl|Selfref inline}} (if real a self-references) or {{tl|Unprintworthy inline}} (if simply unprintworthy).
== Example ==
{|border=1 class="wikitable"
! Code !! Page on Wikipedia !! Page on [some] mirrors
|-
| <code><nowiki>{{Selfref|For the Wikipedia Sandbox, see [[WP:SAND]]}}</nowiki></code>
<code><nowiki>The Wikipedia Sandbox is a page on Wikipedia. {{Selfref|(You can edit it by clicking "edit" on the page.)|inline}} It has been edited many times.</nowiki></code>
| {{Selfref|For the Wikipedia Sandbox, see [[WP:SAND]]}}
The Wikipedia Sandbox is a page on Wikipedia. {{Selfref|(You can edit it by clicking "edit" on the page.)|inline}} It has been edited many times.
| The Wikipedia Sandbox is a page on Wikipedia. It has been edited many times.
|}
== See also ==
*[[Wikipedia:Self-references to avoid]]
*{{tlx|srlink}}, for the opposite case when you want a link to the Wikipedia: namespace that ''does'' show in mirrors without breaking (for instance when writing an article about Wikipedia or something connected to it).
*{{tlx|Printworthy selfref}} – for cases of self-references that are printworthy and may or may not be desired by reusers of WP content, depending upon whether they are mirroring or just using single articles
*{{tlx|Unprintworthy inline}} – for unprintworthy inline material that isn't technically a self-reference
*[[Wikipedia:Hatnote]]
{{Navbox hatnote templates|state=collapsed}}<includeonly>{{sandbox other||
<!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANK YOU. -->
[[Category:Wikipedia self-reference templates]]<!--For both forms of this template.-->
[[Category:Disambiguation and redirection templates]]<!--For frequent use atop DAB pages; it's not actually a DAB/redir template, per se.-->
[[Category:Wikipedia page-section templates]]<!--For hatnote usage only.-->
[[Category:Cross-reference templates]]<!--For the inline usage.-->
}}</includeonly>
abfc30fce2dfa8eb3c29343e4ac80e93515b63cd
Template:Selfref
10
214
426
2021-06-06T16:27:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Selfref]]
wikitext
text/x-wiki
#REDIRECT [[Template:Self reference]]
{{Redirect category shell|
{{R from template shortcut}}
{{R from alternative spelling}}
{{R from move}}
}}
c64d0bac3495eca2dadbb678a3e9c9413e7918e3
Template:Selfref inline
10
215
428
2021-06-06T16:27:50Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Selfref_inline]]
wikitext
text/x-wiki
{{Hatnote inline|selfref=yes|1={{{1}}}}}<noinclude>
{{documentation}}
</noinclude>
0db9c100b1ebfce66cfd0f0c9fba5600f00dcded
Template:T
10
216
430
2021-06-06T16:27:51Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:T]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Rcat shell|
{{R from template shortcut}}
}}
<!-- Used as Template:tl throughout English Wikipedia; demo template referenced only on meta ->
7cd61d87ab8a903c157c16a03e0a37e93459cb14
Template:Template link null
10
217
432
2021-06-06T16:27:51Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Template_link_null]]
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tnull}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
2167c503e001d24d870ef82a9de0aaa9832404cb
Module:Distinguish
828
190
378
2021-06-06T16:27:54Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Distinguish]]
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Module:Ns has subpages
828
222
442
2021-06-06T16:27:59Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Ns_has_subpages]]
Scribunto
text/plain
-- This module implements [[Template:Ns has subpages]].
-- While the template is fairly simple, this information is made available to
-- Lua directly, so using a module means that we don't have to update the
-- template as new namespaces are added.
local p = {}
function p._main(ns, frame)
-- Get the current namespace if we were not passed one.
if not ns then
ns = mw.title.getCurrentTitle().namespace
end
-- Look up the namespace table from mw.site.namespaces. This should work
-- for a majority of cases.
local nsTable = mw.site.namespaces[ns]
-- Try using string matching to get the namespace from page names.
-- Do a quick and dirty bad title check to try and make sure we do the same
-- thing as {{NAMESPACE}} in most cases.
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then
local nsStripped = ns:gsub('^[_%s]*:', '')
nsStripped = nsStripped:gsub(':.*$', '')
nsTable = mw.site.namespaces[nsStripped]
end
-- If we still have no match then try the {{NAMESPACE}} parser function,
-- which should catch the remainder of cases. Don't use a mw.title object,
-- as this would increment the expensive function count for each new page
-- tested.
if not nsTable then
frame = frame or mw.getCurrentFrame()
local nsProcessed = frame:callParserFunction('NAMESPACE', ns)
nsTable = nsProcessed and mw.site.namespaces[nsProcessed]
end
return nsTable and nsTable.hasSubpages
end
function p.main(frame)
local ns = frame:getParent().args[1]
if ns then
ns = ns:match('^%s*(.-)%s*$') -- trim whitespace
ns = tonumber(ns) or ns
end
local hasSubpages = p._main(ns, frame)
return hasSubpages and 'yes' or ''
end
return p
e133068ba73738b16e1e3eba47735516a461eb5b
Module:Transclusion count/data/S
828
223
444
2021-06-06T16:28:00Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/S]]
Scribunto
text/plain
return {
["S"] = 2400,
["S-aca"] = 6000,
["S-ach"] = 15000,
["S-aft"] = 206000,
["S-aft/filter"] = 206000,
["S-bef"] = 210000,
["S-bef/filter"] = 210000,
["S-break"] = 4000,
["S-civ"] = 2400,
["S-dip"] = 5000,
["S-end"] = 248000,
["S-gov"] = 6900,
["S-hon"] = 3500,
["S-hou"] = 9100,
["S-inc"] = 12000,
["S-legal"] = 8700,
["S-line"] = 18000,
["S-line/side_cell"] = 18000,
["S-mil"] = 11000,
["S-new"] = 14000,
["S-non"] = 8400,
["S-note"] = 2200,
["S-npo"] = 3400,
["S-off"] = 38000,
["S-par"] = 47000,
["S-par/en"] = 3100,
["S-par/gb"] = 3200,
["S-par/uk"] = 11000,
["S-par/us-hs"] = 11000,
["S-par/us-sen"] = 2000,
["S-ppo"] = 11000,
["S-rail"] = 25000,
["S-rail-start"] = 23000,
["S-rail/lines"] = 25000,
["S-reg"] = 19000,
["S-rel"] = 17000,
["S-roy"] = 2500,
["S-s"] = 3600,
["S-sports"] = 9500,
["S-start"] = 227000,
["S-ttl"] = 216000,
["S-vac"] = 5200,
["SCO"] = 4000,
["SDcat"] = 3690000,
["SECOND"] = 2300,
["SG"] = 2600,
["SGP"] = 2400,
["SIA"] = 2700,
["SLO"] = 3600,
["SMS"] = 7400,
["SPI_archive_notice"] = 59000,
["SPIarchive_notice"] = 59000,
["SPIcat"] = 3800,
["SPIclose"] = 3300,
["SPIpriorcases"] = 54000,
["SR/Olympics_profile"] = 4700,
["SRB"] = 3200,
["SS"] = 19000,
["SSPa"] = 2600,
["STN"] = 12000,
["SUBJECTSPACE_formatted"] = 37000,
["SUI"] = 8000,
["SVG"] = 4100,
["SVG-Logo"] = 17000,
["SVG-Res"] = 14000,
["SVG-logo"] = 3300,
["SVK"] = 5000,
["SVN"] = 4500,
["SWE"] = 12000,
["Sandbox_other"] = 168000,
["Saturday"] = 2600,
["Saved_book"] = 58000,
["Sc"] = 2200,
["Schlüsselconverter"] = 13000,
["School_block"] = 28000,
["School_disambiguation"] = 3200,
["Schoolblock"] = 20000,
["Schooldis"] = 2500,
["Schoolip"] = 15000,
["Scientist_icon"] = 15000,
["Scientist_icon2"] = 15000,
["Sclass"] = 28000,
["Sclass-"] = 26000,
["Sclass/core"] = 31000,
["Sclass2"] = 9000,
["Sclass2-"] = 8100,
["Screen_reader-only"] = 2400,
["Screen_reader-only/styles.css"] = 2700,
["Script/Hebrew"] = 4100,
["Script/Nastaliq"] = 11000,
["Script/styles_hebrew.css"] = 4100,
["Sdash"] = 2100,
["Search_box"] = 37000,
["Search_link"] = 7000,
["Section_link"] = 39000,
["See"] = 9300,
["See_also"] = 160000,
["Seealso"] = 6400,
["Select_skin"] = 3700,
["Selected_article"] = 2400,
["Selected_picture"] = 2400,
["Self"] = 67000,
["Self-published_inline"] = 4000,
["Self-published_source"] = 5700,
["Self-reference_tool"] = 2900,
["Self/migration"] = 46000,
["Self2"] = 2800,
["Self_reference"] = 2400,
["Sent_off"] = 10000,
["Sentoff"] = 3100,
["Separated_entries"] = 135000,
["Serial_killer_opentask"] = 2500,
["Series_overview"] = 5700,
["Serif"] = 2200,
["Set_category"] = 33000,
["Set_index_article"] = 5100,
["Sets_taxobox_colour"] = 160000,
["Sfn"] = 117000,
["SfnRef"] = 114000,
["Sfnm"] = 2300,
["Sfnp"] = 13000,
["Sfnref"] = 7900,
["Sfrac"] = 3500,
["Sfrac/styles.css"] = 3600,
["SharedIP"] = 7500,
["SharedIPEDU"] = 26000,
["Shared_IP"] = 33000,
["Shared_IP_advice"] = 13000,
["Shared_IP_corp"] = 7200,
["Shared_IP_edu"] = 149000,
["Shared_IP_gov"] = 4100,
["Sharedip"] = 10000,
["Sharedipedu"] = 15000,
["Sherdog"] = 2500,
["Ship"] = 79000,
["Ship/maintenancecategory"] = 79000,
["Ship_index"] = 6600,
["Shipboxflag"] = 17000,
["Shipboxflag/core"] = 17000,
["Shipindex"] = 6300,
["Shipwrecks_navbox_footer"] = 4800,
["Short_description"] = 3730000,
["Short_pages_monitor"] = 11000,
["Short_pages_monitor/maximum_length"] = 11000,
["Shortcut"] = 24000,
["Shortcut/styles.css"] = 27000,
["Should_be_SVG"] = 10000,
["Show_button"] = 2420000,
["Sic"] = 24000,
["Sica"] = 2600,
["Side_box"] = 990000,
["Sidebar"] = 190000,
["Sidebar_games_events"] = 32000,
["Sidebar_with_collapsible_lists"] = 80000,
["Sigfig"] = 3300,
["Significant_figures"] = 4000,
["Significant_figures/rnd"] = 3600,
["Signpost-subscription"] = 2000,
["Silver02"] = 14000,
["Silver2"] = 41000,
["Silver_medal"] = 4200,
["Single+double"] = 4300,
["Single-innings_cricket_match"] = 2700,
["Single_chart"] = 31000,
["Single_chart/chartnote"] = 31000,
["Single_namespace"] = 142000,
["Singlechart"] = 22000,
["Singles"] = 36000,
["Sister-inline"] = 153000,
["Sister_project"] = 981000,
["Sister_project_links"] = 9400,
["Sisterlinks"] = 3300,
["Skip_to_talk"] = 11000,
["Skip_to_talk/styles.css"] = 11000,
["Sky"] = 2500,
["Slink"] = 3900,
["Small"] = 896000,
["Small_Solar_System_bodies"] = 3500,
["Smallcaps"] = 16000,
["Smallcaps/styles.css"] = 17000,
["Smallcaps_all"] = 2300,
["Smalldiv"] = 13000,
["Smaller"] = 80000,
["Smallsup"] = 19000,
["Smiley"] = 37000,
["Snd"] = 41000,
["Snds"] = 5800,
["Soccer_icon"] = 125000,
["Soccer_icon2"] = 125000,
["Soccer_icon4"] = 5100,
["Soccerbase"] = 13000,
["Soccerbase_season"] = 5900,
["Soccerway"] = 63000,
["Sock"] = 43000,
["Sockcat"] = 2200,
["Sockmaster"] = 8600,
["Sockpuppet"] = 209000,
["Sockpuppet/categorise"] = 209000,
["SockpuppetCheckuser"] = 5500,
["Sockpuppet_category"] = 43000,
["Sockpuppet_category/confirmed"] = 20000,
["Sockpuppet_category/suspected"] = 23000,
["Sockpuppetcheckuser"] = 3600,
["Sockpuppeteer"] = 20000,
["Soft_redirect"] = 5800,
["Soft_redirect_protection"] = 7500,
["Softredirect"] = 3100,
["Solar_luminosity"] = 3800,
["Solar_mass"] = 4400,
["Solar_radius"] = 3500,
["Soldier_icon"] = 3900,
["Soldier_icon2"] = 3900,
["Song"] = 7500,
["Songs"] = 19000,
["Songs_category"] = 7300,
["Songs_category/core"] = 7300,
["Sort"] = 106000,
["Sortname"] = 44000,
["Source-attribution"] = 2000,
["Source_check"] = 982000,
["Sourcecheck"] = 982000,
["South_America_topic"] = 2500,
["Sp"] = 222000,
["Space"] = 56000,
["Space+double"] = 3600,
["Spaced_en_dash"] = 71000,
["Spaced_en_dash_space"] = 5800,
["Spaced_ndash"] = 22000,
["Spaces"] = 2940000,
["Spain_metadata_Wikidata"] = 7400,
["Spamlink"] = 12000,
["Species_Latin_name_abbreviation_disambiguation"] = 2200,
["Species_list"] = 11000,
["Speciesbox"] = 207000,
["Speciesbox/getGenus"] = 208000,
["Speciesbox/getSpecies"] = 208000,
["Speciesbox/name"] = 208000,
["Speciesbox/parameterCheck"] = 208000,
["Speciesbox/trim"] = 208000,
["Specieslist"] = 4100,
["Split_article"] = 3100,
["Spnd"] = 3300,
["Sport_icon"] = 14000,
["Sport_icon2"] = 14000,
["SportsYearCatUSstate"] = 6300,
["SportsYearCatUSstate/core"] = 6300,
["Sports_links"] = 12000,
["Sports_reference"] = 8600,
["Squad_maintenance"] = 2500,
["Square_bracket_close"] = 87000,
["Square_bracket_open"] = 89000,
["Srt"] = 2900,
["Stack"] = 23000,
["Stack/styles.css"] = 30000,
["Stack_begin"] = 7800,
["Stack_end"] = 7800,
["StaleIP"] = 2800,
["Standings_Table_End"] = 44000,
["Standings_Table_Entry"] = 44000,
["Standings_Table_Entry/record"] = 44000,
["Standings_Table_Start"] = 44000,
["Standings_Table_Start/colheader"] = 44000,
["Standings_Table_Start/colspan"] = 44000,
["Starbox_astrometry"] = 4600,
["Starbox_begin"] = 4800,
["Starbox_catalog"] = 4700,
["Starbox_character"] = 4600,
["Starbox_detail"] = 4400,
["Starbox_end"] = 4700,
["Starbox_observe"] = 4600,
["Starbox_reference"] = 4700,
["Start-Class"] = 100000,
["Start-date"] = 4300,
["Start_box"] = 7700,
["Start_date"] = 378000,
["Start_date_and_age"] = 97000,
["Start_date_and_years_ago"] = 6000,
["Start_of_course_timeline"] = 4400,
["Start_of_course_week"] = 4600,
["Start_tab"] = 4200,
["Startflatlist"] = 100000,
["Static_IP"] = 12000,
["Station"] = 6200,
["Station_link"] = 5900,
["Stdinchicite"] = 10000,
["Steady"] = 12000,
["Stl"] = 3500,
["Stn"] = 5800,
["Stnlnk"] = 28000,
["Stop"] = 2100,
["Storm_colour"] = 4700,
["StoryTeleplay"] = 2800,
["Str_endswith"] = 163000,
["Str_find"] = 594000,
["Str_find0"] = 170000,
["Str_index"] = 12000,
["Str_left"] = 1400000,
["Str_len"] = 376000,
["Str_letter"] = 169000,
["Str_letter/trim"] = 10000,
["Str_number"] = 8000,
["Str_number/trim"] = 30000,
["Str_rep"] = 557000,
["Str_right"] = 63000,
["Str_rightc"] = 304000,
["Str_rightmost"] = 20000,
["Str_sub"] = 17000,
["Str_sub_long"] = 348000,
["Str_sub_old"] = 376000,
["Str_trim"] = 6100,
["Str_≠_len"] = 26000,
["Str_≤_len"] = 8300,
["Str_≥_len"] = 53000,
["Strfind_short"] = 6400,
["Strikethrough"] = 11000,
["Strlen_quick"] = 5800,
["Strong"] = 80000,
["Structurae"] = 2000,
["Stub-Class"] = 59000,
["Stub_Category"] = 13000,
["Stub_category"] = 17000,
["Stub_documentation"] = 35000,
["Student_editor"] = 27000,
["Student_sandbox"] = 4500,
["Student_table_row"] = 3900,
["Students_table"] = 3900,
["Su"] = 11000,
["Su-census1989"] = 4000,
["Sub"] = 2800,
["Subinfobox_bodystyle"] = 31000,
["Subject_bar"] = 17000,
["Subject_bar/styles.css"] = 17000,
["Suboff"] = 5400,
["Subon"] = 5500,
["Subpage_other"] = 163000,
["Subscription"] = 4800,
["Subscription_required"] = 29000,
["Subsidebar_bodystyle"] = 6800,
["Subst_only"] = 3400,
["Substituted_comment"] = 19000,
["Substr_any"] = 6500,
["Succession_box"] = 116000,
["Succession_links"] = 128000,
["Summer_Olympics_by_year_category_navigation"] = 2400,
["Summer_Olympics_by_year_category_navigation/core"] = 2400,
["Sunday"] = 2600,
["Sup"] = 66000,
["Superimpose2/base"] = 2500,
["Superimpose5"] = 2300,
["Suppress_categories"] = 2000,
["Surname"] = 60000,
["Swiss_populations"] = 2400,
["Swiss_populations_NC"] = 3000,
["Swiss_populations_YM"] = 2300,
["Swiss_populations_ref"] = 2400,
["Module:SDcat"] = 3690000,
["Module:Sandbox/Leyo/CommonChemistry"] = 12000,
["Module:Science_redirect"] = 227000,
["Module:Science_redirect/conf"] = 227000,
["Module:Section_link"] = 39000,
["Module:See_also_if_exists"] = 47000,
["Module:Separated_entries"] = 1980000,
["Module:Series_overview"] = 5800,
["Module:Settlement_short_description"] = 623000,
["Module:Shortcut"] = 27000,
["Module:Shortcut/config"] = 27000,
["Module:Side_box"] = 999000,
["Module:Sidebar"] = 259000,
["Module:Sidebar/configuration"] = 259000,
["Module:Sidebar/styles.css"] = 264000,
["Module:Sidebar_games_events"] = 32000,
["Module:Sidebar_games_events/styles.css"] = 32000,
["Module:Singles"] = 36000,
["Module:Sister_project_links"] = 9500,
["Module:Sort_title"] = 15000,
["Module:Sortkey"] = 168000,
["Module:Sports_career"] = 17000,
["Module:Sports_color"] = 58000,
["Module:Sports_color/baseball"] = 31000,
["Module:Sports_color/basketball"] = 20000,
["Module:Sports_rbr_table"] = 8300,
["Module:Sports_rbr_table/styles.css"] = 8300,
["Module:Sports_reference"] = 8600,
["Module:Sports_results"] = 9700,
["Module:Sports_results/styles.css"] = 6100,
["Module:Sports_table"] = 46000,
["Module:Sports_table/WDL"] = 41000,
["Module:Sports_table/WL"] = 2600,
["Module:Sports_table/argcheck"] = 46000,
["Module:Sports_table/styles.css"] = 46000,
["Module:Sports_table/sub"] = 46000,
["Module:Sports_table/totalscheck"] = 33000,
["Module:Stock_tickers/NYSE"] = 2200,
["Module:String"] = 9230000,
["Module:String2"] = 596000,
["Module:Su"] = 11000,
["Module:Subject_bar"] = 17000,
["Module:Suppress_categories"] = 2100,
}
d3c425fe6dd705133d447f75cf4579bdb8c011aa
Template:!mxt
10
242
482
2021-06-06T21:35:00Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:!mxt]]
wikitext
text/x-wiki
<span class="example deprecated-content example-bad monospaced example-mono" style="font-family: monospace, monospace; color: #8B0000;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span><!--"monospace, monospace" needed per https://en.wikipedia.org/wiki/Wikipedia:Typography#The_monospace_'bug'--><noinclude>
{{Documentation|Template:Xt/doc}}
<!--This category has to be done on a per-template basis, not in the shared docs, since it only apply to four templates in the family.-->
[[Category:Programming typing-aid templates]]
{{En-WP attribution notice|Template:!mxt}}
</noinclude>
de48396a3fdbdbf3d480b61327942e47a337fde1
Template:!xt
10
243
484
2021-06-06T21:35:01Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:!xt]]
wikitext
text/x-wiki
<span class="example deprecated-content example-bad" style="font-family: Georgia, 'DejaVu Serif', serif; color: #8B0000;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span><noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:!xt}}
</noinclude>
e89f9718954fee01410846fd9144280a83cc1628
Template:Age
10
244
486
2021-06-06T21:35:02Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Age]]
wikitext
text/x-wiki
<includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly><noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Age}}
</noinclude>
6d56a9a667793177cf533ebe051cd9d67f3b3c38
Template:Anchor
10
245
488
2021-06-06T21:35:02Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Anchor]]
wikitext
text/x-wiki
{{{{{|safesubst:}}}#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Anchor}}
</noinclude>
6d6e668cdf4065f16a70fc35c1363cf9a1a5df67
Template:Birth date and age
10
247
492
2021-06-06T21:35:03Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Birth_date_and_age]]
wikitext
text/x-wiki
<includeonly><span style="display:none"> (<span class="bday">{{{1|{{{year}}}}}}-{{padleft:{{{2|{{{month}}}}}}|2|0}}-{{padleft:{{{3|{{{day}}}}}}|2|0}}</span>) </span>{{#if:{{{df|}}}|{{#expr:{{{3|{{{day}}}}}}}} {{MONTHNAME|{{{2|{{{month}}}}}}}}|{{MONTHNAME|{{{2|{{{month}}}}}}}} {{#expr:{{{3|{{{day}}}}}}}},}} {{{1|{{{year}}}}}}<span class="noprint ForceAgeToShow"> (age {{age | {{{1|{{{year}}}}}} | {{{2|{{{month}}}}}} | {{{3|{{{day}}}}}} }})</span><!--
-- Error checks --
-->{{#ifexpr: ( {{{1|{{{year}}}}}} > {{CURRENTYEAR}} ) OR ( {{CURRENTYEAR}} - {{{1|{{{year}}}}}} > 150 )
|  {{error|invalid year}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#ifexpr: ( {{{2|{{{month}}}}}} > 12 ) OR ( {{{2|{{{month}}}}}} < 1 )
|  {{error|invalid month}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#ifexpr: ( {{{3|{{{day}}}}}} > 31 ) OR ( {{{3|{{{day}}}}}} < 1 )
|  {{error|invalid day}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}</includeonly><noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Birth date and age}}
</noinclude>
7df5b88ef29db70b767c8b315ba2ecad6bf9bc2e
Template:Br separated entries
10
109
216
2021-06-06T21:35:04Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Br_separated_entries]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Template:Block indent
10
248
494
2021-06-06T21:35:04Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Block_indent]]
wikitext
text/x-wiki
<div {{#if:{{{class|}}}|class="{{{class}}}"}} style="padding-left: {{{left|{{{em|3}}}}}}em; padding-right:{{{right|0}}}em; overflow: hidden; {{#if:{{{style|}}}|{{{style}}}}}">{{{1|{{{text|{{{quote|<noinclude>{{lorem ipsum}}</noinclude><includeonly>{{error|Error: No content given to indent (or equals sign used in the actual argument to an unnamed parameter)}}</includeonly>}}}}}}}}}</div><noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Block indent}}
</noinclude>
e8811d2dcba863aeb63d63eedc01ec57385457cd
Template:Crossref
10
249
496
2021-06-06T21:35:06Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Crossref]]
wikitext
text/x-wiki
#REDIRECT [[Template:Crossreference]]
{{Rcat shell|
{{R from template shortcut}}
}}
dc4192593ccb8eaa34c0440c4aa712442a06c329
Template:Crossreference
10
250
498
2021-06-06T21:35:06Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Crossreference]]
wikitext
text/x-wiki
{{Hatnote inline|1={{{1|{{{text|{{{content|<noinclude>sample content</noinclude>}}}}}}}}}|extraclasses={{{class|{{{extraclasses|}}}}}}|selfref={{#if:{{{selfref|{{{printworthy|{{{unprintworthy|}}}}}}}}}||yes}}}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Crossreference}}
</noinclude>
526faf3f91a2a3fbf706735836db838debadb848
Template:Em
10
204
406
2021-06-06T21:35:08Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Em]]
wikitext
text/x-wiki
<em {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</em><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
e2fac6fb507a0dd72c4e79d02403049c7d857c8d
Template:En-WP attribution notice
10
232
462
2021-06-06T21:35:09Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:En-WP_attribution_notice]]
wikitext
text/x-wiki
<includeonly>{| style="border: 1px solid #e0e0e0; background-color: #f8f8f8; color:black; margin: 5px auto; width: 60%;"
|-
| style="padding: 3px 10px;" | [[File:Wikipedia-logo-v2.svg|30px|Wikipedia logo]]
| style="font-size: 90%; padding: 3px;" | This {{Pagetype}} uses material from the Wikipedia {{Pagetype|page={{{1|{{FULLPAGENAME}}}}}}} [[w:en:{{{1|{{FULLPAGENAME}}}}}|{{{1|{{FULLPAGENAME}}}}}]], which is released under the [[w:en:Wikipedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License|Creative Commons Attribution-ShareAlike 3.0 Unported License]] ([https://en.wikipedia.org/w/index.php?title={{urlencode:{{{1|{{FULLPAGENAME}}}}}}}&action=history view authors]).
|}
[[Category:{{Pagetype|category=Categorie}}s from English Wikipedia]]</includeonly>
<noinclude>
{{documentation}}
[[Category:Attribution templates]]
{{En-WP attribution notice|Template:En-WP attribution notice}}
</noinclude>
2f8572b5c25751c527d33ac2122cfc3cdcc7d622
Template:Hatnote inline
10
206
410
2021-06-06T21:35:10Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Hatnote_inline]]
wikitext
text/x-wiki
{{Hatnote inline/invoke|1={{{1|{{{text|{{{content}}}}}}}}}|extraclasses={{{class|{{{extraclasses|}}}}}}|selfref={{#if:{{{printworthy|{{{selfref|}}}}}}||yes}}|category={{{category|}}}|inline={{{inline|true}}}}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
6100bc21ef0eb771865a7df70ae432137e283584
Template:Hatnote inline/invoke
10
207
412
2021-06-06T21:35:10Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Hatnote_inline/invoke]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote inline|hatnote}}</includeonly><noinclude>
{{Documentation|content=This is an includeonly part of [[Template:Hatnote inline]].}}</noinclude>
bcceba0d964fb499427b81aef69b70f463221df3
Template:Flatlist
10
251
500
2021-06-06T21:35:10Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Flatlist]]
wikitext
text/x-wiki
<div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
ec300849f550d5798230cadd0db437bd1612ef15
Template:Hlist
10
159
316
2021-06-06T21:35:11Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Hlist]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
9e3824c2e3c0e0dbef2f37556ac0b994987fecf9
Template:Increase
10
160
318
2021-06-06T21:35:12Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Increase]]
wikitext
text/x-wiki
[[File:Increase2.svg|{{{size|11px}}}|alt={{{1|Increase}}}|link=|{{{1|Increase}}}]]<noinclude>
{{documentation}}
</noinclude>
dac0cb099f2bf8616e0649249f7e4593a2bf54bd
Template:Infobox person/doc
10
252
502
2021-06-06T21:35:19Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/doc]]
wikitext
text/x-wiki
{{documentation subpage}}
{{Person infobox header}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{tl|Infobox person}} may be used to summarize information about a particular person, usually at the top of an article.
== Usage ==
The infobox may be added by pasting the template as shown below into an article and then filling in the desired fields. Any parameters left blank or omitted will not be displayed.
=== Blank template with basic parameters ===
{{Infobox person
| name = ''name''
| image = example-serious.jpg
| alt = alt
| caption = ''caption''
| birth_name = ''birth_name''
| birth_date = ''birth_date''
| birth_place = ''birth_place''
| death_date = ''death_date''
| death_place = ''death_place''
| nationality = ''nationality''
| other_names = ''other_names''
| occupation = ''occupation''
| years_active = ''years_active''
| known_for = ''known_for''
| notable_works = ''notable_works''
}}
<pre style="overflow:auto; line-height:1.2em;">
{{Infobox person
| name = <!-- include middle initial, if not specified in birth_name -->
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| alt = <!-- descriptive text for use by speech synthesis (text-to-speech) software -->
| caption =
| birth_name = <!-- only use if different from name -->
| birth_date = <!-- {{birth date and age|YYYY|MM|DD}} for living people supply only the year with {{Birth year and age|YYYY}} unless the exact date is already widely published, as per [[WP:DOB]]. For people who have died, use {{Birth date|YYYY|MM|DD}}. -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| nationality =
| other_names =
| occupation =
| years_active =
| known_for =
| notable_works =
}}
</pre>
{{clear}}
=== Blank template with all parameters ===
Only the most pertinent information should be included. Please {{em|remove}} unused parameters, and refrain from inserting dubious trivia in an attempt to fill all parameters.
{{Parameter names example | _display=italics
| pre-nominals | name | post-nominals
| image=example-serious.jpg | image_upright | alt | caption <!--shows placement of parameters, see examples for image-->
| native_name | native_name_lang | pronunciation
| birth_name | birth_date | birth_place | baptised <!--does not display due to birth date displayed-->
| disappeared_date | disappeared_place | disappeared_status | death_date | death_place | death_cause
| body_discovered | resting_place | resting_place_coordinates | monuments
| residence | nationality | other_names | citizenship | education | alma_mater
| occupation | years_active | era | employer | organization | agent | known_for | notable_works
| style | home_town | salary | net_worth | height | weight | television
| title | term | predecessor | successor | party | movement | opponents | boards
| criminal_charge | criminal_penalty | criminal_status
| spouse | partner | children | parents | relatives | family | callsign | awards | website
| module | module2 | module3 | module4 | module5 | module6 <!--removed the ... which only saved two lines from being shown-->
| signature=''<nowiki />signature'' | signature_size=''signature_size''<br /> | signature_alt <!--shows placement of parameters, see examples for image-->
| footnotes
}}
<pre style="overflow:auto; line-height:1.2em">
{{Infobox person
| pre-nominals =
| name = <!-- include middle initial, if not specified in birth_name -->
| post-nominals =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| image_upright =
| alt =
| caption =
| native_name =
| native_name_lang =
| pronunciation =
| birth_name = <!-- only use if different from name above -->
| birth_date = <!-- {{birth date and age|YYYY|MM|DD}} for living people supply only the year with {{Birth year and age|YYYY}} unless the exact date is already widely published, as per [[WP:DOB]]. For people who have died, use {{Birth date|YYYY|MM|DD}}. -->
| birth_place =
| baptised = <!-- will not display if birth_date is entered -->
| disappeared_date = <!-- {{disappeared date and age|YYYY|MM|DD|YYYY|MM|DD}} (disappeared date then birth date) -->
| disappeared_place =
| disappeared_status =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (death date then birth date) -->
| death_place =
| death_cause =
| body_discovered =
| resting_place =
| resting_place_coordinates = <!-- {{coord|LAT|LONG|type:landmark|display=inline}} -->
| burial_place = <!-- may be used instead of resting_place and resting_place_coordinates (displays "Burial place" as label) -->
| burial_coordinates = <!-- {{coord|LAT|LONG|type:landmark|display=inline}} -->
| monuments =
| residence =
| nationality =
| other_names =
| citizenship =
| education =
| alma_mater =
| occupation =
| years_active =
| era =
| employer =
| organization =
| agent = <!-- Discouraged in most cases, specifically when promotional, and requiring a reliable source -->
| known_for =
| notable_works = <!-- produces label "Notable work"; may be overridden by |credits=, which produces label "Notable credit(s)"; or by |works=, which produces label "Works"; or by |label_name=, which produces label "Label(s)" -->
| style =
| home_town =
| salary =
| net_worth = <!-- Net worth should be supported with a citation from a reliable source -->
| height = <!-- "X cm", "X m" or "X ft Y in" plus optional reference (conversions are automatic) -->
| weight = <!-- "X kg", "X lb" or "X st Y lb" plus optional reference (conversions are automatic) -->
| television =
| title = <!-- Formal/awarded/job title. The parameter |office= may be used as an alternative when the label is better rendered as "Office" (e.g. public office or appointments) -->
| term =
| predecessor =
| successor =
| party =
| movement =
| opponents =
| boards =
| criminal_charge = <!-- Criminality parameters should be supported with citations from reliable sources -->
| criminal_penalty =
| criminal_status =
| spouse = <!-- Use article title or common name -->
| partner = <!-- (unmarried long-term partner) -->
| children =
| parents = <!-- overrides mother and father parameters -->
| mother = <!-- may be used (optionally with father parameter) in place of parents parameter (displays "Parent(s)" as label) -->
| father = <!-- may be used (optionally with mother parameter) in place of parents parameter (displays "Parent(s)" as label) -->
| relatives =
| family =
| callsign =
| awards =
| website = <!-- {{URL|example.com}} -->
| module =
| module2 =
| module3 =
| module4 =
| module5 =
| module6 =
| signature =
| signature_size =
| signature_alt =
| footnotes =
}}
</pre>
{{clear}}
== Parameters ==
<big>Do not use all these parameters for any one person. The list is long to cover a wide range of people. Only use those parameters that convey essential or notable information about the subject, and ensure that that information is sourced in the article or (if present only in the infobox) in the infobox itself.</big>
Any parameters left blank or omitted will not be displayed. Many parameters have alternative names, implemented for compatibility with other templates (especially to aid merging). The preferred names are shown in the table below.
{| class="wikitable"
! style="text-align: left" | Parameter
! style="text-align: left" | Explanation
|-
| '''<code>pre-nominals</code>'''
| To appear on the line above the person's name. This is for things like <code><nowiki>|pre-nominals=Sir</nowiki></code> – honorifics of serious significance that are attached to the name in formal address, such as knighthoods and titles of nobility; do not use it for routine things like "{{!mxt|[[Dr.]]}}" or "{{!mxt|[[Ms.]]}}"
|-
| '''<code>name</code>'''
| Common name of person (defaults to article name if left blank; provide {{para|birth_name}} (below) if different from {{para|name}}). If middle initials are specified (or implied) by the lead of the article, and are not specified separately in the {{para|birth_name}} parameter, include them here. ''Do not put honorifics or alternative names in this parameter.'' There are separate parameters for these things, covered below.
|-
| '''<code>post-nominals</code>'''
| To appear on the line below the person's name. This is for things like <code><nowiki>|post-nominals=[[Officer of the Order of the British Empire|OBE]]</nowiki></code> – honorifics of serious significance that are attached to the name in formal address, such as national orders and non-honorary doctorates; do not use it for routine things like "{{!mxt|[[Bachelor of arts|BA]]}}". It is permissible but not required to use the {{tlx|post-nominals}} template inside this parameter; doing so requires {{tlx|post-nominals|size{{=}}100|...}}.
|-
| '''<code>image</code>'''
| Image name: {{kbd|abc.jpg}}, {{kbd|xpz.png}}, {{kbd|123.gif}}, etc., without the {{samp|File:}} or {{samp|Image:}} prefix. If an image is desired but not available, one may add {{kbd|yes}} to the {{para|needs-photo}} parameter of the {{tlx|WikiProject Biography}} template on the talk page. If no image is available yet, [[Wikipedia:Centralized discussion/Image placeholders|do not use an image placeholder]].
|-
| '''<code>image_upright</code>'''
| Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).
|-
| '''<code>alt</code>'''
| Descriptive [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|<code>alt</code> text for the image]], for visually impaired readers. One word (such as {{kbd|photograph}}) is rarely sufficient. Do not copy-paste the value of {{para|caption}} (below) into this parameter. Example of the difference: "Willie Nelson at a concert in Dallas, 1989" is good as {{para|caption}} value; "Nelson in western-wear with an acoustic guitar, on stage in a daytime show with band in background" is an {{para|alt}} description. If nothing meaningful can be said that isn't already in the caption, use the [[Wikipedia:Manual of Style/Accessibility/Alternative text for images#Captions and nearby text|stock text]] {{para|alt|refer to caption}}.
|-
| '''<code>caption</code>'''
| Caption for image, if needed. Try to include the date of photo, some context, and the photographer if known (check the <code>File:</code> or [[Wikimedia Commons|Commons]] page for the image).
|-
| '''<code>native_name</code>'''
| The person's name in their own language, if different.
|-
| '''<code>native_name_lang</code>'''
| [[ISO 639-1]] code, e.g., "{{kbd|fr}}" for French. If more than one, use {{tlx|lang}} around each name in {{para|native_name}} instead.
|-
| '''<code>pronunciation</code>'''
| Details of how to pronounce the individual's native name. <!--copied from TemplateData description, if changed please update there also-->
|-
| '''<code>birth_name</code>'''
| Name at birth; only use if different from {{para|name}}.
|-
| '''<code>birth_date</code>'''
| Date of birth: Use {{tlx|birth date and age}} (if living) or {{tlx|birth date}} (if dead). {{crossref|See template's page for details on usage.}} If only a year of birth is known, or age as of a certain date, consider using {{tlx|birth year and age}} or {{tlx|birth based on age as of date}}. For living people [[Wikipedia:Biographies of living persons#Privacy of personal information and using primary sources|supply only the year unless the exact date is already widely published]]. Treat such cases as if only the year is known, so use {{tlx|birth year and age}} or a similar option. The templates mentioned in this paragraph emit metadata indicating the date is in the Gregorian calendar; if the date is in the Julian calendar, do not use these templates, just write the date.
|-
| {{anchor|birth_place}}'''<code>birth_place</code>'''
| Place of birth: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}.
* Use the name of the birthplace at the time of birth, e.g.: {{kbd|Saigon}} (prior to 1976) or {{kbd|Ho Chi Minh City}} (post 1976).
* [[Wikipedia:Manual of Style/Icons#Do not use flags to indicate locations of birth, residence, or death|Do not use a flag template]], coat of arms, or other icon.
* [[Wikipedia:Manual of Style/Infoboxes#Purpose of an infobox|Omit unnecessary or redundant details]]. For example, it is not necessary to state: {{!xt|{{kbd|[[New York City]], [[New York (state)|New York]], [[United States]]}}}} when {{xt|{{kbd|[[New York City]], US}}}} conveys essentially the same information more concisely.
* Countries should [[Wikipedia:Manual of Style/Linking#What generally should not be linked|generally not be linked]].
* For modern subjects, the country should generally be a sovereign state; for United Kingdom locations, the constituent [[Countries of the United Kingdom|countries of the UK]] are sometimes used instead, when more appropriate in the context.
* For historical subjects, use the place name most appropriate for the context and our readership. What the place may correspond to on a modern map is a matter for an article's main text.
* For subsequent places (of death, etc.) it is not necessary to repeat jurisdictional details or links for the same place name.
|-
| '''<code>baptised</code>'''
| Date of baptism: {{em|Only}} for use when birth date is not known (e.g., for [[Ludwig van Beethoven]]). Will not display if a birth date is entered. Do not use subtemplates. Parameter <code>baptized</code> can be used for articles that use American english spelling.
|-
| '''<code>disappeared_date</code>'''
| (For missing people) Date of disappearance: Use {{tlx|disappeared date and age}} (if birth date is known) or {{tlx|disappeared date}} (if birth date unknown).
|-
| '''<code>disappeared_place</code>'''
| (For missing people) Place of disappearance: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. <!--This space is needed for readability, due to quirk of these templated elements being in proximity.--> ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>disappeared_status</code>'''
| (For missing people) Current status for the person, e.g., if the person is still regarded as missing (using {{tlx|missing for}} to calculate the time since disappearance), or if the person has been [[Declared death in absentia|declared dead ''{{lang|la|in absentia}}'']], with a date for such a ruling.
|-
| '''<code>death_date</code>'''
| Date of death: Use {{tlx|death date and age}} (if birth date is known) or {{tlx|death date}} (if birth date unknown). {{crossref|See template's page for details on usage.}} If exact dates are unknown, consider using {{tlx|death year and age}}. The templates mentioned in this paragraph emit metadata indicating the date is in the Gregorian calendar; if the date is in the Julian calendar, do not use these templates, just write the date.
|-
| '''<code>death_place</code>'''
| Place of death: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>death_cause</code>'''
| Cause of death. Should be clearly defined and sourced, and should only be included when the cause of death has significance for the subject's notability, e.g. [[James Dean]], [[John Lennon]]. It should not be filled in for unremarkable deaths such as those from old age or routine illness, e.g. [[Bruce Forsyth]], [[Eduard Khil]].
|-
| '''<code>body_discovered</code>'''
| Place where the body was discovered (if different from place of death). {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>burial_place</code>'''
| Place of burial {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc. {{crossref|See {{para|resting_place}} for non-burials}}.)
|-
| '''<code>burial_coordinates</code>'''
| Coordinates for place of burial, to accompany {{para|burial_place}}. Use {{tlx|coord}} template.
|-
| '''<code>resting_place</code>'''
| Location of columbarium, ash-scattering, etc. If no location, leave blank. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>resting_place_coordinates</code>'''
| Coordinates for location of columbarium, ash-scattering etc. Use {{tlx|coord}} template.
|-
| '''<code>monuments</code>'''
| Significant monuments erected, buildings named, etc., in honour of the subject. If many, link to an appropriate section of the article instead.
|-
| '''<code>residence</code>'''
| Location(s) where the person notably resides/resided, if different from birthplace. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>nationality</code>'''
| May be used instead of {{para|citizenship}} (below) or vice versa in cases where any confusion could result. Should only be used {{em|with}} {{para|citizenship}} when they differ. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, anachronisms, "country" definitions, etc.)
|-
| '''<code>other_names</code>'''
| Other notable names for the person, if different from {{para|name}} and {{para|birth_name}}. [[Wikipedia:Manual of Style/Biographies#Pseudonyms|This can include]] stage names, maiden/married names, nicknames, criminal aliases, etc.
|-
| '''<code>citizenship</code>'''
| Country of legal citizenship, if different from nationality. Rarely needed. See usage notes for {{para|nationality}}, above. Should only be used if citizenship differs from the value in {{para|nationality}} and cannot be inferred from the birthplace. Note that many countries do not automatically grant citizenship to people born within their borders. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, anachronisms, "country" definitions, etc.)
|-
| '''<code>education</code>'''
| Education, e.g., degree, institution and graduation year, if relevant. If very little information is available or relevant, the {{para|alma_mater}} parameter may be more appropriate.
|-
| '''<code>alma_mater</code>'''
| ''[[Alma mater]]''. This parameter is a more concise alternative to (not addition to) {{para|education}}, and will often consist of the linked name of the last-attended institution of higher education (not secondary schools). It is usually not relevant to include either parameter for non-graduates, but article talk page consensus may conclude otherwise, as perhaps at [[Bill Gates]].
|-
| '''<code>occupation</code>'''
| Occupation(s) as given in the lead. Use list markup for three or more entries, e.g. with {{tlx|flatlist}}. Please observe [[sentence case]] and capitalise only the first letter of the first item; e.g.:
{{block indent|1={{Flatlist|
* Musician
* singer-songwriter
* actor
}}}}
|-
| '''<code>years_active</code>'''
| Date range in years during which the subject was active in their principal occupation(s) and/or other activity for which they are notable. Use the format <code>1950–2000</code>, or <code>1970–present</code> if still active. [[Wikipedia:Manual of Style/Dates and numbers#Ranges|Date ranges]] always use an [[Wikipedia:Manual of Style#En dashes|en dash]], not hyphen. If no dates of birth and/or death are known for the subject, only a ''[[floruit]]'' date range, as is common with ancient subjects, this parameter can be used for it. If approximate (''[[circa]]'') dates are known for either or both, put them in the {{para|birth_date}} and {{para|death_date}} parameters. Helpful templates: {{tlx|floruit}}, {{tlx|circa}}.
|-
| '''<code>era</code>'''
| Era (e.g., {{kbd|Medieval}}) in which the person lived; less specific than {{para|years_active}}. Should not be used if dates are available.
|-
| '''<code>employer</code>'''
| Employer(s), if relevant.
|-
| '''<code>organization</code>'''
| Non-employing organization(s), if relevant.
|-
| '''<code>agent</code>'''
| The subject's agent (individual and/or agency), discouraged in most cases, specifically when promotional, and requiring a [[Wikipedia:Identifying reliable sources|reliable source]].
|-
| '''<code>known_for</code>'''
| A brief description of why the person is notable.
|-
| {{unbulleted list|'''<code>notable_works</code>''';<br /> <small>alternatives:</small>
|'''<code>credits</code>'''
|'''<code>label_name</code>'''
|'''<code>works</code>'''
}}
| Title(s) of notable work(s) (publications, compositions, sculptures, films, etc.) by the subject, if any. Produces the label '''Notable work'''. May be overridden by {{para|credits}}, which produces '''Notable credit(s)'''; or by {{para|works}}, which produces '''Works'''; or by {{para|label_name}}, which produces '''Label(s)'''.
* The {{para|notable_works}}, {{para|credits}}, and {{para|label_name}} parameters are intended to be (at most) short [[#Inline list|inline lists]].
* The {{para|label_name}} variant is used for one or more record labels with which a performer is associated, or a fashion label in which a designer has been heavily involved or for which they are well known. Remember that this parameter is an alternative to the others mentioned here and is not used along with them.
* The {{para|works}} variant is intended to link to {{em|a specific list article}} for a larger body of work (not all of which may be individually notable).
|-
| '''<code>style</code>'''
| The style of the subject's works, if applicable. {{crossref|This parameter is not for [[Style (manner of address)|styles of address or office]]; see {{para|pre-nominals}}.}}
|-
| '''<code>home_town</code>'''
| The place where the person was raised and matured, if different from birthplace and residence. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>salary</code>'''
| Annual salary or compensation, if relevant. Link the first occurrence to the currency article, e.g.: <code><nowiki>[[Pound sterling|₤]]86,000</nowiki></code>
|-
| '''<code>net_worth</code>'''
| Current estimated net worth, if relevant. Please be sure to support with a citation from a reliable source, in the article body.
|-
| '''<code>height</code>'''
| If person was notable for their height, or if height is relevant. If used, this should also include the year of the measurement if the person had not reached full adulthood when this stat was published. {{crossref|See documentation of this parameter at [[Template:Infobox sportsperson]] for more information.}}
|-
| '''<code>weight</code>'''
| If person was notable for their weight, or if weight is relevant. If used, this should also include the year of the measurement. {{crossref|See documentation of this parameter at [[Template:Infobox sportsperson]] for more information.}}
|-
| '''<code>television</code>'''
| Television programmes presented by or {{em|closely}} associated with the subject. For multiple entries, use an [[#Inline list|inline list]].
|-
| '''<code>title</code>'''
| Multiple uses:
* Formal title, such as {{kbd|First Lady of Japan}} for [[Akie Abe]].
* Awarded title, such as {{kbd|Mr. Olympia}} for [[Arnold Schwarzenegger]].
* Job title, such as {{kbd|President of Calvin College}} for [[Anthony Diekema]].
* A combination of the above, such as {{kbd|Professor of Mathematics}} and {{kbd|[[Fellow of the Royal Society]]}} for [[Bill Parry (mathematician)|Bill Parry]]
For multiple entries, use an [[#Inline list|inline list]].
Use the {{para|awards}} parameter, below, for awarded honors that are not really titles. A single award should not use both parameters.
|-
| '''<code>office</code>'''
| May be used as an alternative to {{para|title}} when the label is better displayed as '''Office''' (e.g. public office or appointments). Using this parameter will override {{para|title}}.
|-
| '''<code>term</code>'''
| Years the person held the {{para|title}} or {{para|office}} listed above. Helpful template: {{tlx|reign}} (also used for civil offices).
|-
| '''<code>predecessor</code>'''
| Person who previously held the {{para|title}} or {{para|office}} listed above.
|-
| '''<code>successor</code>'''
| Person who subsequently held the {{para|title}} or {{para|office}} listed above.
|-
| '''<code>party</code>'''
| If relevant. Field labelled '''Political party'''.
|-
| '''<code>movement</code>'''
| If relevant. Can be [[Social movement|social]], [[Political movement|political]] (non-party), [[Art movement|artistic]], [[Philosophical movement|philosophical]], [[List of literary movements|literary]], [[Cultural movement|cultural]], etc.
|-
| '''<code>opponents</code>'''
| Notable relevant opponents (e.g., for major political office).
|-
| '''<code>boards</code>'''
| For [[board of directors]] membership(s), if relevant. Field labeled '''Board member of'''.
|-
| {{ubl|'''<code>criminal_charge</code>'''|'''<code>criminal_penalty</code>'''|'''<code>criminal_status</code>'''}}
| For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.
|-
| '''<code>spouse</code>'''
| Name of spouse(s), followed by years of marriage. Use the format ''Name (married 1950–present)'' for a current spouse, and ''Name (married 1970–99)'' for former spouse(s). Use article title (if linking) or [[Wikipedia:Article titles#Use commonly recognizable names|common name]]. For multiple entries, use an [[#Inline list|inline list]]. For deceased persons still married at time of death, close the date range with death year.
|-
| '''<code>partner</code>'''
| If particularly relevant, or if the partner is notable; "partner" here means unmarried [[life partner]]s (of any gender or sexual preference), not business partner. Use the format ''Name (1950–present)'' for current partner and ''Name (1970–1999)'' for former partner(s). [[Wikipedia:Manual of Style/Dates_and numbers#Ranges|Do not use truncated years]] (as in "{{xt|1970–99}}").
|-
| '''<code>children</code>'''
| Only if independently notable themselves or particularly relevant. Number of children (e.g., {{kbd|three}}), or list of names if notable. For multiple entries, use an [[#Inline list|inline list]]. {{em|For [[Wikipedia:Biographies of living persons#Privacy of names|privacy reasons]], consider omitting the names of children of living persons, unless notable.}}
|-
| '''<code>parents</code>'''
| Names of parents; include only if they are independently notable or particularly relevant. For multiple entries, use an [[#Inline list|inline list]]. If subject has only one notable mother and/or only one notable father, {{para|mother}} and {{para|father}} parameters may be used instead. These parameter may be used for biological, adoptive, foster, or step-parents.
|-
| '''<code>mother</code>'''
| Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Displays '''Parent(s)''' as label, and is overridden by the {{para|parents}} parameter.
|-
| '''<code>father</code>'''
| Name of father; include only if subject has one father who is independently notable or particularly relevant. Displays '''Parent(s)''' as label, and is overridden by the {{para|parents}} parameter.
|-
| '''<code>relatives</code>'''
| Names of siblings or other relatives; include only if independently notable or particularly relevant. Include the relationship in parentheses after the name (sister, uncle, etc.). For multiple entries, use an [[#Inline list|inline list]].
|-
| '''<code>callsign</code>'''
| Amateur radio [[call sign]], if relevant.
|-
| '''<code>awards</code>'''
| Notable awards. If many, link to an appropriate section of the article instead. Use {{para|title}} parameter, above, for awarded titles; A single award should not use both parameters.
|-
| '''<code>website</code>'''
| Official website only. Unofficial websites should be placed under <code><nowiki>==External links==</nowiki></code> in the body of the article. Use {{tlx|URL}} as in {{tnull|URL|Example.com}}. Do not display the {{samp|www.}} part unless the site requires it.
|-
| {{ubl | '''<code>module</code>''' | '''<code>module2</code>''' | '''<code>module3</code>''' | '''<code>module4</code>''' | '''<code>module5</code>''' | '''<code>module6</code>''' }}
| Used for embedding other infoboxes into this one. Example:
<pre>
{{Infobox person
| name = Ian Watkins
...
| module =
{{Infobox musical artist
| embed = yes
| background = solo_singer <!-- mandatory field -->
...
}} <!-- end of Infobox musical artist -->
...
}} <!-- end of Infobox person -->
</pre>
{{crossref|For more detailed information, see [[Wikipedia:WikiProject Infoboxes/embed]].}}
|-
| '''<code>signature</code>'''
| An image of the person's signature. Please use image name: {{kbd|abc.jpg}}, {{kbd|xpz.png}}, {{kbd|123.gif}}, etc., without the {{samp|File:}} or {{samp|Image:}} prefix
|-
| '''<code>signature_size</code>'''
| Default is {{samp|150px}}. If necessary, a signature can be resized manually as per the {{para|image_size}} parameter.
|-
| '''<code>signature_alt</code>'''
| Alt text for the signature image. For example, for {{samp|[[:File:Thomas Jefferson Signature.svg]]}}, the alt text might be <code>|signature_alt= Th: Jefferson</code>, spelling out the signature exactly as it appears in the image.
|-
| '''<code>footnotes</code>'''
| Textual notes about any of the infobox data. This is not for reference citations. If an infobox parameter's value needs a citation, [[Wikipedia:Citing sources|cite inline]] at the end of the value. Citations will appear in the article's references section along with the other citations in the article.
|-
| '''<code>image_size</code>'''
| {{strongbad|Deprecated}}. Size to display image: {{kbd|200px}} (set width), {{kbd|x300px}} (set height), or {{kbd|200x300px}} (max width & max height). If empty or omitted, this defaults to {{samp|frameless}} (default is {{samp|220px}}, but logged-in users can change this by clicking on "my preferences" and adjusting thumbnail size). [[Wikipedia:Image use policy#Displayed image size|Use of this parameter is discouraged]]. Use image_upright instead. Do not use "{{!mxt|×}}" or capital "{{!mxt|X}}"
|}
=== Inline lists ===
{{Main|WP:Manual of Style/Lists#Horizontal lists|WP:Manual of Style/Lists#Unbulleted lists}}
Parameters with multiple values should be formatted with inline-list templates.
'''Horizontal''' ones include {{tlx|hlist}} or {{tlx|flatlist}}. In [[Wikipedia:Manual of Style/Lists#Horizontal lists|horizontal style]], only the first item is capitalized (aside from [[Wikipedia:Manual of Style/Capital letters#Proper names|proper names]]).
This style is best for short items, and few of them. An entry of two or three very short items that will all fit on one line can be done simply with commas: {{para|parameter_name|Foo, bar, baz}} (use semicolons if any items contain their own commas).
Horizontal list example with {{tlx|hlist|Item one|item two|item three}}: {{hlist|Item one|item two|item three}}
'''Vertical''' templates are {{tlx|plainlist}} and {{tlx|unbulleted list}} (vertical), use [[Wikipedia:Manual of Style/Lists#Unbulleted lists|unbulleted, non-indented lists]] for clean display in infoboxes. Entries may be all [[sentence case]], or all lowercase (aside from proper names) after the first.
This style is best for long items, and longer lists. For long lists of information that may not be of immediate interest but retained for reference, the {{tlx|collapsible list}} template can be used; this is not a universally accessible option, so should not be used for key information.
''[[Wikipedia:Manual of Style/Lists#Line breaks|Do not use {{tag|br|s}} markup]]'' to create fake lists, as in: <code>{{!mxt|<nowiki>Item one<br />item two<br />item three</nowiki>}}</code>.
Vertical list example:, using {{tlx|unbulleted list|Item one|item two|item three}}:
{{unbulleted list|Item one|item two|item three}}
== Examples ==
{{Infobox person{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}}
| name = Bill Gates
| image = Bill Gates in WEF, 2007.jpg
| caption = Bill Gates at the [[World Economic Forum]] in [[Davos]], 2007
| birth_name = William Henry Gates III
| birth_date = {{birth date and age|1955|10|28}}
| birth_place = [[Seattle]], Washington, US
| occupation = {{unbulleted list| Chairman of [[Microsoft]] (non-executive) | Co-chair of [[Bill & Melinda Gates Foundation]] | Director of [[Berkshire Hathaway]] | CEO of [[Cascade Investment]] }}
| networth = {{increase}}[[United States dollar|US$]]53 [[1,000,000,000|billion]] (2010)<ref>[https://www.forbes.com/profile/bill-gates/ Bill Gates profile]. Forbes.com. Retrieved April 2010.</ref>
| spouse = [[Melinda Gates]] (married 1994)
| children = 3
| residence = [[Medina, Washington]]
| alma_mater = Harvard University (dropped out in 1975)
| website = {{URL|microsoft.com/presspass/exec/billg}}
| signature = BillGates Signature.svg
| parents = {{unbulleted list| [[William H. Gates Sr.]] | [[Mary Maxwell Gates]] }}
}}
<pre style="overflow: auto">
{{Infobox person
| name = Bill Gates
| image = Bill Gates in WEF, 2007.jpg
| caption = Bill Gates at the [[World Economic Forum]] in [[Davos]], 2007
| birth_name = William Henry Gates III
| birth_date = {{birth date and age|1955|10|28}}
| birth_place = [[Seattle]], Washington, US
| occupation = {{unbulleted list| Chairman of [[Microsoft]] (non-executive) | Co-chair of [[Bill & Melinda Gates Foundation]] | Director of [[Berkshire Hathaway]] | CEO of [[Cascade Investment]] }}
| networth = {{increase}}[[United States dollar|US$]]53 [[1,000,000,000 (number)|billion]] (2010)<ref>[https://www.forbes.com/profile/bill-gates/ Bill Gates profile]. Forbes.com. Retrieved April 2010.</ref>
| spouse = [[Melinda Gates]] (married 1994)
| children = 3
| residence = [[Medina, Washington]]
| alma_mater = Harvard University (dropped out in 1975)
| website = {{URL|microsoft.com/presspass/exec/billg}}
| signature = BillGates Signature.svg
| parents = {{unbulleted list| [[William H. Gates, Sr.]] | [[Mary Maxwell Gates]] }}
}}
</pre>
== Microformat ==
{{UF-hcard-person}}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "An infobox for articles about people",
"params": {
"pre-nominals": {
"description": "Honorific prefix(es), to appear on the line above the person's name",
"label": "Pre-nominals",
"aliases": [
"honorific_prefix",
"honorific-prefix",
"honorific prefix"
]
},
"name": {
"description": "Common name of person (defaults to article name if left blank; provide birth_name (below) if different from name). If middle initials are specified (or implied) by the lead of the article, and are not specified separately in the birth_name field, include them here.",
"label": "Name",
"required": true
},
"post-nominals": {
"description": "Honorific suffix(es), to appear on the line below the person's name",
"label": "Post-nominals",
"aliases": [
"honorific_suffix",
"honorific-suffix",
"honorific suffix"
]
},
"image": {
"description": "Image name: abc.jpg, xpz.png, 123.gif, etc. If an image is desired but not available, one may add \"yes\" to the \"needs-photo\" section of the :Template:WPBiography on the talkpage. If no image is available yet, do not use an image placeholder.",
"label": "Image"
},
"image_size": {
"description": "DEPRECATED/DISCOURAGED. Size to display image: 200px (set width), x300px (set height), or 200x300px (max width & max height). This defaults to frameless (default is 220px, but logged in users can change this by clicking on \"my preferences\" and adjusting thumbnail size) if empty or omitted. Use of this parameter is discouraged as per WP:IMGSIZE. Use image_upright instead.",
"label": "DEPRECATED: Image size",
"aliases": [
"image size",
"imagesize"
],
"example": "200px",
"default": "220px",
"deprecated": "DEPRECATED: Use of this parameter is discouraged as per WP:IMGSIZE. Delete it when encountered and use image_upright instead."
},
"alt": {
"description": "Alt text for image, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT.",
"label": "Alt"
},
"caption": {
"description": "Caption for image, if needed. Try to include date of photo and the photographer.",
"label": "Caption",
"aliases": [
"image caption",
"image_caption"
]
},
"native_name": {
"description": "The person's name in their own language, if different.",
"label": "Native name"
},
"native_name_lang": {
"description": "ISO 639-1 code, e.g., \"fr\" for French. If more than one, use Template:lang in `native_name` instead.",
"label": "Native name language"
},
"pronunciation": {
"description": "Details of how to pronounce the individual's native name.",
"label": "Native name pronunciation"
},
"birth_name": {
"description": "Name at birth; only use if different from name.",
"label": "Birth name",
"aliases": [
"birthname"
]
},
"birth_date": {
"description": "Date of birth: {{Birth date and age|YYYY|MM|DD}} for living people. For people who have died, use {{Birth date|YYYY|MM|DD}}. If only a year of birth is known, or age as of a certain date, consider using Template:birth year and age or Template:birth based on age as of date.",
"label": "Birth date"
},
"birth_place": {
"description": "Place of birth: city, administrative region, sovereign state. Use the name of the birthplace at the time of birth, e.g.: Saigon (prior to 1976), Ho Chi Minh City (post 1976). Do not use a flag template.",
"label": "Birth place"
},
"baptised": {
"description": "Date of baptism: ONLY for use when birth date is not known (e.g., Beethoven). Will not display if a birth date is entered. Do not use subtemplates. Parameter 'baptized' can be used for articles that use American english spelling.",
"label": "Baptised",
"aliases": [
"baptized"
]
},
"disappeared_date": {
"description": "(For missing people) Date of disappearance: Template:disappeared date and age (if birth date is known) or Template:disappeared date (if birth date unknown).",
"label": "Disappeared date"
},
"disappeared_place": {
"description": "(For missing people) Place of disappearance: city, administrative region, sovereign state. Do not use a flag template.",
"label": "Disappeared place"
},
"disappeared_status": {
"description": "(For missing people) Current status for the person, e.g., if the person is still regarded as missing (using Template:missing for to calculate the time since disappearance), or if the person has been declared dead in absentia, with a date for such a ruling.",
"label": "Disappeared status",
"aliases": [
"status"
]
},
"death_date": {
"description": "Date of death: {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (if birth date is known) or Template:death date (if birth date unknown). See Template:Death date/doc for details on usage. If exact dates are unknown, consider using Template:death year and age.",
"label": "Death date"
},
"death_place": {
"description": "Place of death: city, administrative region, sovereign state. Note: Do not use a flag template. Use the name of the deathplace at the time of death, e.g.: Saigon (prior to 1976), Ho Chi Minh City (post 1976)",
"label": "Death place"
},
"death_cause": {
"description": "Cause of death.",
"label": "Death cause",
"aliases": [
"death cause"
]
},
"body_discovered": {
"description": "Place where the body was discovered (if different from place of death). Do not use a flag template.",
"label": "Body discovered",
"aliases": [
"body discovered"
]
},
"resting_place": {
"description": "Place of burial, ash-scattering, etc. Do not use a flag template.",
"label": "Resting place",
"aliases": [
"resting place",
"restingplace"
]
},
"resting_place_coordinates": {
"description": "Coordinates for place of burial, ash-scattering etc. Use Template:coord template.",
"label": "Resting place coordinates",
"aliases": [
"resting place coordinates",
"restingplacecoordinates"
]
},
"monuments": {
"description": "Significant monuments erected, buildings named, etc., in honour of the subject. If many, link to an appropriate section of the article instead.",
"label": "Monuments"
},
"residence": {
"description": "Location(s) where the person notably resides/resided, if different from birth place. Do not use a flag template.",
"label": "Residence"
},
"nationality": {
"description": "Nationality. May be used instead of citizenship (below) or vice versa in cases where any confusion could result. Should only be used 'with' citizenship when they somehow differ. Should only be used if nationality cannot be inferred from the birthplace. Do not use a flag template.",
"label": "Nationality"
},
"other_names": {
"description": "Other notable names for the person, if different from name and birth_name.",
"label": "Other names",
"aliases": [
"other names",
"othername",
"alias"
]
},
"citizenship": {
"description": "Country of legal citizenship, if different from nationality. Rarely needed. See usage notes for nationality above. Should only be used if citizenship cannot be inferred from the birthplace. Do not use a flag template.",
"label": "Citizenship"
},
"education": {
"description": "Education, e.g., degree, institution and graduation year, if relevant. If very little information is available or relevant, the `alma_mater` parameter may be more appropriate.",
"label": "Education"
},
"alma_mater": {
"description": "Alma mater. This parameter is a more concise alternative to `education`, and will most often simply consist of the linked name of the last-attended higher education institution. It is usually not relevant to include either parameter for non-graduates, but article talk page consensus may conclude otherwise, as at Bill Gates.",
"label": "Alma mater",
"aliases": [
"alma mater"
]
},
"occupation": {
"description": "Occupation(s) as given in the lead.",
"label": "Occupation"
},
"years_active": {
"description": "Date range in years during which the subject was active in their principal occupation(s) and/or other activity for which they are notable. Use the format 1950–2000, or 1970–present if still active (note the use of an en dash, not hyphen). If no dates of birth and/or death are known for the subject, only a floruit date range, as is common with ancient subjects, this parameter can be used for it. If approximate (circa) dates are known for either or both, put them in the birth_date and death_date parameters.",
"label": "Years active",
"aliases": [
"years active",
"yearsactive"
]
},
"era": {
"description": "Era during which the subject lived or was active. Less specific than 'years active'.",
"label": "Era"
},
"employer": {
"description": "Employer(s), if relevant.",
"label": "Employer"
},
"organization": {
"description": "Non-employing organization(s), if relevant.",
"label": "Organization",
"aliases": [
"organizations"
]
},
"agent": {
"description": "The subject's agent (individual and/or agency), discouraged in most cases, specifically when promotional, and requiring a reliable source.",
"label": "Agent"
},
"known_for": {
"description": "A brief description of what the person is notable for.",
"label": "Known For",
"aliases": [
"known for",
"known"
],
"example": "Environmental activism"
},
"notable_works": {
"description": "Title(s) of notable work(s) (publications, compositions, sculptures, films, etc.) by the subject, if any.",
"label": "Notable works",
"aliases": [
"works",
"credits",
"notable works"
]
},
"style": {
"description": "The style in which the subject works, if applicable.",
"label": "Style"
},
"home_town": {
"description": "The place where the person was raised and matured, if different from birth place and residence.",
"label": "Home town",
"aliases": [
"home town"
]
},
"salary": {
"description": "Annual salary or compensation, if relevant.",
"label": "Salary"
},
"net_worth": {
"description": "Current estimated net worth, if relevant. Please be sure to support with a citation from a reliable source, in the article body.",
"label": "Net worth",
"aliases": [
"net worth",
"networth"
]
},
"height": {
"description": "If person was notable for their height, or if height is relevant. If used, this should also include the year of the measurement if the person had not reached full adulthood when this stat was published. See documentation of this parameter at Template:Infobox sportsperson for more information.",
"label": "Height"
},
"height_m": {
"description": "If person was notable for their height, or if height is relevant, their height in metres (it will be automatically converted to Imperial).",
"label": "Height in metres"
},
"height_cm": {
"description": "If person was notable for their height, or if height is relevant, their height in centimetres (it will be automatically converted to Imperial).",
"label": "Height in centimetres"
},
"height_ft": {
"description": "If person was notable for their height, or if height is relevant, their height in whole feet (it will be automatically converted to SI). Use with height_in.",
"label": "Height in feet"
},
"height_in": {
"description": "If person was notable for their height, or if height is relevant, their height in remaining inches (it will be automatically converted to SI). Use with height_ft.",
"label": "Remaining height in inches"
},
"weight": {
"description": "If person was notable for their weight, or if weight is relevant. If used, this should also include the year of the measurement. See documentation of this parameter at Template:Infobox sportsperson for more information.",
"label": "Weight"
},
"weight_kg": {
"description": "If person was notable for their weight, or if weight is relevant, their weight in kilogrammes (it will be automatically converted to Imperial).",
"label": "Weight in kilogrammes"
},
"weight_lb": {
"description": "If person was notable for their weight, or if weight is relevant, their weight in pounds, or their weight in remaining pounds if weight in whole stones is specified (it will be automatically converted to SI).",
"label": "Weight in pounds"
},
"weight_st": {
"description": "If person was notable for their weight, or if weight is relevant, their weight in whole stones (it will be automatically converted to SI).",
"label": "Weight in stones"
},
"television": {
"description": "Television programmes presented by or closely associated with the subject.",
"label": "Television"
},
"title": {
"description": "Multiple uses: Formal title, such as First Lady of Japan for Akie Abe.; Awarded title, such as Mr. Olympia for Arnold Schwarzenegger.; Job title, such as President of Calvin College for Anthony Diekema.; A combination of the above, such as Professor of Mathematics and Fellow of the Royal Society for Bill Parry See also \"awards\" parameter, below, for awarded honors that are not really titles. A single award should not use both parameters.",
"label": "Title"
},
"term": {
"description": "Years the person held the title listed above.",
"label": "Term"
},
"predecessor": {
"description": "Person who previously held the title listed above.",
"label": "Predecessor"
},
"successor": {
"description": "Person who subsequently held the title listed above.",
"label": "Successor"
},
"party": {
"description": "If relevant. Field labelled Political party.",
"label": "Party"
},
"movement": {
"description": "If relevant. '''Movement''' can be social, political (non-party), artistic, philosophical, literary, cultural, etc.",
"label": "Movement"
},
"opponents": {
"description": "Notable relevant opponents (e.g., for major political office).",
"label": "Opponents"
},
"boards": {
"description": "For board of directors membership(s), if relevant. Field labeled Board member of.",
"label": "Boards"
},
"criminal_charge": {
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"label": "Criminal charge",
"aliases": [
"criminal charge"
]
},
"criminal_penalty": {
"label": "Criminal penalty",
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"aliases": [
"criminal penalty"
]
},
"criminal_status": {
"label": "Criminal status",
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"aliases": [
"judicial_status",
"judicial status",
"criminal status"
]
},
"spouse": {
"description": "Name of spouse(s), followed by years of marriage. Use the format Name (married 1950–present) for a current spouse, and Name (married 1970–99) for former spouse(s). Separate entries using Template:Plainlist or Template:Unbulleted list. For deceased persons still married at time of death, close the date range with death year.",
"label": "Spouse(s)",
"aliases": [
"spouses",
"spouse(s)"
]
},
"partner": {
"description": "For unmarried life partners (of any gender or sexual preference), not business partners. Use the format Name (1950–present) for current partner and Name (1970–99) for former partner(s).",
"label": "Partner(s)",
"aliases": [
"partners",
"partner(s)",
"domestic_partner",
"domestic_partner"
]
},
"children": {
"description": "Number of children (e.g., three or 3), or list of names, in which case, separate entries using Template:Plainlist or Template:Unbulleted list. For privacy reasons, consider omitting the names of children of living persons, unless the children are independently notable.",
"label": "Children"
},
"parents": {
"description": "Names of parents. Separate entries using Template:Plainlist or Template:Unbulleted list. If subject has only one notable mother and/or father, 'mother' and 'father' parameters may be used instead",
"label": "Parent(s)"
},
"mother": {
"description": "Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Overwritten by 'parents' parameter.",
"label": "Mother"
},
"father": {
"description": "Name of father; include only if subject has one father who is independently notable or particularly relevant. Overwritten by 'parents' parameter.",
"label": "Father"
},
"relatives": {
"description": "Names of siblings or other relatives. Include the relationship in parentheses after the name (sister, uncle, etc). Separate entries using Template:Plainlist or Template:Unbulleted list.",
"label": "Relatives",
"aliases": [
"relations"
]
},
"family": {
"description": "Family or house of the individual, if notable.",
"label": "Family"
},
"callsign": {
"description": "Amateur radio call sign, if relevant.",
"label": "Callsign"
},
"awards": {
"description": "Notable awards. If many, link to an appropriate section of the article instead. See also \"title\" parameter, above, for awarded titles. A single award should not use both parameters.",
"label": "Awards"
},
"honours": {
"description": "Honours the individual has been awarded, if notable.",
"label": "Honours",
"aliases": [
"honors"
]
},
"website": {
"description": "Official website only. Unofficial websites should be placed under ==External links== in the body of the article. Use Template:URL as in Example.com . Do not include the www. part unless the server requires it. Use camel case capitalization to make multiword domain names easier to read.",
"label": "Website",
"aliases": [
"homepage",
"URL",
"url"
]
},
"module": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module",
"aliases": [
"misc"
]
},
"module2": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module two",
"aliases": [
"misc2"
]
},
"module3": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module three",
"aliases": [
"misc3"
]
},
"module4": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module four",
"aliases": [
"misc4"
]
},
"module5": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module five",
"aliases": [
"misc5"
]
},
"module6": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module six",
"aliases": [
"misc6"
]
},
"signature": {
"description": "An image of the person's signature. Please use image name: abc.jpg, xpz.png, 123.gif, etc.",
"label": "Signature"
},
"signature_size": {
"description": "Default is 150px. If necessary, a signature can be resized manually as per the \"image_size\" parameter.",
"label": "Signature size"
},
"signature_alt": {
"description": "Alt text for the signature image. For example, for :File:Thomas Jefferson Signature.svg, the alt text might be |signature_alt= Th: Jefferson, spelling out the signature exactly as it appears in the image.",
"label": "Signature alt",
"aliases": [
"signature alt"
]
},
"footnotes": {
"description": "Notes about any of the infobox data.",
"label": "Footnotes"
},
"abovestyle": {
"description": "DEPRECATED: A CSS style to use for the individual's name, over-riding the community norm. Only use in exception circumstances.",
"label": "DEPRECATED: Name CSS over-ride",
"deprecated": true
},
"child": {
"label": "DEPRECATED: Use as an embedded infobox",
"description": "DEPRECATED: Use this infobox within another one. For experts only.",
"example": "yes",
"deprecated": true
},
"image_upright": {
"label": "Image upright",
"description": "Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).",
"example": "1.15",
"default": "1"
},
"burial_place": {
"label": "Burial place",
"description": "Place of burial, alternative to 'Resting place' Displays the label 'Burial place'.",
"type": "content"
},
"burial_coordinates": {
"label": "Burial place coordinates",
"description": "Coordinates for place of burial, to accompany 'Burial place'. Use {{coord}} template."
},
"influences": {
"label": "DEPRECATED: Influences",
"description": "DEPRECATED and unused in the infobox. Do not use.",
"deprecated": "Deprecated. Unused in the infobox. Do not use."
},
"influenced": {
"label": "DEPRECATED: Influenced",
"description": "DEPRECATED and unused in the infobox. Do not use.",
"deprecated": "Deprecated. Unused in the infobox. Do not use."
}
},
"paramOrder": [
"pre-nominals",
"name",
"post-nominals",
"image",
"image_upright",
"image_size",
"alt",
"caption",
"native_name",
"native_name_lang",
"pronunciation",
"birth_name",
"birth_date",
"birth_place",
"baptised",
"disappeared_date",
"disappeared_place",
"disappeared_status",
"death_date",
"death_place",
"death_cause",
"body_discovered",
"resting_place",
"resting_place_coordinates",
"burial_place",
"burial_coordinates",
"monuments",
"residence",
"nationality",
"other_names",
"citizenship",
"education",
"alma_mater",
"occupation",
"years_active",
"era",
"employer",
"organization",
"agent",
"known_for",
"notable_works",
"style",
"home_town",
"salary",
"net_worth",
"height",
"height_m",
"height_cm",
"height_ft",
"height_in",
"weight",
"weight_kg",
"weight_lb",
"weight_st",
"television",
"title",
"term",
"predecessor",
"successor",
"party",
"movement",
"opponents",
"boards",
"criminal_charge",
"criminal_penalty",
"criminal_status",
"spouse",
"partner",
"children",
"parents",
"mother",
"father",
"relatives",
"family",
"callsign",
"awards",
"honours",
"website",
"module",
"module2",
"module3",
"module4",
"module5",
"module6",
"signature",
"signature_size",
"signature_alt",
"footnotes",
"abovestyle",
"child",
"influences",
"influenced"
],
"format": "{{_\n| __________________ = _\n}}\n"
}
</templatedata>
== Tracking categories ==
* {{clc|Pages using infobox person with unknown parameters}}
* {{clc|Infobox person using numbered parameter}}
* {{clc|Infobox person using boxwidth parameter}}
* {{clc|Infobox person using certain parameters when dead}}
* {{clc|Infobox person using influence}}
* {{clc|Infobox person using ethnicity}}
* {{clc|Infobox person using religion}}
* {{clc|Infobox person using denomination}}
* {{clc|Biography template using pronunciation}}
* {{clc|Biography with signature}}
<div style="display: none">{{reflist}}</div>
<includeonly>
{{Basepage subpage|
[[Category:People and person infobox templates| ]]
[[Category:Biographical templates usable as a module|Person]]
[[Category:Infobox templates with module parameter|Person]]
[[Category:Templates that add a tracking category]]
}}
</includeonly>
c032fac57b88f110881f31d83f68b3093b591d98
Template:Infobox person/height
10
253
504
2021-06-06T21:35:19Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/height]]
wikitext
text/x-wiki
{{infobox person/height/locate|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{{1|}}}<!--
-->|metre|m}}<!--
-->|meter|m}}<!--
-->|centi|c}}<!--
-->|feet|ft}}<!--
-->|foot|ft}}<!--
-->|inches|in}}<!--
-->|inch|in}}<!--
-->|ms|m}}<!--
-->|ins|in}}<!--
-->|pattern=[[in|in]]|replace=[[inch|in]]}}<!--
-->|pattern=[[Centim|cm]]|replace=[[Centimetre|cm]]}}<!--
-->|pattern=[[m]]s|replace=[[Metre|m]]}}<!--
-->|pattern=[[cm]]s|replace=[[Centimetre|cm]]}}<!--
-->}}<noinclude>
{{Documentation}}
</noinclude>
96c47aff4c5093c3ed898b76a20ea036e6bf78df
Template:Infobox person/height/locate
10
254
506
2021-06-06T21:35:20Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/height/locate]]
wikitext
text/x-wiki
{{infobox person/height/switch
|{{{1|}}}
|{{#invoke:String|replace|{{{1|}}}| | }}
|m={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|m}}
|c={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|cm}}
|f={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|ft}}
|i={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|in}}
}}<noinclude>
{{Documentation}}
</noinclude>
159e634f03c95c6d6d1362ec46f6ed6e00c94478
Template:Infobox person/height/switch
10
255
508
2021-06-06T21:35:20Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/height/switch]]
wikitext
text/x-wiki
{{#switch:0
|{{{m}}}{{{f}}}{{{i}}}={{{1|}}}
|{{{f}}}{{{i}}}={{#ifeq:{{{c}}}|0
|{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}|m|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}}
}}
|{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}|cm|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}}
}}
}}
|{{{m}}}{{{f}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}}
}}
|{{{m}}}{{{i}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}}}
}}
|{{{m}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}+{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}}
}}
|{{{1|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
fbf532398f7569902ed64aac602098329e298bcb
Template:Infobox person/weight
10
256
510
2021-06-06T21:35:20Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/weight]]
wikitext
text/x-wiki
{{Infobox person/weight/locate|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{{1|}}}<!--
-->|kilogram|kg}}<!--
-->|stone|st}}<!--
-->|pound|lb}}<!--
-->|kgs|kg}}<!--
-->|lbs|lb}}<!--
-->|sts|st}}<!--
-->|kg-stlb={{#if:{{{kg-stlb|}}}|{{{kg-stlb}}}}}
|lb-stlb={{#if:{{{lb-stlb|}}}|{{{lb-stlb}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
c6b1b9864bd142ea1727458ec0b996da8d6c0faf
Template:Infobox person/weight/locate
10
257
512
2021-06-06T21:35:21Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/weight/locate]]
wikitext
text/x-wiki
{{Infobox person/weight/switch
|{{{1|}}}
|{{#invoke:String|replace|{{{1|}}}| | }}
|k={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|kg}}
|s={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|st}}
|l={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|lb}}
|kg-stlb={{#if:{{{kg-stlb|}}}|{{{kg-stlb}}}}}
|lb-stlb={{#if:{{{lb-stlb|}}}|{{{lb-stlb}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
1297fd00a0dea602a0c3f3ece3089b58b0a1a9f6
Template:Infobox person/weight/switch
10
258
514
2021-06-06T21:35:21Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Infobox_person/weight/switch]]
wikitext
text/x-wiki
{{#switch:0
|{{{k}}}{{{l}}}{{{s}}}={{{1|}}}
|{{{l}}}{{{s}}}={{#iferror:{{#expr:{{#invoke:String|replace|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{k|1}}}-1}}}}|–|-}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{k|1}}}-1}}}}|kg|lb {{#if:{{{kg-stlb|}}}|stlb}}|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{k|1}}}+2}}}}
}}
|{{{k}}}{{{s}}}={{#iferror:{{#expr:{{#invoke:String|replace|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{l|1}}}-1}}}}|–|-}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{l|1}}}-1}}}}|lb|kg {{#if:{{{lb-stlb|}}}|stlb}}|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{l|1}}}+2}}}}
}}
|{{{k}}}{{{l}}}={{#iferror:{{#expr:{{#invoke:String|replace|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}|–|-}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}|st|lb kg|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{s|1}}}+2}}}}
}}
|{{{k}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}+{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{s|1}}}+2}}|{{#expr:{{{l|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}|st|{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{s|1}}}+2}}|{{#expr:{{{l|1}}}-1}}}}|lb|lb kg|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{l|1}}}+2}}}}
}}
|{{{1|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
6220d0274ccc9f979faa9b0f30c939341941209b
Template:Kbd
10
259
516
2021-06-06T21:35:21Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Kbd]]
wikitext
text/x-wiki
<kbd {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="background:#EEEEEE; {{#if:{{{spacing|}}}| padding-left:{{{padding|0.2em}}}; padding-right:{{{padding|0.2em}}};| letter-spacing:0.05em; padding-left:0.25em; padding-right:0.2em;}}{{#if:{{{style|}}}|{{{style}}}}}" {{#if:{{{lang|}}}|lang="{{{lang}}}" xml:lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</kbd><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
{{En-WP attribution notice|Template:Kbd}}
</noinclude>
e04c98d35a9482b9d56610501070e5ffc18d8b6c
Template:Lang
10
163
324
2021-06-06T21:35:22Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Lang]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Lang|{{{fn|lang}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
ed35aafbfe8198c5ad80fd861124244d0c7f2742
Template:MONTHNAME
10
230
458
2021-06-06T21:35:22Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:MONTHNAME]]
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}|{{#switch:{{MONTHNUMBER|{{{1}}}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=''month''!}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
25327282f70efd1189b70245a0e23509f3bb65e6
Template:MONTHNUMBER
10
231
460
2021-06-06T21:35:22Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:MONTHNUMBER]]
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
|{{#switch:{{lc:{{{1}}}}}
|january|jan=1
|february|feb=2
|march|mar=3
|apr|april=4
|may=5
|june|jun=6
|july|jul=7
|august|aug=8
|september|sep|sept=9
|october|oct=10
|november|nov=11
|december|dec=12
|{{#ifexpr:{{{1}}}<0
|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})
|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}
|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}
}}
|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}
}}
}}
|Missing required parameter 1=''month''!
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c2ade663b96231e493986cd17b454923da290098
Template:Main
10
176
350
2021-06-06T21:35:23Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Main]]
wikitext
text/x-wiki
{{#invoke:main|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
a7952a0ddabebcef9371e9783f0fed2425a59187
Template:Pagetype
10
233
464
2021-06-06T21:35:25Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Pagetype]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Pagetype}}
</noinclude>
b6d5e4de8a716664120e2fd68dd5932b85777262
Template:Parameter names example
10
239
476
2021-06-06T21:35:25Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Parameter_names_example]]
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
{{Documentation}}
</noinclude>
6b63b13c0cf74f1f8d250aa644a6bd27e19052f6
Template:Person infobox header
10
260
518
2021-06-06T21:35:27Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Person_infobox_header]]
wikitext
text/x-wiki
{{ombox|type=content|text=The design and content of biographical infoboxes must follow Wikipedia's [[Wikipedia:Verifiability|verifiability policy]], as well as [[Wikipedia:Manual of Style/Infoboxes|infobox]] and [[Wikipedia:Manual of Style/Biographies|biographical style guideline]].
All content displayed in this template must adhere to the '''[[Wikipedia:Biographies of living persons|biographies of living persons]]''' policy if applicable. [[Wikipedia:Citing sources|Unsourced or poorly sourced]] contentious material '''must be removed immediately''' from the article and its infobox, especially if potentially [[Wikipedia:Libel|libellous]].}}
<noinclude>
{{Documentation}}
</noinclude>
a8734f2e954a6e7191fa292463bb4b7ee3a43e6e
Template:Strong
10
262
522
2021-06-06T21:35:29Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Strong]]
wikitext
text/x-wiki
<strong {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</strong><noinclude>
{{documentation}}
<!-- Add cats and interwikis to the /doc subpage, not here! -->
</noinclude>
a6c6d3b520e2018e19376e2f0e1a72801336d1df
Template:Strongbad
10
263
524
2021-06-06T21:35:29Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Strongbad]]
wikitext
text/x-wiki
{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{FormattingError|Template:Strongbad is only for use in template documentation, guidelines and other Wikipedia-internal purposes. Do not use it in actual articles.}}|{{strong|1={{{1}}}|style=color:red;{{#if:{{{style}}}|{{{style}}}}} |role={{{role|}}} |class={{{class|}}} |id={{{id|}}} |title={{{title|}}} }}}}<noinclude>
{{documentation}}
<!-- Add cats and interwikis to the /doc subpage, not here! -->
</noinclude>
a1e194c3f4f1e924d5bef701c76e123c1f9fccd3
Template:Template link expanded
10
182
362
2021-06-06T21:35:30Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Template_link_expanded]]
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Template:Tag
10
264
526
2021-06-06T21:35:30Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Tag]]
wikitext
text/x-wiki
<code class="{{#ifeq:{{{wrap|}}}|yes|wrap|nowrap}}" style="{{#ifeq:{{{style|}}}|plain|border:none;background:transparent;|{{{style|}}}}}"><!--
Opening tag
-->{{#switch:{{{2|pair}}}
|c|close =
|e|empty|s|single|v|void
|o|open
|p|pair = <{{#if:{{{link|}}}|[[HTML element#{{{1|tag}}}|{{{1|tag}}}]]|{{{1|tag}}}}}{{#if:{{{params|{{{attribs|}}}}}}| {{{params|{{{attribs}}}}}}}}
}}<!--
Content between tags
-->{{#switch:{{{2|pair}}}
|c|close = {{{content|}}}
|e|empty|s|single|v|void =  />
|o|open = >{{{content|}}}
|p|pair = {{#ifeq:{{{1|tag}}}|!--||>}}{{{content|...}}}
}}<!--
Closing tag
-->{{#switch:{{{2|pair}}}
|e|empty|s|single|v|void
|o|open =
|c|close
|p|pair = {{#ifeq:{{{1|tag}}}|!--|-->|</{{{1|tag}}}>}}
}}<!--
--></code><noinclude>
{{Documentation}}
</noinclude>
eae208bc1612c834de697fa3ee9b343966cf8602
Template:Tlx
10
183
364
2021-06-06T21:35:31Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Tlx]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Template:Tnull
10
218
434
2021-06-06T21:35:31Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Tnull]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link null]]
{{Redirect category shell|
{{R from move}}
}}
b22d666a4b16808dc3becc2403546fb9ab5dea7e
Template:UF-hcard-person
10
265
528
2021-06-06T21:35:32Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:UF-hcard-person]]
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard|hCard microformat]], which makes the person's details [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia or via a browser tool operated by a reader, to (for example) add the subject to an address book or database. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
Date-of-birth ("bday") information will only be included in the microformat if {{tl|birth date}}, or {{tl|birth date and age}} are used in the infobox. ([[Wikipedia:WikiProject Microformats/dates|Do not use these if the date is before 1583]]). Be cautious about using these if the person is still living, per [[WP:DOB]].
To include a URL, use {{Tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist/microformat|
*adr
*agent
*bday
*birthplace
*category
*country-name
*deathdate
*deathplace
*extended-address
*family-name
*fn (required)
*given-name
*honorific-prefix
*honorific-suffix
*label
*locality
*n
*nickname
*note
*org
*role
*url
*vcard
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCards]]}} }}</includeonly><noinclude>
[[Category:Templates generating hCards]]
[[Category:Microformat (uF) message templates]]
</noinclude>
5dafe89ff41872fe4158b3f29f4acddee9a02fa3
Template:Ubl
10
266
530
2021-06-06T21:35:32Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Ubl]]
wikitext
text/x-wiki
#REDIRECT [[Template:Unbulleted list]]
{{R from template shortcut}}
546af378d5563ddf6497dfa858ac7a8c358c8458
Template:Unbulleted list
10
114
226
2021-06-06T21:35:33Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Unbulleted_list]]
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
89815a491d3e05b20af446e34cda13f13c25fb4f
Template:When on basepage
10
241
480
2021-06-06T21:35:33Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:When_on_basepage]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "page" parameter then detect
basepage/subpage/subsubpage-->
{{#if:{{{page|}}}
| {{#if:{{#titleparts:{{{page}}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{{page}}}|0|2}}
| subpage
| basepage
}}
}}
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
| subpage
| basepage
}}
}}
}}
| basepage = {{{1|}}}
| subpage = {{{2|}}}
| subsubpage = {{{3| {{{2|}}} }}} <!--Respecting empty parameter on purpose-->
}}<!--End switch--><noinclude>
{{Documentation}}
</noinclude>
cf4dc92df647a26ab0ce149772a1fe3ac6c3dfc0
Template:Var
10
267
532
2021-06-06T21:35:33Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Var]]
wikitext
text/x-wiki
<var {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="padding-right: 1px;{{{style|}}}" {{#if:{{{lang|}}}|lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</var><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
{{En-WP attribution notice|Template:Var}}
</noinclude>
59afb06cc7004d85cba8a5c3679d028138645bca
Template:Xt
10
268
534
2021-06-06T21:35:34Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Xt]]
wikitext
text/x-wiki
<span class="example" style="font-family: Georgia, 'DejaVu Serif', serif; color: #006400;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span><noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Xt}}
</noinclude>
b9a6c54de1e9b30d154d31def6b7308ee7d0847f
Module:Anchor
828
269
536
2021-06-06T21:35:34Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Anchor]]
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
c750635da1a67721f879398480a67eeb25f899b9
Module:Hatnote inline
828
219
436
2021-06-06T21:35:37Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Hatnote_inline]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote-inline --
-- --
-- This module produces hatnote-style links, and links to related articles, --
-- but inside a <span>, instead of the <div> used by Module:Hatnote. It --
-- implements the {{hatnote-inline}} meta-template. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mArguments = require('Module:Arguments')
local yesno = require('Module:Yesno')
local p = {}
function p.hatnoteInline (frame)
local args = mArguments.getArgs(frame)
local hatnote = mHatnote.hatnote(frame)
if args.inline == nil or yesno(args.inline, true) then
local subs = {
['^<div'] = '<span',
['</div>$'] = '</span>'
}
for k, v in pairs(subs) do hatnote = string.gsub(hatnote, k, v) end
end
return hatnote
end
p.hatnote = p.hatnoteInline --alias
return p
5dc37308b4a4b5e5c6eff5ec44cd977b44edf988
Module:Main
828
180
358
2021-06-06T21:35:41Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Main]]
Scribunto
text/plain
--[[
-- This module produces a link to a main article or articles. It implements the
-- template {{main}}.
--
-- If the module is used in category or category talk space, it produces "The
-- main article for this category is xxx". Otherwise, it produces
-- "Main article: xxx".
--]]
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments -- lazily initialise
local p = {}
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local display = args['label ' .. k] or args['l' .. k]
local page = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
pages[#pages + 1] = page
end
end
if #pages == 0 and mw.title.getCurrentTitle().namespace == 0 then
return mHatnote.makeWikitextError(
'no page names specified',
'Template:Main#Errors',
args.category
)
end
local options = {
selfref = args.selfref
}
return p._main(pages, options)
end
function p._main(args, options)
-- Get the list of pages. If no first page was specified we use the current
-- page name.
local currentTitle = mw.title.getCurrentTitle()
if #args == 0 then args = {currentTitle.text} end
local firstPage = string.gsub(args[1], '|.*$', '')
-- Find the pagetype.
local pageType = mHatnote.findNamespaceId(firstPage) == 0 and 'article' or 'page'
-- Make the formatted link text
list = mHatlist.andList(args, true)
-- Build the text.
local isPlural = #args > 1
local mainForm
local curNs = currentTitle.namespace
if (curNs == 14) or (curNs == 15) then --category/talk namespaces
mainForm = isPlural and
'The main %ss for this [[Help:Categories|category]] are %s'
or
'The main %s for this [[Help:Categories|category]] is %s'
else
mainForm = isPlural and 'Main %ss: %s' or 'Main %s: %s'
end
local text = string.format(mainForm, pageType, list)
-- Process the options and pass the text to the _rellink function in
-- [[Module:Hatnote]].
options = options or {}
local hnOptions = {
selfref = options.selfref
}
return mHatnote._hatnote(text, hnOptions)
end
return p
1ae1e9ed5770c74dbe4878a8d7c91f6f505851e7
Module:Namespace detect
828
234
466
2021-06-06T21:35:41Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Namespace_detect]]
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
Module:Namespace detect/config
828
235
468
2021-06-06T21:35:42Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Namespace_detect/config]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Namespace detect/data
828
236
470
2021-06-06T21:35:42Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Namespace_detect/data]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Pagetype
828
237
472
2021-06-06T21:35:42Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Pagetype]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
if redirect then
return redirect
else
return getNsDetectValue(args)
end
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
4e76ed8318e724693304c0ca2063b36b0890825a
Module:Separated entries
828
110
218
2021-06-06T21:35:43Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Separated_entries]]
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Module:Pagetype/config
828
238
474
2021-06-06T21:35:43Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Pagetype/config]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['wikipedia'] = 'project page',
['wp'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['portal'] = 'portal',
['book'] = 'book',
['draft'] = 'draft',
['education program'] = 'education program page',
['timedtext'] = 'Timed Text page',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['gadget definition'] = 'gadget definition',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file',
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module',
'book'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'portal',
'module',
'book',
'draft'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
cbb04dd488cb9335e0f9f749e3d106e6071cfead
Module:Parameter names example
828
240
478
2021-06-06T21:35:43Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Parameter_names_example]]
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
targs['nocat'] = 'yes';
targs['categories'] = 'no';
targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
576eb8298850f4e4e62105ac740df295b7b7eb9e
Module:Template link general
828
184
366
2021-06-06T21:35:44Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Template_link_general]]
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = ""
local i = 2
while args[i] do
local val = args[i]
textPartBuffer = textPartBuffer .. '|'
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
textPart = textPart .. textPartBuffer .. val
textPartBuffer = ""
end
i = i+1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
return ret
end
return p
737651670b1eb932db151ad2b9ff37e683e44c74
Template:Hatnote templates
10
208
414
2021-06-07T07:19:21Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Hatnote_templates]]
wikitext
text/x-wiki
{{Navbox
| name = Hatnote templates
| state = {{{state|<includeonly>autocollapse</includeonly>}}}
| bodyclass = hlist
| belowclass = hlist
| title = [[WP:Hatnote#Hatnote templates|Hatnote templates]]
| above =
*[[Wikipedia:Hatnote]]
*[[Wikipedia:Disambiguation]]
*[[Wikipedia:Redirect]]
| group1 = Generic
| list1 =
*{{tl|Hatnote}}
*{{tl|Selfref}} (for self-references)
| group2 = For and about
| list2 =
*{{tl|For}}
*{{tl|For2}} (for custom text)
*{{tl|About}}
*Variations: {{tl|Other uses}}
*{{tl|Other uses of}}
| group3 = Other topics
| list3 =
*{{tl|Other people}}
*{{tl|About other people}} (adds "about" description)
*{{tl|Similar names}}
*{{tl|Other places}}
*{{tl|Other ships}}
*{{tl|Other hurricanes}}
| group4 = Redirect
| list4 =
*{{tl|Redirect}}
*{{tl|Redirect2}} (for two redirects)
*{{tl|Redirect-multi}} (for multiple redirects)
*{{tl|Redirect-several}} (for several redirects, without listing each)
*{{tl|Redirect-synonym}}
*{{tl|Redirect-distinguish}}
*{{tl|Technical reasons}}
| group5 = Distinguish
| list5 =
*{{tl|Distinguish}} (supports custom text too)
*{{tl|Redirect-distinguish}}
*{{tl|Redirect-distinguish2}} (for custom text)
*{{tl|Redirect-distinguish6}}
*{{tl|About-distinguish}}
*{{tl|About-distinguish2}} (for custom text)
| group6 = For use in sections
| list6 =
*{{tl|Main}}
*{{tl|Further}}
*{{tl|Further2}} (for custom text)
*{{tl|Further ill}}
*{{tl|See also}}
*{{tl|See also if exists}}
*{{tl|For outline}}
| group7 = Special
| list7 =
*{{tl|Broader}}
*{{tl|See introduction}}
*{{tl|See Wiktionary}}
*{{tl|Transcluding article}}
*{{tl|Transcluded section}}
| group8 = Subject specific
| list8 =
* {{tl|Year dab}}
* {{tl|Highway detail hatnote}}
* {{tl|For LMST}}
* {{tl|WikiIPA}}
* {{tl|Other MeSH codes}}
| below =
*{{Icon|cat}} [[:Category:Hatnote templates]]
**[[:Category:Hatnote modules|modules]]
**[[:Category:Hatnote templates for names|for [family] names]]
**[[:Category:Hatnote templates for lists|for lists]]
*[[Template:Category hatnote templates|hatnote templates for category pages]]
}}<noinclude>
{{Documentation}}
</noinclude>
35662f9be74df2380a87afc245b795ce66b0e941
Template:Icon
10
209
416
2021-06-07T07:19:22Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Icon]]
wikitext
text/x-wiki
{{#invoke:Icon|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
bd5b855953c5eec9d9c48400aa39315cb4218558
Template:Small
10
115
228
2021-06-07T07:19:28Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Small]]
wikitext
text/x-wiki
<span style="font-size:85%;">{{{1}}}</span><includeonly>{{SAFESUBST:#if:{{{1|}}}||[[Category:Pages using small with an empty input parameter]]}}</includeonly><noinclude>
{{Documentation}}<!--Categories and interwikis go in the /doc sub-page.-->
</noinclude>
76d3535c2917cc3bfb1b032506073faa15e1a480
Module:Color contrast
828
197
392
2021-06-07T07:19:31Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Color_contrast]]
Scribunto
text/plain
--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB (v)
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum(R, G, B)
if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum(h, s, l)
if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 <= h and h < 60 ) then
r = r + c
g = g + x
elseif( 60 <= h and h < 120 ) then
r = r + x
g = g + c
elseif( 120 <= h and h < 180 ) then
g = g + c
b = b + x
elseif( 180 <= h and h < 240 ) then
g = g + x
b = b + c
elseif( 240 <= h and h < 300 ) then
r = r + x
b = b + c
elseif( 300 <= h and h < 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum(c)
if (c == nil) then
return ''
end
-- html '#' entity
c = c:gsub("#", "#")
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
return color2lum(color)
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 > v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg > lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.
Parameters:
-- |1= — required; A color to check.
--]]
function p.lum(frame)
local color = frame.args[1] or frame:getParent().args[1]
return p._lum(color)
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p
1e399769117591366a63f62996c9a407077cc711
Module:Color contrast/colors
828
198
394
2021-06-07T07:19:31Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Color_contrast/colors]]
Scribunto
text/plain
return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}
6ae47fdb24de4eed5ec26d203faf5341a388987b
Module:Icon
828
220
438
2021-06-07T07:19:32Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Icon]]
Scribunto
text/plain
-- This module implements [[Template:Icon]].
local data = mw.loadData('Module:Icon/data')
local p = {}
function p._main(args)
local code = args.class or args[1]
local iconData
if code then
code = code:match('^%s*(.-)%s*$'):lower() -- trim whitespace and put in lower case
iconData = data[code]
end
if not iconData then
iconData = data._DEFAULT
end
return string.format(
'[[File:%s%s|%s|link=]]',
iconData.image,
iconData.tooltip and '|' .. iconData.tooltip or '',
args.size or '16x16px'
)
end
function p.main(frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
args[k] = v
end
return p._main(args)
end
return p
2a9d51e44f8cd64c8eeb17655d5238da36908650
Module:Icon/data
828
221
440
2021-06-07T07:19:32Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Icon/data]]
Scribunto
text/plain
-- This module stores icon data for [[Module:Icon]].
--------------------------------------------------------------------------------
-- Icon data
--------------------------------------------------------------------------------
local data = {
fa = {
image = "Featured article star.svg",
tooltip = "Featured article",
},
far = {
image = "Cscr-star piece.png",
tooltip = "Featured article review",
},
farc = {
image = "Cscr-star piece.png",
tooltip = "Featured article removal candidate",
},
ffa = {
aliases = {"dfa"},
image = "Featured article star - cross.svg",
tooltip = "Former featured article",
},
fac = {
aliases = {"fan"},
image = "Cscr-candidate.svg",
tooltip = "Featured article candidate",
},
ffac = {
aliases = {"nofa"},
image = "Featured article star - cross.svg",
tooltip = "Failed featured article candidate",
},
fl = {
image = "Featured article star.svg",
tooltip = "Featured list",
},
flrc = {
aliases = {"flr"},
image = "Cscr-star piece.png",
tooltip = "Featured list removal candidate",
},
ffl = {
aliases = {"dfl"},
image = "Cscr-featured-strike.svg",
tooltip = "Former featured list",
},
flc = {
aliases = {"fln"},
image = "Cscr-candidate.svg",
tooltip = "Featured list candidate",
},
fflc = {
aliases = {"nofl"},
image = "Cscr-former.svg",
tooltip = "Failed featured list candidate",
},
a = {
image = "Symbol a class.svg",
tooltip = "A-Class article",
},
dac = {
aliases = {"daa"},
image = "Symbol unsupport A vote.svg",
tooltip = "Demoted A-Class article",
},
acc = {
aliases = {"acn", "aac"},
image = "A candidate.svg",
tooltip = "A-Class article candidate",
},
noac = {
aliases = {"faac"},
image = "Symbol unsupport A vote.svg",
tooltip = "Failed A-Class article candidate",
},
ga = {
image = "Symbol support vote.svg",
tooltip = "Good article",
},
gar = {
image = "GA Candidate Neutral vote(ChaosNil).svg",
tooltip = "Good article reassessment",
},
dga = {
image = "Symbol unsupport vote.svg",
tooltip = "Delisted good article",
},
gan = {
aliases = {"gac"},
image = "GA candidate.svg",
tooltip = "Good article nominee",
},
ga2 = {
image = "Symbol neutral vote.svg",
tooltip = "Good article, 2nd opinion",
},
gah = {
image = "Symbol wait.svg",
tooltip = "Good article on hold",
},
fgan = {
aliases = {"noga", "gaf", "gf"},
image = "Symbol oppose vote.svg",
tooltip = "Failed good article nominee",
},
fp = {
image = "Cscr-featured.svg",
tooltip = "Featured picture",
},
fpc = {
aliases = {"fpn"},
image = "Cscr-candidate.svg",
tooltip = "Featured picture candidate",
},
ffp = {
image = "Cscr-former.svg",
tooltip = "Former featured picture",
},
vp = {
image = "ENWP VP Logo.svg",
tooltip = "Valued picture",
},
vpc = {
image = "Valued pics 1.svg",
tooltip = "Valued picture candidate",
},
fs = {
image = "Cscr-featured.svg",
tooltip = "Featured sound",
},
ffs = {
image = "Cscr-former.svg",
tooltip = "Former featured sound",
},
fsc = {
image = "Cscr-candidate.svg",
tooltip = "Featured sound candidate",
},
fpo = {
image = "Linecons big-star.svg",
tooltip = "Before the featured portal process ceased in 2017, this had been designated as a featured portal.",
},
fpor = {
image = "Cscr-star piece.png",
tooltip = "Featured portal review",
},
ffpo = {
image = "Featured article star - cross.svg",
tooltip = "Former featured portal",
},
fpoc = {
image = "Cscr-candidate.svg",
tooltip = "Featured portal candidate",
},
ft = {
image = "Cscr-featuredtopic.svg",
tooltip = "Featured topic",
},
ftrc = {
image = "Cscr-star piece.png",
tooltip = "Featured topic removal candidate",
},
fft = {
aliases = {"dft"},
image = "DFT candidate_cluster.svg",
tooltip = "Former featured topic",
},
ftc = {
aliases = {"ftn"},
image = "FT candidate cluster.svg",
tooltip = "Featured topic candidate",
},
gt = {
image = "Support cluster.svg",
tooltip = "Good topic",
},
gtrc = {
image = "Symbol unsupport vote.svg",
tooltip = "Good topic removal candidate",
},
gtc = {
aliases = {"gtn"},
image = "GA candidate cluster.svg",
tooltip = "Good topic candidate",
},
bplus = {
aliases = {"b+"},
image = "Symbol bplus class.svg",
tooltip = "Bplus-Class article",
},
b = {
image = "Symbol b class.svg",
tooltip = "B-Class article",
},
br = {
aliases = {"bcr"},
image = "Bclass-checklist.svg",
tooltip = "B-Class review",
},
c = {
image = "Symbol c class.svg",
tooltip = "C-Class article",
},
start = {
image = "Symbol start class.svg",
tooltip = "Start-Class article",
},
stub = {
image = "Symbol stub class.svg",
tooltip = "Stub-Class article",
},
list = {
aliases = {"comparison"},
image = "Symbol list class.svg",
tooltip = "List-Class article",
},
no = {
image = "Crystal button cancel.svg",
tooltip = "Unknown-Class article",
},
book = {
image = "Symbol book class2.svg",
tooltip = "Wikipedia book",
},
category = {
aliases = {"cat", "categ"},
image = "Symbol category class.svg",
tooltip = "Category",
},
disambiguation = {
aliases = {"dab", "disamb", "disambig"},
image = "Symbol dab class.svg",
tooltip = "Disambiguation page",
},
image = {
aliases = {"file"},
image = "Symbol file class.svg",
tooltip = "File",
},
needed = {
image = "Symbol needed class.svg",
tooltip = "Needed article",
},
outline = {
image = "Global thinking.svg",
tooltip = "Outline",
},
portal = {
image = "Symbol portal class.svg",
tooltip = "Portal",
},
project = {
image = "Symbol project class.svg",
tooltip = "Project page",
},
redirect = {
aliases = {"red", "redir"},
image = "Symbol redirect vote2.svg",
tooltip = "Redirect",
},
template = {
aliases = {"temp", "templ"},
image = "Symbol template class.svg",
tooltip = "Template",
},
essay = {
image = "Essay.svg",
tooltip = "Essay",
},
na = {
image = "Symbol na class.svg",
tooltip = "Non-article page",
},
aa = {
image = "Yes check.svg",
tooltip = "Audited article of limited subject matter",
},
da = {
image = "Symbol oppose vote.svg",
tooltip = "Demoted article",
},
dyk = {
image = "Symbol question.svg",
tooltip = "Did You Know?",
},
dyk2 = {
image = "DYK questionmark icon.svg",
tooltip = "Did You Know?",
},
pr = {
image = "Nuvola apps kedit.png",
tooltip = "Peer review",
},
ppr = {
image = "Nuvola apps kedit.png",
tooltip = "Portal peer review",
},
q = {
aliases = {"question"},
image = "Symbol question.svg",
tooltip = "Question",
},
qi = {
image = "Quality images logo.svg",
tooltip = "Quality image on Wikimedia Commons",
},
vi = {
image = "Valued image seal.svg",
tooltip = "Valued image on Wikimedia Commons",
},
tfa = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured Article",
},
tfl = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured List",
},
itn = {
image = "Globe current.svg",
tooltip = "In The News",
},
otd = {
image = "Nuvola apps date.svg",
tooltip = "On This Day",
},
wikiproject = {
image = "People icon.svg",
tooltip = "WikiProject",
},
wikipedia = {
image = "Wikipedia-logo.svg",
tooltip = "Wikipedia page",
},
commons = {
image = "Commons-logo.svg",
tooltip = "Commons page",
},
wikiquote = {
image = "Wikiquote-logo.svg",
tooltip = "Wikiquote page",
},
wikiversity = {
image = "Wikiversity logo 2017.svg",
tooltip = "Wikiversity page",
},
wikibooks = {
image = "Wikibooks-logo.svg",
tooltip = "Wikibooks page",
},
wikisource = {
image = "Wikisource-logo.svg",
tooltip = "Wikisource page",
},
wiktionary = {
image = "Wiktionary-logo.svg",
tooltip = "Wiktionary page",
},
wikinews = {
image = "Wikinews-logo.svg",
tooltip = "Wikinews page",
},
wikispecies = {
image = "Wikispecies-logo.svg",
tooltip = "Wikispecies page",
},
wikidata = {
image = "Wikidata-logo.svg",
tooltip = "Wikidata page",
},
wikivoyage = {
image = "Wikivoyage-logo.svg",
tooltip = "Wikivoyage page",
},
meta = {
image = "Wikimedia Community Logo.svg",
tooltip = "Meta-wiki page",
},
four = {
image = "Four Award.svg",
tooltip = "Four Award",
},
million = {
image = "Million award logo.svg",
tooltip = "Million Award",
},
module = {
image = "Lua-logo-nolabel.svg",
tooltip = "Module",
},
vital = {
image = "Círculos_Concéntricos.svg",
tooltip = "Vital article",
},
_DEFAULT = {
image = "Symbol question.svg",
}
}
--------------------------------------------------------------------------------
-- End icon data
--------------------------------------------------------------------------------
-- Make aliases work the same as normal keys, and remove the "aliases" subtables.
for k, t in pairs(data) do
if t.aliases then
for i, alias in ipairs(t.aliases) do
data[alias] = t
end
t.aliases = nil
end
data[k] = t
end
return data
d4471053287e7914d77a91b1838e5f343be3d573
Module:Navbox
828
199
396
2021-06-07T07:19:34Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Module:Navbox]]
Scribunto
text/plain
--
-- This module implements {{Navbox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local getArgs -- lazily initialized
local args
local border
local listnums
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127'
local RESTART_MARKER = '\127_ODDEVEN0_\127'
local REGEX_MARKER = '\127_ODDEVEN(%d?)_\127'
local function striped(wikitext)
-- Return wikitext with markers replaced for odd/even striping.
-- Child (subgroup) navboxes are flagged with a category that is removed
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = '[[Category:Navbox orphans]]'
if border == 'subgroup' and args.orphan ~= 'yes' then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCat
end
local first, second = 'odd', 'even'
if args.evenodd then
if args.evenodd == 'swap' then
first, second = second, first
else
first = args.evenodd
second = first
end
end
local changer
if first == second then
changer = first
else
local index = 0
changer = function (code)
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(REGEX_MARKER, changer)) -- () omits gsub count
end
local function processItem(item, nowrapitems)
if item:sub(1, 2) == '{|' then
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n'
end
if nowrapitems == 'yes' then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match('^<span class="nowrap">') then
line = prefix .. '<span class="nowrap">' .. content .. '</span>'
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
local function renderNavBar(titleCell)
if args.navbar ~= 'off' and args.navbar ~= 'plain' and not (not args.name and mw.getCurrentFrame():getParent():getTitle():gsub('/sandbox$', '') == 'Template:Navbox') then
titleCell:wikitext(navbar{
args.name,
mini = 1,
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;box-shadow:none;padding:0;'
})
end
end
--
-- Title row
--
local function renderTitleRow(tbl)
if not args.title then return end
local titleRow = tbl:tag('tr')
if args.titlegroup then
titleRow
:tag('th')
:attr('scope', 'row')
:addClass('navbox-group')
:addClass(args.titlegroupclass)
:cssText(args.basestyle)
:cssText(args.groupstyle)
:cssText(args.titlegroupstyle)
:wikitext(args.titlegroup)
end
local titleCell = titleRow:tag('th'):attr('scope', 'col')
if args.titlegroup then
titleCell
:css('border-left', '2px solid #fdfdfd')
:css('width', '100%')
end
local titleColspan = 2
if args.imageleft then titleColspan = titleColspan + 1 end
if args.image then titleColspan = titleColspan + 1 end
if args.titlegroup then titleColspan = titleColspan - 1 end
titleCell
:cssText(args.basestyle)
:cssText(args.titlestyle)
:addClass('navbox-title')
:attr('colspan', titleColspan)
renderNavBar(titleCell)
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args.title))
:addClass(args.titleclass)
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItem(args.title))
end
--
-- Above/Below rows
--
local function getAboveBelowColspan()
local ret = 2
if args.imageleft then ret = ret + 1 end
if args.image then ret = ret + 1 end
return ret
end
local function renderAboveRow(tbl)
if not args.above then return end
tbl:tag('tr')
:tag('td')
:addClass('navbox-abovebelow')
:addClass(args.aboveclass)
:cssText(args.basestyle)
:cssText(args.abovestyle)
:attr('colspan', getAboveBelowColspan())
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', args.title and nil or mw.uri.anchorEncode(args.above))
:wikitext(processItem(args.above, args.nowrapitems))
end
local function renderBelowRow(tbl)
if not args.below then return end
tbl:tag('tr')
:tag('td')
:addClass('navbox-abovebelow')
:addClass(args.belowclass)
:cssText(args.basestyle)
:cssText(args.belowstyle)
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItem(args.below, args.nowrapitems))
end
--
-- List rows
--
local function renderListRow(tbl, index, listnum)
local row = tbl:tag('tr')
if index == 1 and args.imageleft then
row
:tag('td')
:addClass('noviewer')
:addClass('navbox-image')
:addClass(args.imageclass)
:css('width', '1px') -- Minimize width
:css('padding', '0px 2px 0px 0px')
:cssText(args.imageleftstyle)
:attr('rowspan', #listnums)
:tag('div')
:wikitext(processItem(args.imageleft))
end
if args['group' .. listnum] then
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args.title or args.above or args.group2) then
groupCell
:attr('id', mw.uri.anchorEncode(args.group1))
end
groupCell
:attr('scope', 'row')
:addClass('navbox-group')
:addClass(args.groupclass)
:cssText(args.basestyle)
:css('width', args.groupwidth or '1%') -- If groupwidth not specified, minimize width
groupCell
:cssText(args.groupstyle)
:cssText(args['group' .. listnum .. 'style'])
:wikitext(args['group' .. listnum])
end
local listCell = row:tag('td')
if args['group' .. listnum] then
listCell
:css('text-align', 'left')
:css('border-left-width', '2px')
:css('border-left-style', 'solid')
else
listCell:attr('colspan', 2)
end
if not args.groupwidth then
listCell:css('width', '100%')
end
local rowstyle -- usually nil so cssText(rowstyle) usually adds nothing
if index % 2 == 1 then
rowstyle = args.oddstyle
else
rowstyle = args.evenstyle
end
local listText = args['list' .. listnum]
local oddEven = ODD_EVEN_MARKER
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find('<th[^>]*"navbox%-title"') and RESTART_MARKER or 'odd'
end
listCell
:css('padding', '0px')
:cssText(args.liststyle)
:cssText(rowstyle)
:cssText(args['list' .. listnum .. 'style'])
:addClass('navbox-list')
:addClass('navbox-' .. oddEven)
:addClass(args.listclass)
:addClass(args['list' .. listnum .. 'class'])
:tag('div')
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
:wikitext(processItem(listText, args.nowrapitems))
if index == 1 and args.image then
row
:tag('td')
:addClass('noviewer')
:addClass('navbox-image')
:addClass(args.imageclass)
:css('width', '1px') -- Minimize width
:css('padding', '0px 0px 0px 2px')
:cssText(args.imagestyle)
:attr('rowspan', #listnums)
:tag('div')
:wikitext(processItem(args.image))
end
end
--
-- Tracking categories
--
local function needsHorizontalLists()
if border == 'subgroup' or args.tracking == 'no' then
return false
end
local listClasses = {
['plainlist'] = true, ['hlist'] = true, ['hlist hnum'] = true,
['hlist hwrap'] = true, ['hlist vcard'] = true, ['vcard hlist'] = true,
['hlist vevent'] = true,
}
return not (listClasses[args.listclass] or listClasses[args.bodyclass])
end
local function hasBackgroundColors()
for _, key in ipairs({'titlestyle', 'groupstyle', 'basestyle', 'abovestyle', 'belowstyle'}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
end
local function hasBorders()
for _, key in ipairs({'groupstyle', 'basestyle', 'abovestyle', 'belowstyle'}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
end
end
local function isIllegible()
local styleratio = require('Module:Color contrast')._styleratio
for key, style in pairs(args) do
if tostring(key):match("style$") then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
end
end
end
return false
end
local function getTrackingCategories()
local cats = {}
if needsHorizontalLists() then table.insert(cats, 'Navigational boxes without horizontal lists') end
if hasBackgroundColors() then table.insert(cats, 'Navboxes using background colours') end
if isIllegible() then table.insert(cats, 'Potentially illegible navboxes') end
if hasBorders() then table.insert(cats, 'Navboxes using borders') end
return cats
end
local function renderTrackingCategories(builder)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 then return end -- not in template space
local subpage = title.subpageText
if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end
for _, cat in ipairs(getTrackingCategories()) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
--
-- Main navbox tables
--
local function renderMainTable()
local tbl = mw.html.create('table')
:addClass('nowraplinks')
:addClass(args.bodyclass)
if args.title and (args.state ~= 'plain' and args.state ~= 'off') then
if args.state == 'collapsed' then args.state = 'mw-collapsed' end
tbl
:addClass('mw-collapsible')
:addClass(args.state or 'autocollapse')
end
tbl:css('border-spacing', 0)
if border == 'subgroup' or border == 'none' then
tbl
:addClass('navbox-subgroup')
:cssText(args.bodystyle)
:cssText(args.style)
else -- regular navbox - bodystyle and style will be applied to the wrapper table
tbl
:addClass('navbox-inner')
:css('background', 'transparent')
:css('color', 'inherit')
end
tbl:cssText(args.innerstyle)
renderTitleRow(tbl)
renderAboveRow(tbl)
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum)
end
renderBelowRow(tbl)
return tbl
end
function p._navbox(navboxArgs)
args = navboxArgs
listnums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match('^list(%d+)$')
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
border = mw.text.trim(args.border or args[1] or '')
if border == 'child' then
border = 'subgroup'
end
-- render the main body of the navbox
local tbl = renderMainTable()
-- render the appropriate wrapper around the navbox, depending on the border param
local res = mw.html.create()
if border == 'none' then
local nav = res:tag('div')
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args.title or args.above or (args.group1 and not args.group2) then
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title or args.above or args.group1))
else
nav:attr('aria-label', 'Navbox')
end
elseif border == 'subgroup' then
-- We assume that this navbox is being rendered in a list cell of a parent navbox, and is
-- therefore inside a div with padding:0em 0.25em. We start with a </div> to avoid the
-- padding being applied, and at the end add a <div> to balance out the parent's </div>
res
:wikitext('</div>')
:node(tbl)
:wikitext('<div>')
else
local nav = res:tag('div')
:attr('role', 'navigation')
:addClass('navbox')
:addClass(args.navboxclass)
:cssText(args.bodystyle)
:cssText(args.style)
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args.title or args.above or (args.group1 and not args.group2) then
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title or args.above or args.group1))
else
nav:attr('aria-label', 'Navbox')
end
end
if (args.nocat or 'false'):lower() == 'false' then
renderTrackingCategories(res)
end
return striped(tostring(res))
end
function p.navbox(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {'Template:Navbox'}})
-- Read the arguments in the order they'll be output in, to make references number in the right order.
local _
_ = args.title
_ = args.above
for i = 1, 20 do
_ = args["group" .. tostring(i)]
_ = args["list" .. tostring(i)]
end
_ = args.below
return p._navbox(args)
end
return p
2cf7f5642ab6c9fef529f7213094109a34f505c1
Template:Nowrap
10
167
332
2021-06-08T15:52:20Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Nowrap]]
wikitext
text/x-wiki
<span class="nowrap">{{{1}}}</span><noinclude>
{{documentation}}
<!-- Categories go on the /doc page; interwikis go to Wikidata. -->
</noinclude>
5d0dc6b6d89b37f4356242404f46138a4017f015
Template:Template link with link off
10
188
374
2021-06-08T15:52:24Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Template_link_with_link_off]]
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Tlf
10
189
376
2021-06-08T15:52:25Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Tlf]]
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Template:Warning
10
272
542
2021-06-08T15:55:35Z
mh>AlathraMC
0
1 revision imported from [[:templatewiki:Template:Warning]]
wikitext
text/x-wiki
{{Mbox
| name = Warning
| demospace = {{{demospace|}}}
| style = {{#if:{{{style|}}} |{{#if:{{{small|}}}||width:80%;}} {{{style}}} }}
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| type = content
| image = {{#if:{{{image|}}}| [[File:{{{image}}}|{{{imagesize|40px}}}|Warning]] }}
| small = {{{small|}}}
| smallimage = {{#if:{{{image|}}}| [[File:{{{image}}}|30px|Warning]]}}
| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
| textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
| text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
-->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
}}<noinclude>
<!-- Add categories to the /doc subpage; interwikis go to Wikidata. -->
{{Documentation}}
</noinclude>
69aba4841cf88381001597b31ca7596d2d733e58
Template:Basepage subpage
10
246
490
2021-06-08T20:21:42Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Basepage_subpage]]
wikitext
text/x-wiki
#REDIRECT [[Template:When on basepage]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
47118a1bed1942b7f143cdff1dec183002fc9f4b
Template:Clear
10
37
72
2021-06-08T20:21:46Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Clear]]
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:Module other
10
65
128
2021-06-08T20:21:58Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Module_other]]
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Module}}
| module
| other
}}
}}
| module = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
{{En-WP attribution notice|Template:Module other}}
</noinclude>
ceeac5e173d56465ffa326b9da4297ae8e8332ed
Template:Samp
10
261
520
2021-06-08T20:22:01Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Samp]]
wikitext
text/x-wiki
<samp {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="padding-left:0.4em; padding-right:0.4em; color:{{#if:{{{color|}}}|{{{color}}}|#666666}};{{#if:{{{style|}}}| {{{style}}}|}}" {{{#if:{{{lang|}}}|lang="{{{lang}}}" xml:lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</samp><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
</noinclude>
553832833b1ab286c2e8f26dce22e83d0ab05e47
Template:Side box
10
74
146
2021-06-08T20:22:02Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Side_box]]
wikitext
text/x-wiki
{{#invoke:Side box|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Side box}}
</noinclude>
12769bea87e40d845a35eaaa6e7be586354bffa3
Template:Sister project
10
75
148
2021-06-08T20:22:04Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Sister_project]]
wikitext
text/x-wiki
{{Side box
| metadata=no
| position = {{{position|}}}
| image =
{{#switch: {{{image|}}}
| none = <!-- "image=none", do nothing -->
| = <!-- No image fed, select an image -->
[[File:{{#switch: {{lc: {{{project|}}} }}
| commons = Commons-logo.svg
| meta|metawiki|m = Wikimedia Community Logo.svg
| wikibooks|wbk|wb|b = Wikibooks-logo-en-noslogan.svg
| wikidata|data = Wikidata-logo.svg
| wikiquote|quote|wqt|q = Wikiquote-logo.svg
| wikipedia|wp|w = Wikipedia-logo-v2.svg
| wikisource|source|ws|s = Wikisource-logo.svg
| wiktionary|wkt|wdy|d = Wiktionary-logo-en-v2.svg
| wikinews|news|wnw|n = Wikinews-logo.svg
| wikispecies|species = Wikispecies-logo.svg
| wikiversity|wvy|v = Wikiversity-logo.svg
| wikivoyage|voyage|voy = Wikivoyage-Logo-v3-icon.svg
| mediawiki|mw = Mediawiki.png
| outreachwiki|outreach = Wikimedia Outreach.png
| incubator = Incubator-notext.svg
| #default = Wikimedia-logo.svg
}}|40x40px|class=noviewer|alt=|link=
]]
| #default = {{{image|}}}
}}
| text = {{{text}}}
| below = {{{below|}}}
| imageright = {{{imageright|}}}
| class = plainlinks sistersitebox
}}<noinclude>{{Documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! -->{{En-WP attribution notice|Template:Sister project}}</noinclude>
1cebc91d76736248f563c18ef77654e9513d2a3e
Module:Citation/CS1/styles.css
828
92
182
2021-06-08T20:22:13Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Citation/CS1/styles.css]]
text
text/plain
/*-------------------------< O V E R R I D E S >--------------------------------
cs1|2 references are wrapped in <cite>...</cite> tags. Some wikis have not
chosen to override the generic user agent italic styling as en.wiki has. This
(untested) styling should override the user agent default when cs1|2 templates
are rendered.
Similarly, some languages use different quotation punctuation so that setting
is also made available here.
*/
cite.citation {
/* Reset italic styling set by user agent (only for cs1|2 templates; the
reason for the .citation qualifier) */
font-style: inherit;
}
.citation q {
/* Straight quote marks for <q>; keep same as [[MediaWiki:Common.css]] */
quotes: '"' '"' "'" "'";
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
the .id-lock-... selectors are for use by non-citation templates like {{Catalog lookup link}}
*/
.id-lock-free a,
.citation .cs1-lock-free a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg);
background-repeat: no-repeat;
background-size: 9px;
background-position: right .1em center;
}
.id-lock-limited a,
.id-lock-registration a,
.citation .cs1-lock-limited a,
.citation .cs1-lock-registration a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg);
background-repeat: no-repeat;
background-size: 9px;
background-position: right .1em center;
}
.id-lock-subscription a,
.citation .cs1-lock-subscription a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg);
background-repeat: no-repeat;
background-size: 9px;
background-position: right .1em center;
}
.cs1-subscription,
.cs1-registration {
color: #555;
}
.cs1-subscription span,
.cs1-registration span {
border-bottom: 1px dotted;
cursor: help;
}
/* Wikisource icon
Experiment to see if it is possible/practical to add support for a wikisource
icon when |chapter= or |title= is wikilinked to a source in wikisource ala cite wikisource
*/
.cs1-ws-icon a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg);
background-repeat: no-repeat;
background-size: 12px;
background-position: right .1em center;
}
/* Errors and maintenance */
code.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: inherit; /* code editor doesn't like inherit with border?
https://www.w3.org/wiki/CSS/Properties/border
suggests that inherit is ok
the actual spec says the code editor is correct:
https://www.w3.org/TR/css-backgrounds-3/#borders
*/
padding: inherit;
}
.cs1-hidden-error {
display: none;
font-size: 100%;
}
.cs1-visible-error {
font-size: 100%;
}
.cs1-maint {
display: none;
color: #33aa33;
margin-left: 0.3em;
}
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-subscription,
.cs1-registration,
.cs1-format {
font-size: 95%;
}
/* kerning */
.cs1-kern-left,
.cs1-kern-wl-left {
padding-left: 0.2em;
}
.cs1-kern-right,
.cs1-kern-wl-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
6f79638de6f527eb5ee697056cfd51bf2ad213ae
Module:Lang
828
97
192
2021-06-08T20:22:16Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Lang]]
Scribunto
text/plain
--[=[
Lua support for the {{lang}}, {{lang-xx}}, and {{transl}} templates and replacement of various supporting templates.
]=]
require('Module:No globals');
local getArgs = require ('Module:Arguments').getArgs;
local unicode = require ("Module:Unicode data"); -- for is_latin() and is_rtl()
local yesno = require ('Module:Yesno');
local lang_data = mw.loadData ('Module:Lang/data'); -- language name override and transliteration tool-tip tables
local lang_name_table = lang_data.lang_name_table; -- language codes, names, regions, scripts, suppressed scripts
local lang_table = lang_data.lang_name_table.lang;
local lang_dep_table = lang_data.lang_name_table.lang_dep;
local script_table = lang_data.lang_name_table.script;
local region_table = lang_data.lang_name_table.region;
local variant_table = lang_data.lang_name_table.variant;
local suppressed_table = lang_data.lang_name_table.suppressed;
local override_table = lang_data.override;
local synonym_table = mw.loadData ('Module:Lang/ISO 639 synonyms'); -- ISO 639-2/639-2T code translation to 639-1 code
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
local this_wiki_lang = mw.language.getContentLanguage().code; -- get this wiki's language
local initial_style_state; -- set by lang_xx_normal() and lang_xx_italic()
local maint_cats = {}; -- maintenance categories go here
local maint_msgs = {}; -- and their messages go here
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '');
end
--[[--------------------------< I N V E R T _ I T A L I C S >-------------------------------------------------
This function attempts to invert the italic markup a args.text by adding/removing leading/trailing italic markup
in args.text. Like |italic=unset, |italic=invert disables automatic italic markup. Individual leading/trailing
apostrophes are converted to their html numeric entity equivalent so that the new italic markup doesn't become
bold markup inadvertently.
Leading and trailing wiki markup is extracted from args.text into separate table elements. Addition, removal,
replacement of wiki markup is handled by a string.gsub() replacement table operating only on these separate elements.
In the string.gsub() matching pattern, '.*' matches empty string as well as the three expected wiki markup patterns.
This function expects that markup in args.text is complete and correct; if it is not, oddness may result.
]]
local function invert_italics (source)
local invert_pattern_table = { -- leading/trailing markup add/remove/replace patterns
[""]="\'\'", -- empty string becomes italic markup
["\'\'"]="", -- italic markup becomes empty string
["\'\'\'"]="\'\'\'\'\'", -- bold becomes bold italic
["\'\'\'\'\'"]="\'\'\'", -- bold italic become bold
};
local seg = {};
source = source:gsub ("%f[\']\'%f[^\']", '''); -- protect single quote marks from being interpreted as bold markup
seg[1] = source:match ('^(\'\'+%f[^\']).+') or ''; -- get leading markup, if any; ignore single quote
seg[3] = source:match ('.+(%f[\']\'\'+)$') or ''; -- get trailing markup, if any; ignore single quote
if '' ~= seg[1] and '' ~= seg[3] then -- extract the 'text'
seg[2] = source:match ('^\'\'+%f[^\'](.+)%f[\']\'\'+$') -- from between leading and trailing markup
elseif '' ~= seg[1] then
seg[2] = source:match ('^\'\'+%f[^\'](.+)') -- following leading markup
elseif '' ~= seg[3] then
seg[2] = source:match ('(.+)%f[\']\'\'+$') -- preceding trailing markup
else
seg[2] = source -- when there is no markup
end
seg[1] = invert_pattern_table[seg[1]] or seg[1]; -- replace leading markup according to pattern table
seg[3] = invert_pattern_table[seg[3]] or seg[3]; -- replace leading markup according to pattern table
return table.concat (seg); -- put it all back together and done
end
--[[--------------------------< V A L I D A T E _ I T A L I C >------------------------------------------------
validates |italic= or |italics= assigned values.
When |italic= is set and has an acceptible assigned value, return the matching css font-style property value or,
for the special case 'default', return nil.
When |italic= is not set, or has an unacceptible assigned value, return nil and a nil error message.
When both |italic= and |italics= are set, returns nil and a 'conflicting' error message.
The return value nil causes the calling lang, lang_xx, or transl function to set args.italic according to the template's
defined default ('inherit' for {{lang}}, 'inherit' or 'italic' for {{lang-xx}} depending on
the individual template's requirements, 'italic' for {{transl}}) or to the value appropriate to |script=, if set ({{lang}}
and {{lang-xx}} only).
Accepted values and the values that this function returns are are:
nil - when |italic= absent or not set; returns nil
default - for completeness, should rarely if ever be used; returns nil
yes - force args.text to be rendered in italic font; returns 'italic'
no - force args.text to be rendered in normal font; returns 'normal'
unset - disables font control so that font-style applied to text is dictated by markup inside or outside the template; returns 'inherit'
invert - disables font control so that font-style applied to text is dictated by markup outside or inverted inside the template; returns 'invert'
]]
local function validate_italic (args)
local properties = {['yes'] = 'italic', ['no'] = 'normal', ['unset'] = 'inherit', ['invert'] = 'invert', ['default'] = nil};
local count = 0
for _, arg in pairs {'italic', 'italics', 'i'} do
if args[arg] then
count = count + 1
end
end
if count > 1 then -- return nil and an error message if more than one is set
return nil, 'only one of |italic=, |italics=, or |i= can be specified';
end
return properties[args.italic or args.italics or args.i], nil; -- return an appropriate value and a nil error message
end
--[=[--------------------------< V A L I D A T E _ C A T _ A R G S >----------------------------------------------------------
Default behavior of the {{lang}} and {{lang-xx}} templates is to add categorization when the templates are used in mainspace.
This default functionality may be suppressed by setting |nocat=yes or |cat=no. This function selects one of these two parameters
to control categorization.
Because having two parameters with 'opposite' names and 'opposite' values is confusing, this function accepts only affirmative
values for |nocat= and only negative values for |cat=; in both cases the 'other' sense (and non-sense) is not accepted and the
parameter is treated as if it were not set in the template.
Sets args.nocat to true if categorization is to be turned off; to nil if the default behavior should apply.
Accepted values for |nocat= are the text strings:
'yes', 'y', 'true', 't', on, '1' -- [[Module:Yesno]] returns logical true for all of these; false or nil else
for |cat=
'no', 'n', 'false', 'f', 'off', '0' -- [[Module:Yesno]] returns logical false for all of these; true or nil else
]=]
local function validate_cat_args (args)
if not (args.nocat or args.cat) then -- both are nil, so categorize
return;
end
if false == yesno (args.cat) or true == yesno (args.nocat) then
args.nocat = true; -- set to true when args.nocat is affirmative; nil else (as if the parameter were not set in the template)
else -- args.nocat is the parameter actually used.
args.nocat = nil;
end
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array ( needle, haystack )
if needle == nil then
return false;
end
for n,v in ipairs( haystack ) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< F O R M A T _ I E T F _ T A G >------------------------------------------------
prettify ietf tags to use recommended subtag formats:
code: lower case
script: sentence case
region: upper case
variant: lower case
private: lower case prefixed with -x-
]]
local function format_ietf_tag (code, script, region, variant, private)
local out = {};
if is_set (private) then
return table.concat ({code:lower(), 'x', private:lower()}, '-'); -- if private, all other tags ignored
end
table.insert (out, code:lower());
if is_set (script) then
script = script:lower():gsub ('^%a', string.upper);
table.insert (out, script);
end
if is_set (region) then
table.insert (out, region:upper());
end
if is_set (variant) then
table.insert (out, variant:lower());
end
return table.concat (out, '-');
end
--[[--------------------------< G E T _ I E T F _ P A R T S >--------------------------------------------------
extracts and returns IETF language tag parts:
primary language subtag (required) - 2 or 3 character IANA language code
script subtag - four character IANA script code
region subtag - two-letter or three digit IANA region code
variant subtag - four digit or 5-8 alnum variant code; only one variant subtag supported
private subtag - x- followed by 1-8 alnum private code; only supported with the primary language tag
in any one of these forms
lang lang-variant
lang-script lang-script-variant
lang-region lang-region-variant
lang-script-region lang-script-region-variant
lang-x-private
each of lang, script, region, variant, and private, when used, must be valid
Languages with both two- and three-character code synonyms are promoted to the two-character synonym because
the IANA registry file omits the synonymous three-character code; we cannot depend on browsers understanding
the synonymous three-character codes in the lang= attribute.
For {{lang-xx}} templates, the parameters |script=, |region=, and |variant= are supported (not supported in {{lang}}
because those parameters are superfluous to the IETF subtags in |code=)
returns six values; all lower case. Valid parts are returned as themselves; omitted parts are returned as empty strings, invalid
parts are returned as nil; the sixth returned item is an error message (if an error detected) or nil.
see http://www.rfc-editor.org/rfc/bcp/bcp47.txt section 2.1
]]
local function get_ietf_parts (source, args_script, args_region, args_variant)
local code, script, region, variant, private; -- ietf tag parts
if not is_set (source) then
return nil, nil, nil, nil, nil, 'missing language tag';
end
local pattern = { -- table of tables holding acceptibe ietf tag patterns and short names of the ietf part captured by the pattern
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 1 - ll-Ssss-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 2 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 3 - ll-Ssss-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 4 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d%d)$', 's', 'v'}, -- 5 - ll-Ssss-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'v'}, -- 6 - ll-Ssss-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a)%-(%d%d%d%d)$', 'r', 'v'}, -- 7 - ll-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%d%d%d)%-(%d%d%d%d)$', 'r', 'v'}, -- 8 - ll-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 9 - ll-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 10 - ll-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d%d)$', 'v'}, -- 11 - ll-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%w%w%w%w%w%w?%w?%w?)$', 'v'}, -- 12 - ll-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)$', 's', 'r'}, -- 13 - ll-Ssss-RR
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)$', 's', 'r'}, -- 14 - ll-Ssss-DDD (region is 3 digits)
{'^(%a%a%a?)%-(%a%a%a%a)$', 's'}, -- 15 - ll-Ssss
{'^(%a%a%a?)%-(%a%a)$', 'r'}, -- 16 - ll-RR
{'^(%a%a%a?)%-(%d%d%d)$', 'r'}, -- 17 - ll-DDD (region is 3 digits)
{'^(%a%a%a?)$'}, -- 18 - ll
{'^(%a%a%a?)%-x%-(%w%w?%w?%w?%w?%w?%w?%w?)$', 'p'}, -- 19 - ll-x-pppppppp (private is 1-8 alnum characters)
}
local t = {}; -- table of captures; serves as a translator between captured ietf tag parts and named variables
for i, v in ipairs (pattern) do -- spin through the pattern table looking for a match
local c1, c2, c3, c4; -- captures in the 'pattern' from the pattern table go here
c1, c2, c3, c4 = source:match (pattern[i][1]); -- one or more captures set if source matches pattern[i])
if c1 then -- c1 always set on match
code = c1; -- first capture is always code
t = {
[pattern[i][2] or 'x'] = c2, -- fill the table of captures with the rest of the captures
[pattern[i][3] or 'x'] = c3, -- take index names from pattern table and assign sequential captures
[pattern[i][4] or 'x'] = c4, -- index name may be nil in pattern[i] table so "or 'x'" spoofs a name for this index in this table
};
script = t.s or ''; -- translate table contents to named variables;
region = t.r or ''; -- absent table entries are nil so set named ietf parts to empty string for concatenation
variant= t.v or '';
private = t.p or '';
break; -- and done
end
end
if not code then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language tag: ', source}); -- don't know what we got but it is malformed
end
code = code:lower(); -- ensure that we use and return lower case version of this
if not (override_table[code] or lang_table[code] or synonym_table[code] or lang_dep_table[code]) then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language code: ', code}); -- invalid language code, don't know about the others (don't care?)
end
if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym
table.insert (maint_cats, table.concat ({'Lang and lang-xx code promoted to ISO 639-1|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' promoted to code: ', synonym_table[code]}));
code = synonym_table[code]; -- use the synonym
end
if is_set (script) then
if is_set (args_script) then
return code, nil, nil, nil, nil, 'redundant script tag'; -- both code with script and |script= not allowed
end
else
script = args_script or ''; -- use args.script if provided
end
if is_set (script) then
script = script:lower(); -- ensure that we use and return lower case version of this
if not script_table[script] then
return code, nil, nil, nil, nil, table.concat ({'unrecognized script: ', script, ' for code: ', code}); -- language code ok, invalid script, don't know about the others (don't care?)
end
end
if suppressed_table[script] then -- ensure that code-script does not use a suppressed script
if in_array (code, suppressed_table[script]) then
return code, nil, nil, nil, nil, table.concat ({'script: ', script, ' not supported for code: ', code}); -- language code ok, script is suppressed for this code
end
end
if is_set (region) then
if is_set (args_region) then
return code, nil, nil, nil, nil, 'redundant region tag'; -- both code with region and |region= not allowed
end
else
region = args_region or ''; -- use args.region if provided
end
if is_set (region) then
region = region:lower(); -- ensure that we use and return lower case version of this
if not region_table[region] then
return code, script, nil, nil, nil, table.concat ({'unrecognized region: ', region, ' for code: ', code});
end
end
if is_set (variant) then
if is_set (args_variant) then
return code, nil, nil, nil, nil, 'redundant variant tag'; -- both code with variant and |variant= not allowed
end
else
variant = args_variant or ''; -- use args.variant if provided
end
if is_set (variant) then
variant = variant:lower(); -- ensure that we use and return lower case version of this
if not variant_table[variant] then -- make sure variant is valid
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant});
end -- does this duplicate/replace tests in lang() and lang_xx()?
if is_set (script) then -- if script set it must be part of the 'prefix'
if not in_array (table.concat ({code, '-', script}), variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-script pair: ', code, '-', script});
end
elseif is_set (region) then -- if region set, there are some prefixes that require lang code and region (en-CA-newfound)
if not in_array (code, variant_table[variant]['prefixes']) then -- first see if lang code is all that's required (en-oxendict though en-GB-oxendict is preferred)
if not in_array (table.concat ({code, '-', region}), variant_table[variant]['prefixes']) then -- now try for lang code and region (en-CA-newfound)
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-region pair: ', code, '-', region});
end
end
else -- cheap way to determine if there are prefixes; fonipa and others don't have prefixes; # operator always returns 0
if variant_table[variant]['prefixes'][1] and not in_array (code, variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code: ', code});
end
end
end
if is_set (private) then
private = private:lower(); -- ensure that we use and return lower case version of this
if not override_table[table.concat ({code, '-x-', private})] then -- make sure private tag is valid; note that index
return code, script, region, nil, nil, table.concat ({'unrecognized private tag: ', private});
end
end
return code, script, region, variant, private, nil; -- return the good bits; make sure that msg is nil
end
--[[--------------------------< M A K E _ E R R O R _ M S G >--------------------------------------------------
assembles an error message from template name, message text, help link, and error category.
]]
local function make_error_msg (msg, args, template)
local out = {};
local category;
if 'Transl' == template then
category = 'Transl';
else
category = 'Lang and lang-xx'
end
table.insert (out, table.concat ({'[', args.text or 'undefined', '] '})); -- for error messages output args.text if available
table.insert (out, table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: {{', template, '}}: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[:Category:', category, ' template errors|help]])'}));
table.insert (out, '</span>');
if (0 == namespace or 10 == namespace) and not args.nocat then -- categorize in article space (and template space to take care of broken usages)
table.insert (out, table.concat ({'[[Category:', category, ' template errors]]'}));
end
return table.concat (out);
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an
empty string.
]=]
local function make_wikilink (link, display)
if is_set (link) then
if is_set (display) then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
else
return '';
end
end
--[[--------------------------< D I V _ M A R K U P _ A D D >--------------------------------------------------
adds <i> and </i> tags to list-item text or to implied <p>..</p> text. mixed not supported
]]
local function div_markup_add (text, style)
local implied_p = {};
if text:find ('^\n[%*:;#]') then -- look for list markup; list markup must begin at start of text
if 'italic' == style then
return mw.ustring.gsub (text, '(\n[%*:;#]+)([^\n]+)', '%1<i>%2</i>'); -- insert italic markup at each list item
else
return text;
end
end
if text:find ('\n+') then -- look for any number of \n characters in text
text = text:gsub ('([^\n])\n([^\n])', '%1 %2'); -- replace single newline characters with a space character which mimics mediawiki
if 'italic' == style then
text = text:gsub('[^\n]+', '<p><i>%1</i></p>'); -- insert p and italic markup tags at each impled p (two or more consecutive '\n\n' sequences)
else
text = text:gsub ('[^\n]+', '<p>%1</p>'); -- insert p markup at each impled p
text = text:gsub ('\n', ''); -- strip newline characters
end
end
return text;
end
--[[--------------------------< M A K E _ T E X T _ H T M L >--------------------------------------------------
Add the html markup to text according to the type of content that it is: <span> or <i> tags for inline content or
<div> tags for block content
]]
local function make_text_html (code, text, tag, rtl, style, size, language)
local html = {};
local style_added = '';
if text:match ('^%*') then
table.insert (html, '*'); -- move proto language text prefix outside of italic markup if any; use numeric entity because plain splat confuses MediaWiki
text = text:gsub ('^%*', ''); -- remove the splat from the text
end
if 'span' == tag then -- default html tag for inline content
if 'italic' == style then -- but if italic
tag = 'i'; -- change to <i> tags
end
else -- must be div so go
text = div_markup_add (text, style); -- handle implied <p>, implied <p> with <i>, and list markup (*;:#) with <i>
end
table.insert (html, table.concat ({'<', tag})); -- open the <i>, <span>, or <div> html tag
code = code:gsub ('%-x%-.*', ''); -- strip private use subtag from code tag because meaningless outside of wikipedia
table.insert (html, table.concat ({' lang="', code, '\"'})); -- add language attribute
if rtl or unicode.is_rtl(text) then
table.insert (html, ' dir="rtl"'); -- add direction attribute for right to left languages
end
if 'normal' == style then -- when |italic=no
table.insert (html, ' style=\"font-style: normal;'); -- override external markup, if any
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
if is_set (size) then -- when |size=<something>
if is_set (style_added) then
table.insert (html, table.concat ({' font-size: ', size, ';'})); -- add when style attribute already inserted
else
table.insert (html, table.concat ({' style=\"font-size: ', size, ';'})); -- create style attribute
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
end
if is_set (language) then
table.insert (html, table.concat ({style_added, ' title=\"', language})); --start the title text
if language:find ('languages') then
table.insert (html, ' collective text'); -- for collective languages
else
table.insert (html, '-language text'); -- for individual languages
end
table.insert (html, '\">'); -- close the opening html tag
else
table.insert (html, table.concat ({style_added, '>'})); -- close the style attribute and close opening html tag
end
table.insert (html, text); -- insert the text
table.insert (html, table.concat ({'</', tag, '>'})); -- close the <i>, <span>, or <div> html tag
if rtl then -- legacy; shouldn't be necessary because all of the rtl text is wrapped inside an html tag with dir="rtl" attribute
table.insert (html, '‎'); -- make sure the browser knows that we're at the end of the rtl
end
return table.concat (html); -- put it all together and done
end
--[=[-------------------------< M A K E _ C A T E G O R Y >----------------------------------------------------
For individual language, <language>, returns:
[[Category:Articles containing <language>-language text]]
for English:
[[Category:Articles containing explicitly cited English-language text]]
for ISO 639-2 collective languages (and for 639-1 bh):
[[Category:Articles with text in <language> languages]]
]=]
local function make_category (code, language_name, nocat, name_get)
local cat = {};
local retval;
if ((0 ~= namespace) or nocat) and not name_get then -- only categorize in article space
return ''; -- return empty string for concatenation
end
if language_name:find ('languages') then
return table.concat ({'[[Category:Articles with text in ', language_name, ']]'});
end
table.insert (cat, '[[Category:Articles containing ');
if 'en' == code then
table.insert (cat, 'explicitly cited ' .. language_name); -- falls back to English if regional name not available
else
table.insert (cat, language_name);
end
table.insert (cat, '-language text]]');
return table.concat (cat);
end
--[[--------------------------< M A K E _ T R A N S L I T >----------------------------------------------------
return translit <i lang=xx-Latn>...</i> where xx is the language code; else return empty string
The value |script= is not used in {{transl}} for this purpose; instead it uses |code. Because language scripts
are listed in the {{transl}} switches they are included in the data tables. The script parameter is introduced
at {{Language with name and transliteration}}. If |script= is set, this function uses it in preference to code.
To avoid confusion, in this module and the templates that use it, the transliteration script parameter is renamed
to be |translit-script= (in this function, tscript)
This function is used by both lang_xx() and transl()
lang_xx() always provides code, language_name, and translit; may provide tscript; never provides style
transl() always provides language_name, translit, and one of code or tscript, never both; always provides style
For {{transl}}, style only applies when a language code is provided
]]
local function make_translit (code, language_name, translit, std, tscript, style)
local title;
local tout = {};
local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
if is_set (code) then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
if not style then -- nil for the default italic style
table.insert (tout, "<i lang=\""); -- so use <i> tag
else
table.insert (tout, table.concat ({'<span style=\"font-style: ', style, '\" lang=\"'})); -- non-standard style, construct a span tag for it
end
table.insert (tout, code);
table.insert (tout, "-Latn\" title=\""); -- transliterations are always Latin script
else
table.insert (tout, "<span title=\""); -- when no language code: no lang= attribute, not italic ({{transl}} only)
end
std = std and std:lower(); -- lower case for table indexing
if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified
table.insert (tout, language_name); -- write a generic tool tip
if not language_name:find ('languages') then -- collective language names (plural 'languages' is part of the name)
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
table.insert (tout, ' romanization'); -- finish the tool tip; use romanization when neither script nor standard supplied
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_table[std] then -- and if standard is legitimate
if title_table[std][tscript] then -- and if script for that standard is legitimate
table.insert (tout, table.concat ({title_table[std][tscript:lower()], ' (', script_table[tscript][1], ' script) transliteration'})); -- add the appropriate text to the tool tip
else
table.insert (tout, title_table[std]['default']); -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard?
end
else
return ''; -- invalid standard, setup for error message
end
elseif is_set (std) then -- translit-script not set, use language code
if not title_table[std] then return ''; end -- invalid standard, setup for error message
if title_table[std][code] then -- if language code is in the table (transl may not provide a language code)
-- table.insert (tout, table.concat ({title_table[std][code:lower()], ' (', lang_table[code][1], ' language) transliteration'})); -- add the appropriate text to the tool tip
table.insert (tout, table.concat ({title_table[std][code:lower()], ' (', language_name, ' language) transliteration'})); -- add the appropriate text to the tool tip
else -- code doesn't match
table.insert (tout, title_table[std]['default']); -- so use the standard's default
end
else -- here if translit-script set but translit-std not set
if title_table['no_std'][tscript] then
table.insert (tout, title_table['no_std'][tscript]); -- use translit-script if set
elseif title_table['no_std'][code] then
table.insert (tout, title_table['no_std'][code]); -- use language code
else
if is_set (tscript) then
table.insert (tout, table.concat ({language_name, '-script transliteration'})); -- write a script tool tip
elseif is_set (code) then
if not language_name:find ('languages') then -- collective language names (plural 'languages' is part of the name)
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
table.insert (tout, ' transliteration'); -- finish the tool tip
else
table.insert (tout, ' transliteration'); -- generic tool tip (can we ever get here?)
end
end
end
table.insert (tout, '">');
table.insert (tout, translit);
if is_set (code) and not style then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
table.insert (tout, "</i>"); -- close the italic tag
else
table.insert (tout, "</span>"); -- no language code so close the span tag
end
return table.concat (tout);
end
--[[--------------------------< V A L I D A T E _ T E X T >----------------------------------------------------
This function checks the content of args.text and returns empty string if nothing is amiss else it returns an
error message. The tests are for empty or missing text and for improper or disallowed use of apostrophe markup.
Italic rendering is controlled by the |italic= template parameter so italic markup should never appear in args.text
either as ''itself'' or as '''''bold italic''''' unless |italic=unset or |italic=invert.
]]
local function validate_text (template, args)
if not is_set (args.text) then
return make_error_msg ('no text', args, template);
end
if args.text:find ("%f[\']\'\'\'\'%f[^\']") or args.text:find ("\'\'\'\'\'[\']+") then -- because we're looking, look for 4 appostrophes or 6+ appostrophes
return make_error_msg ('text has malformed markup', args, template);
end
local style = args.italic;
if ('unset' ~= style) and ('invert' ~=style) then
if args.text:find ("%f[\']\'\'%f[^\']") or args.text:find ("%f[\']\'\'\'\'\'%f[^\']") then -- italic but not bold, or bold italic
return make_error_msg ('text has italic markup', args, template);
end
end
end
--[[--------------------------< R E N D E R _ M A I N T >------------------------------------------------------
render mainenance messages and categories
]]
local function render_maint(nocat)
local maint = {};
if 0 < #maint_msgs then -- when there are maintenance messages
table.insert (maint, table.concat ({'<span class="lang-comment" style="font-style: normal; display: none; color: #33aa33; margin-left: 0.3em;">'})); -- opening <span> tag
for _, msg in ipairs (maint_msgs) do
table.insert (maint, table.concat ({msg, ' '})); -- add message strings
end
table.insert (maint, '</span>'); -- close the span
end
if (0 < #maint_cats) and (0 == namespace) and not nocat then -- when there are maintenance categories; article namespace only
for _, cat in ipairs (maint_cats) do
table.insert (maint, table.concat ({'[[Category:', cat, ']]'})); -- format and add the categories
end
end
return table.concat (maint);
end
--[[--------------------------< P R O T O _ P R E F I X >------------------------------------------------------
for proto languages, text is prefixed with a splat. We do that here as a flag for make_text_html() so that a splat
will be rendered outside of italic markup (if used). If the first character in text here is already a splat, we
do nothing
proto_param is boolean or nil; true adds splat prefix regardless of language name; false removes and / or inhibits
regardless of language name; nil does nothing; presumes that the value in text is correct but removes extra splac
]]
local function proto_prefix (text, language_name, proto_param)
if false == proto_param then -- when forced by |proto=no
return text:gsub ('^%**', ''); -- return text without splat prefix regardless of language name or existing splat prefix in text
elseif (language_name:find ('^Proto%-') or (true == proto_param)) then -- language is a proto or forced by |proto=yes
return text:gsub ('^%**', '*'); -- prefix proto-language text with a splat; also removes duplicate prefixing splats
end
return text:gsub ('^%*+', '*'); -- return text unmolested except multiple splats reduced to one splat
end
--[[--------------------------< H A S _ P O E M _ T A G >------------------------------------------------------
looks for a poem strip marker in text; returns true when found; false else
auto-italic detection disabled when text has poem stripmarker because it is not possible for this code to know
the content that will replace the stripmarker.
]]
local function has_poem_tag (text)
return text:find ('\127[^\127]*UNIQ%-%-poem%-[%a%d]+%-QINU[^\127]*\127') and true or false;
end
--[[--------------------------< H T M L _ T A G _ S E L E C T >------------------------------------------------
Inspects content of and selectively trims text. Returns text and the name of an appropriate html tag for text.
If text contains:
\n\n text has implied <p>..</p> tags - trim leading and trailing whitespace and return
If text begins with list markup:
\n* unordered
\n; definition
\n: definition
\n# ordered
trim all leading whitespace except \n and trim all trailing whitespace
If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because
the stripmarker is replaced with text wrapped in <div>..</div> tags.
]]
local function html_tag_select (text)
local tag;
if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that)
tag = 'div'; -- poem replacement is in div tags so lang must use div tags
elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags
text = mw.text.trim (text); -- trim leading and trailing whitespace characters
tag = 'div'; -- must be div because span may not contain p tags (added later by MediaWiki); poem replacement is in div tags
elseif text:find ('\n[%*:;%#]') then -- if text has list markup
text = text:gsub ('^[\t\r\f ]*', ''):gsub ('%s*$', ''); -- trim all whitespace except leading newline character '\n'
tag = 'div'; -- must be div because span may not contain ul, dd, dl, ol tags (added later by MediaWiki)
else
text = mw.text.trim (text); -- plain text
tag = 'span'; -- so span is fine
end
return text, tag;
end
--[[--------------------------< V A L I D A T E _ P R O T O >--------------------------------------------------
validates value assigned to |proto=; permitted values are yes and no; yes returns as true, no returns as false,
empty string (or parameter omitted) returns as nil; any other value returns as nil with a second return value of
true indicating that some other value has been assigned to |proto=
]]
local function validate_proto (proto_param)
if 'yes' == proto_param then
return true;
elseif 'no' == proto_param then
return false;
elseif is_set (proto_param) then
return nil, true; -- |proto= something other than 'yes' or 'no'
else
return nil; -- missing or empty
end
end
--[[--------------------------< L A N G U A G E _ N A M E _ G E T >--------------------------------------------
common function to return language name from the data set according to IETF tag
returns language name if found in data tables; nil else
]]
local function language_name_get (ietf, code, cat)
ietf = ietf:lower(); -- ietf:lower() because format_ietf_tag() returns mixed case
local name; -- remains nil if not found
if override_table[ietf] then -- look for whole IETF tag in override table
name = override_table[ietf][1];
elseif override_table[code] then -- not there so try basic language code
name = override_table[code][1];
elseif lang_table[code] then -- shift to iana code/name table
name = lang_table[code][1]; -- table entries sometimes have multiple names, always take the first one
elseif lang_dep_table[code] then
-- if cat then
-- table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code}));
-- table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'}));
-- end
name = lang_dep_table[code][1]; -- table entries sometimes have multiple names, always take the first one
end
if lang_dep_table[code] and cat then -- because deprecated code may have been overridden to en.wiki preferred name
table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'}));
end
return name; -- name from data tables or nil
end
--[[--------------------------< _ L A N G >--------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function _lang (args)
local out = {};
local language_name; -- used to make category names
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, variant, and private
local code; -- the language code
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang';
validate_cat_args (args); -- determine if categorization should be suppressed
if args[1] and args.code then
return make_error_msg ('conflicting: {{{1}}} and |code=', args, template);
else
args.code = args[1] or args.code; -- prefer args.code
end
if args[2] and args.text then
return make_error_msg ('conflicting: {{{2}}} and |text=', args, template);
else
args.text = args[2] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set
if is_set (msg) then -- msg is an already-formatted error message
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code); -- |script=, |region=, |variant= not supported because they should be part of args.code ({{{1}}} in {{lang}})
if msg then
return make_error_msg ( msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- nil when |italic= absent or not set or |italic=default; args.italic controls
if ('latn' == subtags.script) or -- script is latn
(this_wiki_lang ~= code and not is_set (subtags.script) and not has_poem_tag (args.text) and unicode.is_Latin (args.text)) then -- text not this wiki's language, no script specified and not in poem markup but is wholly latn script (auto-italics)
args.italic = 'italic'; -- DEFAULT for {{lang}} templates is upright; but if latn script set for font-style:italic
else
args.italic = 'inherit'; -- italic not set; script not latn; inherit current style
end
end
if is_set (subtags.script) then -- if script set, override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
if 'invert' == args.italic and 'span' == tag then -- invert only supported for in-line content
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, language_name));
table.insert (out, make_category (code, language_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G >----------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function lang (frame)
local args = getArgs (frame, { -- this code so that we can detect and handle wiki list markup in text
valueFunc = function (key, value)
if 2 == key or 'text' == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return _lang (args);
end
--[[--------------------------< L A N G _ X X >----------------------------------------------------------------
For the {{lang-xx}} templates, the only parameter required to be set in the template is the language code. All
other parameters can, usually should, be written in the template call. For {{lang-xx}} templates for languages
that can have multiple writing systems, it may be appropriate to set |script= as well.
For each {{lang-xx}} template choose the appropriate entry-point function so that this function knows the default
styling that should be applied to text.
For normal, upright style:
<includeonly>{{#invoke:lang|lang_xx_inherit|code=xx}}</includeonly>
For italic style:
<includeonly>{{#invoke:lang|lang_xx_italic|code=xx}}</includeonly>
All other parameters should be received from the template's frame (parent frame)
Supported parameters are:
|code = (required) the IANA language code
|script = IANA script code; especially for use with languages that use multiple writing systems
|region = IANA region code
|variant = IANA variant code
|text = (required) the displayed text in language specified by code
|link = boolean false ('no') does not link code-spcified language name to associated language article
|rtl = boolean true ('yes') identifies the language specified by code as a right-to-left language
|nocat = boolean true ('yes') inhibits normal categorization; error categories are not affected
|cat = boolian false ('no') opposite form of |nocat=
|italic = boolean true ('yes') renders displayed text in italic font; boolean false ('no') renders displayed text in normal font; not set renders according to initial_style_state
|lit = text that is a literal translation of text
|label = 'none' to suppress all labeling (language name, 'translit.', 'lit.')
any other text replaces language-name label - automatic wikilinking disabled
for those {{lang-xx}} templates that support transliteration (those templates where |text= is not entirely latn script):
|translit = text that is a transliteration of text
|translit-std = the standard that applies to the transliteration
|translit-script = ISO 15924 script name; falls back to code
For {{lang-xx}}, the positional parameters are:
{{{1}}} text
{{{2}}} transliterated text
{{{3}}} literal translation text
no other positional parameters are allowed
]]
local function _lang_xx (args)
local out = {};
local language_name; -- used to make display text, article links
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, and variant
local code; -- the language code
local translit_script_name; -- name associated with IANA (ISO 15924) script code
local translit;
local translit_title;
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang-xx';
if args[1] and args.text then
return make_error_msg ('conflicting: {{{1}}} and |text=', args, template);
else
args.text = args[1] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set, does not contain italic markup and is protected from improper bolding
if is_set (msg) then
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
if args[2] and args.translit then
return make_error_msg ('conflicting: {{{2}}} and |translit=', args, template);
else
args.translit = args[2] or args.translit -- prefer args.translit
end
if args[3] and (args.translation or args.lit) then
return make_error_msg ('conflicting: {{{3}}} and |lit= or |translation=', args, template);
elseif args.translation and args.lit then
return make_error_msg ('conflicting: |lit= and |translation=', args, template);
else
args.translation = args[3] or args.translation or args.lit; -- prefer args.translation
end
if args.links and args.link then
return make_error_msg ('conflicting: |links= and |link=', args, template);
else
args.link = args.link or args.links; -- prefer args.link
end
validate_cat_args (args); -- determine if categorization should be suppressed
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code, args.script, args.region, args.variant); -- private omitted because private
if msg then -- if an error detected then there is an error message
return make_error_msg (msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- args.italic controls
if is_set (subtags.script) then
if 'latn' == subtags.script then
args.italic = 'italic'; -- |script=Latn; set for font-style:italic
else
args.italic = initial_style_state; -- italic not set; script is not latn; set for font-style:<initial_style_state>
end
else
args.italic = initial_style_state; -- here when |italic= and |script= not set; set for font-style:<initial_style_state>
end
end
if is_set (subtags.script) then -- if script set override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = language_name; -- category names retain IANA parenthetical diambiguators (if any)
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if args.label then
if 'none' ~= args.label then
table.insert (out, table.concat ({args.label, ': '})); -- custom label
end
else
if 'no' == args.link then
table.insert (out, language_name); -- language name without wikilink
else
if language_name:find ('languages') then
table.insert (out, make_wikilink (language_name)); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
table.insert (out, make_wikilink (lang_data.article_name[code][1], language_name)); -- language name with wikilink from override data
else
table.insert (out, make_wikilink (language_name .. ' language', language_name)); -- language name with wikilink
end
end
table.insert (out, ': '); -- separator
end
if 'invert' == args.italic then
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, ('none' == args.label) and language_name or nil))
if is_set (args.translit) and not unicode.is_Latin (args.text) then -- transliteration (not supported in {{lang}}); not supported when args.text is wholly latn text (this is an imperfect test)
table.insert (out, ', '); -- comma to separate text from translit
if 'none' ~= args.label then
table.insert (out, '<small>');
if script_table[args['translit-script']] then -- when |translit-script= is set, try to use the script's name
translit_script_name = script_table[args['translit-script'][1]];
else
translit_script_name = language_name; -- fall back on language name
end
translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, 'romanized') .. ':'); -- make a wikilink if there is an article to link to
else
table.insert (out, 'romanized:'); -- else plain text
end
table.insert (out, ' </small>'); -- close the small tag
end
translit = make_translit (args.code, language_name, args.translit, args['translit-std'], args['translit-script'])
if is_set (translit) then
table.insert (out, translit);
else
return make_error_msg (table.concat ({'invalid translit-std: \'', args['translit-std'] or '[missing]'}), args, template);
end
end
if is_set (args.translation) then -- translation (not supported in {{lang}})
table.insert (out, ', ');
if 'none' ~= args.label then
table.insert (out, '<small>');
if 'no' == args.link then
table.insert (out, '<abbr title="literal translation">lit.</abbr>');
else
table.insert (out, make_wikilink ('Literal translation', 'lit.'));
end
table.insert (out, " </small>");
end
table.insert (out, table.concat ({''', args.translation, '''})); -- use html entities to avoid wiki markup confusion
end
table.insert (out, make_category (code, category_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G _ X X _ A R G S _ G E T >----------------------------------------------
common function to get args table from {{lang-??}} templates
returns table of args
]]
local function lang_xx_args_get (frame)
local args = getArgs(frame,
{
parentFirst= true, -- parameters in the template override parameters set in the {{#invoke:}}
valueFunc = function (key, value)
if 1 == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return args;
end
--[[--------------------------< L A N G _ X X _ I T A L I C >--------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_italic(). Sets the initial style state to italic.
]]
local function lang_xx_italic (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I T A L I C >------------------------------------------------
Entry point ffrom another module. Sets the initial style state to italic.
]]
local function _lang_xx_italic (args)
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< L A N G _ X X _ I N H E R I T >------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_inherit(). Sets the initial style state to inherit.
]]
local function lang_xx_inherit (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I N H E R I T >----------------------------------------------
Entry point from another module. Sets the initial style state to inherit.
]]
local function _lang_xx_inherit (args)
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ I S _ I E T F _ T A G >------------------------------------------------------
Returns true when a language name associated with IETF language tag exists; nil else. IETF language tag must be valid.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _is_ietf_tag (tag) -- entry point when this module is require()d into another
local c, s, r, v, p, err; -- code, script, region, variant, private, error message
c, s, r, v, p, err = get_ietf_parts (tag); -- disassemble tag into constituent part and validate
return ((c and not err) and true) or nil; -- return true when code portion has a value without error message; nil else
end
--[[--------------------------< I S _ I E T F _ T A G >--------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_ietf_tag (frame)
return _is_ietf_tag (getArgs (frame)[1]); -- args[1] is the ietf language tag to be tested; also get parent frame
end
--[[--------------------------< I S _ I E T F _ T A G _ F R A M E >--------------------------------------------
Module entry point from an {{#invoke:}}; same as is_ietf_tag() except does not get parameters from the parent
(template) frame. This function not useful when called by {{lang|fn=is_ietf_tag_frame|<tag>}} because <tag>
is in the parent frame.
]]
local function is_ietf_tag_frame (frame)
return _is_ietf_tag (getArgs (frame, {frameOnly = true,})[1]); -- args[1] is the ietf language tag to be tested; do not get parent frame
end
--[[--------------------------< _ N A M E _ F R O M _ T A G >--------------------------------------------------
Returns language name associated with IETF language tag if valid; error message else.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Set invoke's |link= parameter to yes to get wikilinked version of the language name.
Module entry point from another module
]]
local function _name_from_tag (args)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args['link']; -- make a boolean
local label = args.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local language_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
language_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if link then -- when |link=yes, wikilink the language name
if language_name:find ('languages') then
language_name = make_wikilink (language_name, label); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
language_name = make_wikilink (lang_data.article_name[code][1], label or language_name); -- language name with wikilink from override data
else
language_name = make_wikilink (language_name .. ' language', label or language_name); -- language name with wikilink
end
end
return language_name;
end
--[[--------------------------< N A M E _ F R O M _ T A G >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function name_from_tag (frame) -- entry point from an {{#invoke:Lang|name_from_tag|<ietf tag>|link=<yes>|template=<template name>}}
return _name_from_tag (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< _ T A G _ F R O M _ N A M E >--------------------------------------------------
Returns the ietf language tag associated with the language name. Spelling of language name must be correct
according to the spelling in the source tables. When a standard language name has a parenthetical disambiguator,
that disambiguator must be omitted (they are not present in the data name-to-tag tables).
Module entry point from another module
]]
local function _tag_from_name (args) -- entry point from another module
local msg;
if args[1] and '' ~= args[1] then
local data = mw.loadData ('Module:Lang/tag from name'); -- get the reversed data tables TODO: change when going live
local lang = args[1]:lower(); -- allow any-case for the language name (speeling must till be correct)
local tag = data.rev_override_table[lang] or data.rev_lang_table[lang] or data.rev_lang_dep_table[lang]; -- get the code; look first in the override then in the standard
if tag then
return tag, true; -- language name found so return tag and done; second return used by is_lang_name()
else
msg = 'language: ' .. args[1] .. ' not found' -- language name not found, error message
end
else
msg = 'missing language name' -- language name not provided, error message
end
local template = '';
if args.template and '' ~= args.template then
template = table.concat ({'{{', args['template'], '}}: '}); -- make template name (if provided by the template)
end
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: ', template, msg, '</span>'});
end
--[[--------------------------< T A G _ F R O M _ N A M E >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function tag_from_name (frame) -- entry point from an {{#invoke:Lang|tag_from_name|<language name>|link=<yes>|template=<template name>}}
local result, _ = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by is_lang_name()
return result;
end
--[[--------------------------< I S _ L A N G _ N A M E >------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_lang_name (frame)
local _, result = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by tag_from_name()
return result and true or nil;
end
--[[--------------------------< _ T R A N S L >----------------------------------------------------------------
Module entry point from another module
]]
local function _transl (args)
local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
local language_name; -- language name that matches language code; used for tool tip
local translit; -- transliterated text to display
local script; -- IANA script
local msg; -- for when called functions return an error message
if is_set (args[3]) then -- [3] set when {{transl|code|standard|text}}
args.text = args[3]; -- get the transliterated text
args.translit_std = args[2] and args[2]:lower(); -- get the standard; lower case for table indexing
if not title_table[args.translit_std] then
return make_error_msg (table.concat ({'unrecognized transliteration standard: ', args.translit_std}), args, 'Transl');
end
else
if is_set (args[2]) then -- [2] set when {{transl|code|text}}
args.text = args[2]; -- get the transliterated text
else
if args[1] and args[1]:match ('^%a%a%a?%a?$') then -- args[2] missing; is args[1] a code or its it the transliterated text?
return make_error_msg ('no text', args, 'Transl'); -- args[1] is a code so we're missing text
else
args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message
return make_error_msg ('missing language / script code', args, 'Transl');
end
end
end
if is_set (args[1]) then -- IANA language code used for html lang= attribute; or ISO 15924 script code
if args[1]:match ('^%a%a%a?%a?$') then -- args[1] has correct form?
args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters); lower case because table indexes are lower case
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args[1]}), args, 'Transl'); -- invalid language / script code
end
else
return make_error_msg ('missing language / script code', args, 'Transl'); -- missing language / script code so quit
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, 'Transl');
end
if 'italic' == args.italic then -- 'italic' when |italic=yes; because that is same as absent or not set and |italic=default
args.italic = nil; -- set to nil;
end
if override_table[args.code] then -- is code a language code defined in the override table?
language_name = override_table[args.code][1];
elseif lang_table[args.code] then -- is code a language code defined in the standard language code tables?
language_name = lang_table[args.code][1];
elseif lang_dep_table[args.code] then -- is code a language code defined in the deprecated language code tables?
language_name = lang_dep_table[args.code][1];
elseif script_table[args.code] then -- if here, code is not a language code; is it a script code?
language_name = script_table[args.code][1];
script = args.code; -- code was an ISO 15924 script so use that instead
args.code = ''; -- unset because not a language code
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args.code}), args, 'Transl'); -- invalid language / script code
end
-- here only when all parameters passed to make_translit() are valid
return make_translit (args.code, language_name, args.text, args.translit_std, script, args.italic);
end
--[[--------------------------< T R A N S L >------------------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function transl (frame)
return _transl (getArgs(frame));
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Returns category name associated with IETF language tag if valid; error message else
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _category_from_tag (args)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args['link']; -- make a boolean
local label = args.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local category_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
category_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = make_category (code, category_name, nil, true):gsub ('[%[%]]', '');
return category_name;
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function category_from_tag (frame) -- entry point from an {{#invoke:Lang|category_from_tag|<ietf tag>|template=<template name>}}
return _category_from_tag (getArgs (frame)); -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
category_from_tag = category_from_tag,
lang = lang, -- entry point for {{lang}}
lang_xx_inherit = lang_xx_inherit, -- entry points for {{lang-??}}
lang_xx_italic = lang_xx_italic,
is_ietf_tag = is_ietf_tag,
is_ietf_tag_frame = is_ietf_tag_frame,
is_lang_name = is_lang_name,
tag_from_name = tag_from_name, -- returns ietf tag associated with language name
name_from_tag = name_from_tag, -- used for template documentation; possible use in ISO 639 name from code templates
transl = transl, -- entry point for {{transl}}
_category_from_tag = _category_from_tag, -- entry points when this module is require()d into other modules
_lang = _lang,
_lang_xx_inherit = _lang_xx_inherit,
_lang_xx_italic = _lang_xx_italic,
_is_ietf_tag = _is_ietf_tag,
get_ietf_parts = get_ietf_parts,
_tag_from_name = _tag_from_name,
_name_from_tag = _name_from_tag,
_transl = _transl,
};
a4bb4d6ebc01a04b34edc644613227a570fb68c9
Module:Side box
828
103
204
2021-06-08T20:22:20Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Side_box]]
Scribunto
text/plain
-- This module implements {{side box}}.
local yesno = require('Module:Yesno')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local data = p.makeData(args)
return p.renderSidebox(data)
end
function p.makeData(args)
local data = {}
-- Main table classes
data.classes = {}
if yesno(args.metadata) ~= false then
table.insert(data.classes, 'metadata')
end
if args.position and args.position:lower() == 'left' then
table.insert(data.classes, 'mbox-small-left')
else
table.insert(data.classes, 'mbox-small')
end
table.insert(data.classes, args.class)
-- Image
if args.image and args.image ~= 'none' then
data.image = args.image
end
-- Copy over data that doesn't need adjusting
local argsToCopy = {
-- Styles
'style',
'textstyle',
-- Above row
'above',
'abovestyle',
-- Body row
'text',
'imageright',
-- Below row
'below',
}
for i, key in ipairs(argsToCopy) do
data[key] = args[key]
end
return data
end
function p.renderSidebox(data)
-- Renders the sidebox HTML.
-- Table root
local root = mw.html.create('table')
root:attr('role', 'presentation')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{border = '1px solid #aaa', ['background-color'] = '#f9f9f9', color = '#000'}
if data.style then
root:cssText(data.style)
end
-- The "above" row
if data.above then
local aboveCell = root:newline():tag('tr'):tag('td')
aboveCell
:attr('colspan', data.imageright and 3 or 2)
:addClass('mbox-text')
if data.textstyle then
aboveCell:cssText(data.textstyle)
end
if data.abovestyle then
aboveCell:cssText(data.abovestyle)
end
aboveCell
:newline()
:wikitext(data.above)
end
-- The body row
local bodyRow = root:newline():tag('tr'):newline()
if data.image then
bodyRow:tag('td')
:addClass('mbox-image')
:wikitext(data.image)
else
bodyRow:tag('td'):css('width', '1px')
end
local textCell = bodyRow:newline():tag('td')
textCell:addClass('mbox-text plainlist')
if data.textstyle then
textCell:cssText(data.textstyle)
end
textCell:wikitext(data.text)
if data.imageright then
bodyRow:newline():tag('td')
:addClass('mbox-imageright')
:wikitext(data.imageright)
end
-- The below row
if data.below then
local belowCell = root:newline():tag('tr'):tag('td')
belowCell
:attr('colspan', data.imageright and 3 or 2)
:addClass('mbox-text')
if data.textstyle then
belowCell:cssText(data.textstyle)
end
belowCell:wikitext(data.below)
end
return tostring(root)
end
return p
22522e8963a362334d99823230725ff4dc3d8ece
Module:Uses Wikidata
828
106
210
2021-06-08T20:22:24Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Module:Uses_Wikidata]]
Scribunto
text/plain
local p = {}
function p.usesProperty(frame)
local parent = frame.getParent(frame)
local result = ''
local ii = 1
while true do
local p_num = mw.text.trim(parent.args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.label(p_num) or "NO LABEL"
result = result .. "<ul><li><b><i>[[d:Property:" .. p_num .. "|" .. label .. " <small>(" .. string.upper(p_num) .. ")</small>]]</i></b> (see [[d:Property talk:" .. p_num .. "|talk]]; <span class='plainlinks'>[https://query.wikidata.org/embed.html#SELECT%20%3FWikiData_item_%20%3FWikiData_item_Label%20%3Fvalue%20%3FvalueLabel%20%3FEnglish_WikiPedia_article%20%23Show%20data%20in%20this%20order%0A%7B%0A%09%3FWikiData_item_%20wdt%3A" .. p_num .. "%20%3Fvalue%20.%20%23Collecting%20all%20items%20which%20have%20" .. p_num .. "%20data%2C%20from%20whole%20WikiData%20item%20pages%0A%09OPTIONAL%20%7B%3FEnglish_WikiPedia_article%20schema%3Aabout%20%3FWikiData_item_%3B%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%7D%20%23If%20collected%20item%20has%20link%20to%20English%20WikiPedia%2C%20show%20that%0A%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%20%7D%20%23Show%20label%20in%20this%20language.%20%22en%22%20is%20English.%20%20%20%0A%7D%0ALIMIT%201000 uses]</span>)</li></ul>"
ii = ii + 1
else break
end
end
return result
end
return p
c9e7988e11907e8eee6b61b75b3d2089f2be151f
Template:Infobox military conflict/doc
10
290
578
2021-06-09T13:45:42Z
mh>Zaktoslph
0
wikitext
text/x-wiki
{{Documentation subpage}}
{{High-use|16,100}}
{{Convert to use Infobox}}
{{Template:FromWikipedia}}
{{Lua|Module:Infobox military conflict}}
{{Uses TemplateStyles|Module:Infobox military conflict/styles.css}}
__TOC__
==Usage==
{{Infobox military conflict
| conflict = Battle of Lützen
| partof = the [[Thirty Years' War]]
| image = Battle of Lutzen.jpg
| alt = Battle of Lutzen by Carl Whalbom depicting King Gustavus Aolphus falling from a horse mortally wounded in a melee
| image_size = 300px
| caption = The '' '''Battle of Lützen''' '' by [[Carl Wahlbom]] shows the death of King [[Gustavus Adolphus]] on 16 November 1632.
| date = 6 November ([[Old Style and New Style dates|O.S.]]) or 16 November ([[Old Style and New Style dates|N.S.]]), 1632
| place = Near [[Lützen]], southwest of [[Leipzig]]<br />(present-day [[Germany]])
| coordinates = {{coord|51|15|N|12|08|E|region:DE_type:city}}
| result = Protestant victory <br />(see {{blue|Aftermath}} section)
| combatant1 = {{flagicon|Sweden|1562}} [[Swedish Empire|Sweden]]<br />[[Protestant Union]]
| combatant2 = {{flag|Holy Roman Empire}}<br/>{{flagicon image|Catholic League (Germany).svg}} [[Catholic League (German)|Catholic League]]
| commander1 = {{flagicon|Sweden|1562}} [[Gustavus Adolphus]]{{KIA}}<br/>{{flagicon|Sweden|1562}} [[Dodo zu Innhausen und Knyphausen|Dodo von Knyphausen]]<br/>{{Flagicon|Electorate of Saxony}} [[Bernhard of Saxe-Weimar]]<br/>{{flagicon|Sweden|1562}} [[Robert Munro, 18th Baron of Foulis]]
| commander2 = {{flagicon|Holy Roman Empire}} [[Albrecht von Wallenstein]]<br/>{{flagicon|Holy Roman Empire}} [[Heinrich Holk]]<br/>{{flagicon|Holy Roman Empire}} [[Gottfried zu Pappenheim|Count Gottfried zu Pappenheim]]{{DOW}}
| strength1 = 12,800 infantry<br />6,200 cavalry<br />60 guns
| strength2 = 10,000 infantry<br />7,000 cavalry, plus 3,000 infantry and 2,000 cavalry on arrival<br />24 guns
| casualties1 = 3,400 dead and 1,600 wounded or missing
| casualties2 = Probably about the same as Swedish casualties{{fakeref|1}}
}}
A military conflict infobox (sometimes referred to as a warbox) may be used to summarize information about a particular military conflict (a battle, campaign, war, or group of related wars) in a standard manner.
Information summarized in an infobox should follow the general guidance for writing a [[Wikipedia:Manual of Style/Lead section|lead section]]. It should not "make claims" or present material not covered by the article. As with a lead section, there is some discretion in citing information in an infobox. The same guidance should be applied to an infobox as given for [[Wikipedia:Manual of Style/Lead section#Citations|citations in a lead section]]. Information in an infobox must conform with [[Wikipedia:Verifiability|verifiability]], [[Wikipedia:Neutral point of view|point-of-view]] and other policies.
Information in the infobox should not be "controversial". Refer the reader to an appropriate section in the article or leave the parameter blank rather than make an unsubstantiated or doubtful claim.
The infobox should be added using the {{tl|infobox military conflict}} template, as shown below:
<div style="width:250px;background:#dddddd;border: 1px solid black;padding:0.5em 1em 0.5em 1em"><pre>
{{Infobox military conflict
| conflict =
| width =
| partof =
| image =
| image_size =
| alt =
| caption =
| date =
| place =
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result =
| status =
| combatants_header =
| combatant1 =
| combatant2 =
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 =
| strength2 =
| strength3 =
| casualties1 =
| casualties2 =
| casualties3 =
| notes =
| campaignbox =
}}
</pre></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
===Parameters===
* '''conflict''' – the name of the conflict being described (e.g. "Battle of Lützen" or "World War I").
* '''width''' – ''optional'' – the width of the infobox, e.g. "400px"; defaults to: "315px".
* '''partof''' – ''optional'' – the larger conflict containing the event described in the article. For battles or campaigns, this should be the war during which the event takes place; for particularly large wars, this may include a theatre (e.g. "the Eastern Front of World War II"). For wars, the parameter may be used to link to a larger group of wars (e.g. the [[Italian War of 1521–26]] to the [[Italian Wars]]). It may be necessary to insert "the" before the name of the war for proper grammar.
* '''image''' – ''optional'' – an image for the warbox. Given in the form <code>Example.jpg</code>
* '''image_size''' – ''optional'' – a size for the image
* '''alt''' – ''optional'' – [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' – ''optional'' – the text to be placed below the image.
* '''date''' – ''optional'' – the date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.
* '''place''' – the location of the conflict. For conflicts covering a wide area, a general description (e.g. "France", or "Europe", or "Worldwide") may be used.
* '''coordinates''' – ''optional'' – the location of the structure, given as a coordinate pair by using {{tl|coord}} with ''display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_relief''' – ''optional'' – "yes" if the location map is a relief map; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_mark''' – ''optional'' – the name of a file to use as the location map marker, e.g. Green_pog.svg; defaults to: "Red_pog.svg".
* '''map_marksize''' – ''optional'' – width of the location map marker in pixels (px), e.g. "10"; defaults to: "8".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''territory''' – ''optional'' – any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.
* '''action''' – ''optional'' – In case of Coup d'État, short description of ''modus operandi'', e.g. "...marched over the city...", "...dissolving the Congress of the Republic...", "...take the government hostage ...", "...put the country under military control ...", etc.
* '''result''' – ''optional'' – this parameter may use one of two standard terms: "X victory" or "Inconclusive". The term used is for the "immediate" outcome of the "subject" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as "See the {{blue|Aftermath}} section"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the "immediate" result. Do not introduce non-standard terms like "decisive", "marginal" or "tactical", or contradictory statements like "decisive tactical victory but strategic defeat". Omit this parameter altogether rather than engage in [[WP:NOR|speculation]] about which side won or by how much.
* '''status''' – ''optional'' – for ongoing conflicts, the current status of the conflict. This should not be used if a final result (above) is provided.
* '''combatants_header''' – ''optional'' – sets the header text for the combatants section. Default is "Belligerents". In case of Coup d'État, use "Government-Insurgents "
* '''combatant1'''/'''combatant2'''/'''combatant3''' – ''optional'' – the parties participating in the conflict. This is most commonly the countries whose forces took part in the conflict; however, larger groups (such as alliances or international organizations) or smaller ones (such as particular units, formations, or groups) may be indicated if doing so improves reader understanding. When there is a large number of participants, it may be better to list only the three or four major groups on each side of the conflict, and to describe the rest in the body of the article. The '''combatant3''' field may be used if a conflict has three distinct "sides", and should be left blank on other articles. Combatants should be listed in order of importance to the conflict, be it in terms of military contribution, political clout, or a recognized chain of command. If differing metrics can support alternative lists, then ordering is left to the editors of the particular article.
** '''combatant1a'''/'''combatant2a'''/'''combatant3a''' – ''optional'' – in cases where the parties significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''combatant''N''''' fields (above).
** '''combatant1b'''/'''combatant2b'''/'''combatant3b''' – ''optional'' – additional row, as above.
** '''combatant1c'''/'''combatant2c'''/'''combatant3c''' – ''optional'' – additional row, as above.
** '''combatant1d'''/'''combatant2d'''/'''combatant3d''' – ''optional'' – additional row, as above.
** '''combatant1e'''/'''combatant2e'''/'''combatant3e''' – ''optional'' – additional row, as above.
* '''commander1'''/'''commander2'''/'''commander3''' – ''optional'' – the commanders of the military forces involved. For battles, this should include military commanders (and other officers as necessary). For wars, only prominent or notable leaders should be listed, with an upper limit of about seven per combatant column recommended. Ranks and position titles should be omitted. The {{tl|KIA}} and {{tl|POW}} templates may be included immediately after the names of commanders who were killed in action or surrendered and were taken prisoner, respectively. The '''commander3''' field can only be used if the '''combatant3''' field is set.
** '''commander1a'''/'''commander2a'''/'''commander3a''' – ''optional'' – in cases where the commanders significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''commander''N''''' fields (above).
** '''commander1b'''/'''commander2b'''/'''commander3b''' – ''optional'' – additional row, as above.
** '''commander1c'''/'''commander2c'''/'''commander3c''' – ''optional'' – additional row, as above.
** '''commander1d'''/'''commander2d'''/'''commander3d''' – ''optional'' – additional row, as above.
** '''commander1e'''/'''commander2e'''/'''commander3e''' – ''optional'' – additional row, as above.
* '''units1'''/'''units2'''/'''units3''' – ''optional'' – the units or formations involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field. The '''units3''' field can only be used if the '''combatant3''' field is set.
* '''strength1'''/'''strength2''' – ''optional'' – the numerical strength of the units involved.
:* '''polstrength1'''/'''polstrength2''' – ''optional'' – In case of Coup d'Etat, political organizations that supported the government (1) respective the insurgents (2).
:* '''milstrength1'''/'''milstrength2''' – ''optional'' – In case of Coup d'Etat, military units that supported the government (1) respective the insurgents (2).
* '''strength3''' – ''optional'' – if '''combatant3''' is set, this is a third strength field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total participation in a conflict is known.
* '''casualties1'''/'''casualties2''' – ''optional'' – casualties suffered (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Note that this section of the infobox is headed "Casualties and losses". Terms such as "dead" (or "killed"), "wounded", or "captured" should be used in place of abbreviations such as "KIA" or "POW". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.
* '''casualties3''' – ''optional'' – if '''combatant3''' is set, this is a third casualty field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.
* '''notes''' – ''optional'' – optional field for further notes; this should only be used in exceptional circumstances.
* '''campaignbox''' – ''optional'' – optional field for appending a [[WP:CAMPAIGN|campaignbox template]] to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format <nowiki>{{Campaignbox XYZ}}</nowiki>.<noinclude>
[[Category:WikiProject Military history template instructions|Military conflict infobox]]
</noinclude>{{Campaign/doc|noheader=yes}}
{{Operational plan/doc|noheader=yes}}
==Microformat==
{{UF-hcal-geo}}
==TemplateData==
{{Collapse top|title=[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "Summarize information about a particular military conflict (a battle, campaign, war, or group of related wars).",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"conflict": {
"label": "Conflict",
"description": "The name of the conflict being described.",
"type": "string/line",
"required": true
},
"width": {
"label": "Width",
"description": "Width of the infobox.",
"type": "string",
"default": "315px",
"required": false
},
"partof": {
"label": "Part of",
"description": "The larger conflict containing the event described in the article.",
"type": "wiki-page-name",
"required": false
},
"image": {
"label": "Image",
"description": "An image for the warbox given in the form Example.jpg.",
"type": "string",
"required": false
},
"image_size": {
"label": "Image size",
"description": "The size of the image",
"type": "string",
"required": false
},
"alt": {
"label": "Alt",
"description": "Alternative textual description of the image",
"type": "string",
"required": false
},
"caption": {
"label": "Caption",
"description": "The text to be placed below the image.",
"type": "string",
"required": false
},
"date": {
"label": "Date",
"description": "The date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.",
"type": "string",
"required": false
},
"place": {
"label": "Place",
"description": "The location of the conflict.",
"type": "string",
"required": true
},
"coordinates": {
"label": "Coordinates",
"description": "The location of the structure, given as a coordinate pair by using {{coord}} with display=inline,title.",
"type": "string",
"required": false
},
"map_type": {
"label": "Map Type",
"description": "The base map to be used for the location map, e.g. \"Scotland\"; see {{location map}} for more details.",
"type": "string",
"required": false
},
"map_relief": {
"label": "Map Relief",
"description": "\"yes\" if the location map is a relief map.",
"type": "string",
"required": false
},
"map_size": {
"label": "Map Size",
"description": "Width of the location map in pixels (px).",
"type": "number",
"default": "220",
"required": false
},
"map_mark": {
"label": "Map Marker",
"description": "File to use as the location map marker.",
"type": "string",
"default": "red_pog.svg",
"required": false
},
"map_marksize": {
"label": "Map Marker Size",
"description": "Width of the location map marker in pixels (px).",
"type": "number",
"default": "8",
"required": false
},
"map_caption": {
"label": "Map Caption",
"description": "Caption displayed below the location map.",
"type": "string",
"default": "Location within {{{map_type}}}",
"required": false
},
"map_label": {
"label": "Map Label",
"description": "The label placed next to the marker on the location map.",
"type": "string/line",
"required": false
},
"territory": {
"label": "Territory",
"description": "Any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.",
"type": "string",
"required": false
},
"result": {
"label": "Result",
"description": "This parameter may use one of two standard terms: \"X victory\" or \"Inconclusive\". The term used is for the \"immediate\" outcome of the \"subject\" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as \"See the Aftermath section\"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the \"immediate\" result. Do not introduce non-standard terms like \"decisive\", \"marginal\" or \"tactical\", or contradictory statements like \"decisive tactical victory but strategic defeat\". Omit this parameter altogether rather than engage in speculation about which side won or by how much.",
"type": "string/line",
"required": false
},
"status": {
"label": "Status",
"description": "For ongoing conflicts, the current status of the conflict.",
"type": "string/line",
"required": false
},
"combatants_header": {
"label": "\"Combatants\" Header Text",
"description": "Sets the header text for the combatants section.",
"type": "string/line",
"default": "Belligerents",
"required": false
},
"combatant1": {
"label": "Combatant 1",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant2": {
"label": "Combatant 2",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant3": {
"label": "Combatant 3",
"description": "A party participating in the conflict. (only if the conflict has three distinct \"sides\")",
"type": "string",
"required": false
},
"combatant1a": {
"label": "Combatant 1a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2a": {
"label": "Combatant 2a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3a": {
"label": "Combatant 3a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1b": {
"label": "Combatant 1b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2b": {
"label": "Combatant 2b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3b": {
"label": "Combatant 3b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1c": {
"label": "Combatant 1c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2c": {
"label": "Combatant 2c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3c": {
"label": "Combatant 3c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1d": {
"label": "Combatant 1d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2d": {
"label": "Combatant 2d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3d": {
"label": "Combatant 3d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"commander1": {
"label": "Commander of Combatant 1",
"description": "The commanders of the military forces of Combatant (1) involved.",
"type": "string",
"required": false
},
"commander2": {
"label": "Commander of Combatant 2",
"description": "The commanders of the military forces of Combatant 2 involved.",
"type": "string",
"required": false
},
"commander3": {
"label": "Commander of Combatant 3",
"description": "The commanders of the military forces of Combatant 3 involved.",
"type": "string",
"required": false
},
"units1": {
"label": "Units of Combatant 1",
"description": "The units or formations of Combatant 1 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units2": {
"label": "Units of Combatant 2",
"description": "The units or formations of Combatant 2 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units3": {
"label": "Units of Combatant 3",
"description": "The units or formations of Combatant 3 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"strength1": {
"label": "Strength of Combatant 1",
"description": "The numerical strength of Combatant 1.",
"type": "string",
"required": false
},
"strength2": {
"label": "Strength of Combatant 2",
"description": "The numerical strength of Combatant 2.",
"type": "string",
"required": false
},
"strength3": {
"label": "Strength of Combatant 3",
"description": "If Combatant 3 is set, this field is for the numerical strength of Combatant 3. If Combatant 3 is not set, this is an alternate combined field for use where only the total participation in a conflict is known.",
"type": "string",
"required": false
},
"casualties1": {
"label": "Casualties of Combatant 1",
"description": "Casualties suffered by Combatant 1 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties2": {
"label": "Casualties of Combatant 2",
"description": "Casualties suffered by Combatant 2 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties3": {
"label": "Casualties of Combatant 3",
"description": "If Combatant 3 is set, this field is for the casualties suffered by Combatant 3, (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc. If combatant3 is not set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.",
"type": "string",
"required": false
},
"notes": {
"label": "Notes",
"description": "Optional field for further notes; this should only be used in exceptional circumstances.",
"type": "string",
"required": false
},
"campaignbox": {
"label": "Campaignbox",
"description": "Optional field for appending a campaignbox template to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format {{Campaignbox XYZ}}.",
"type": "string",
"required": false
}
}
}</templatedata>
{{Collapse bottom}}
==See also==
*{{tl|Infobox military operation}}
*{{tl|Infobox civil conflict}}
*{{tl|Infobox civilian attack}}
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Military infobox templates|Conflict]]
[[Category:Lua-based infobox templates]]
}}</includeonly>
dbf7c8bccf060e1cc4ffcebaecc25cdcb142845d
Template:FromWikipedia
10
289
576
2021-06-09T13:47:06Z
mh>AlathraMC
0
wikitext
text/x-wiki
{{Warning|1=This page contains '''imported content from Wikipedia''' and was not made specifically for the Alathra Wiki. Page links and scripts may be broken. '''This is normal.'''|heading=Wikipedia content}}
eadcfbf45f06ceb9bf98c32f20413adde5e083fd
Template:Mbox
10
271
540
2021-06-09T13:50:16Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Mbox]]
wikitext
text/x-wiki
{{#invoke:Message box|mbox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
c262e205f85f774a23f74119179ceea11751d68e
Template:Reflist
10
70
138
2021-06-09T14:14:43Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Reflist]]
wikitext
text/x-wiki
<div class="reflist <!--
-->{{#if: {{{1|}}} {{{colwidth|}}}
| columns references-column-width
}}" style="<!--
-->{{#if: {{{1|}}}
| {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }}
| {{column-width|1={{{1}}}}}
| {{#switch:{{{1|}}}|1=|2={{column-width|1=30em}}|#default={{column-width|1=25em}}}} }}
| {{#if: {{{colwidth|}}}
| {{column-width|1={{{colwidth}}}}} }} }} list-style-type: <!--
-->{{{liststyle|{{#switch: {{{group|}}}
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = {{{group}}}
| #default = decimal}}}}};">
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}</div>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using reflist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Reflist]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | colwidth | group | liststyle | refs }}<noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Reflist}}
</noinclude>
29e8d6771e0595df828d3e17eaf9f10eedc93e6b
Template:Smallsup
10
171
340
2021-06-09T14:14:46Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Smallsup]]
wikitext
text/x-wiki
<includeonly><sup><small>{{{1}}}</small></sup></includeonly><noinclude>
{{Documentation}}
</noinclude>
c174fb3247218273210500118556feb9f3c76d5a
Template:Start date and age
10
316
630
2021-06-09T14:14:47Z
mh>AlathraMC
0
1 revision imported from [[:wikipedia:Template:Start_date_and_age]]
wikitext
text/x-wiki
<includeonly><!--
IMPLEMENTATION OF DATE
-->{{#if: {{{1|}}}<!--
-->|{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{#ifeq:{{yesno|{{{df|no}}}}}|yes<!--
-->|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}<!--
-->|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},<!--
-->}} {{{1}}}<!--
-->|{{MONTHNAME|{{{2}}}}} {{{1}}}<!--
-->}}<!--
-->|{{{1}}}<!--
-->}}<!--
--><span class="noprint">{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes||;}}<!--
-->{{#ifeq:{{yesno|{{{br|no}}}}}|yes|<br/>| }}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|(}}<!--
-->{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{time ago|{{{1}}}-{{{2}}}-{{{3}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{{1}}}|{{#time:n|1-{{trim|{{{2}}}}}-1}}}}<!--
-->}}<!--
-->|{{#iferror:{{#expr:{{{1}}}}}<!--
-->|{{time ago|{{{1}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{{1}}}}}<!--
-->}}<!--
-->}}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|)}}</span><!--
-->|{{Error|Error: first parameter is missing.|tag=span}}<!--
-->}}<!--
IMPLEMENTATION OF microformat date classes
--><span style="display:none"> (<span class="{{#ifeq:{{yesno|{{{end|no}}}}}|yes|dtend|bday dtstart published updated}}"><!--
-->{{#if: {{{1|}}}<!--
-->|{{{1}}}<!--
-->{{#if: {{{2|}}}<!--
-->| -{{#time:m|1-{{trim|{{{2}}}}}-1}}<!--
-->{{#if: {{{3|}}}<!--
-->| -{{padleft:{{{3}}}|2|0}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
--></span>)</span></includeonly><noinclude>
{{documentation}}
</noinclude>
0139749a9182b26b7b234679b4c10a231c37519f
Template:Infobox country
10
107
212
2021-07-16T03:09:48Z
mh>AlathraMC
0
removed redlinks pointing to wikipedia
wikitext
text/x-wiki
<table class="infobox geography vcard" style="width:22em; font-size:88%;"><!--
============================================================
Names
============================================================
-->{{#if:{{{conventional_long_name|}}}{{{native_name|}}}{{{name|}}}
| <tr class="adr">
<th colspan="3" class="mergedtoprow"
style="text-align:center;padding:0.25em 0.33em 0.33em;line-height:1.2em;font-size:1.25em;"><!--
-->{{#if:{{{conventional_long_name|}}}
|<span class=" fn org country-name">{{{conventional_long_name|}}}</span><br/><!--
-->}}<!--
-->{{#if:{{{native_name|}}}{{{name|}}}
|<div style="padding-top:0.25em;"><!--
-->{{br separated entries
|{{{native_name|}}}
|{{#if:{{{name|}}}
|<span class="fn org country-name">{{{name|}}}</span><!--
-->}}}}<!--
--></div><!--
-->}}<!--
-->{{#ifeq:{{{micronation|}}}|yes
|<span class=" fn org">[[Micronation]]</span><!--
-->|}}<!--
--></th>
</tr><!--
-->}}<!--
============================================================
Flag / Coat-of-arms (or other symbol)
============================================================
-->{{#if:{{{image_flag|}}}
|<!----------------------------------------------------
Flag provided, so display it and coat-of-arms (or
other symbol) if provided:
----------------------------------------------------
--><tr class="mergedtoprow">
<td class="maptable" colspan="3" style="text-align:center;padding:0.5em 0;"><!--
------------------------------------------------
Subtable to format coat-of-arms (or symbol)
display. style="text-align:center;"s and "width:auto;"s
are for sake of Internet Explorer.
------------------------------------------------
--><table style="text-align:center;width:100%;background:none;"><!--
-----------Image/s-----------
--><tr>
<td style="text-align:center;{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| {{#if:{{{flag_width|}}} |width:{{{flag_width}}}; |width:58%;<!--(58% as flags usually wider than coats-of-arms/symbols. Also accommodates IE.)-->}}<!--
-->}} vertical-align:middle;"><!--
-->[[File:{{{image_flag}}}|125px|{{yesno |{{{flag_border|}}}|yes=border|blank=border}}|alt={{{alt_flag|}}}|Flag of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}]]<!--
-->{{#if:{{{image_flag2|}}}
| [[File:{{{image_flag2}}}|125px|{{yesno |{{{flag2_border|}}}|yes=border|blank=border}}|alt={{{alt_flag2|}}}]]}}<!--
--></td>
{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| <td style="text-align:center;width:auto;vertical-align:middle;"><!--
-->[[File:{{{image_coat|{{{image_symbol|}}}}}} |{{{symbol_width|85px}}} |alt={{{alt_coat|{{{alt_symbol|}}}}}} |{{{symbol_type|Coat of arms}}} of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}]]<!--
--></td>
}}
</tr><!--
----------Caption/s----------
--><tr>
<td style="text-align:center;font-size:85%;">{{#ifexist:Flag of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} |[[Flag of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} | {{{flag_caption|Banner}}}]] |Banner }}</td>
{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| <td style="text-align:center;font-size:85%;">{{#ifexist:{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} |[[{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} | {{{symbol_type|Coat of arms}}}]] |{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} }}</td>
}}
</tr><!--
------end subtable:------
--></table>
</td>
</tr><!--
-->|<!-----------------------------------------------------
Flag not provided, so display coat-of-arms or other
symbol (if provided):
------------------------------------------------------
-->{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| <tr class="mergedtoprow">
<td class="maptable" colspan="3" style="text-align:center;padding:0.5em 0;"><!--
----------------------------------------------
Subtable to format coat-of-arms (or symbol)
display. style="text-align:center;"s and "width:auto;"s
are for sake of Internet Explorer.
----------------------------------------------
--><table style="text-align:center;width:100%;background:none;"><!--
-----------Image-----------
--><tr>
<td style="text-align:center;width:auto;vertical-align:middle;"><!--
-->[[File:{{{image_coat|{{{image_symbol|}}}}}} |{{{symbol_width|100px}}} |alt={{{alt_coat|{{{alt_symbol|}}}}}} |{{{symbol_type|Coat of arms}}} of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}]]</td>
</tr><!--
----------Caption----------
--><tr>
<td style="text-align:center;font-size:85%;"><!--
-->{{#ifexist:{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} |[[{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} | {{{symbol_type|Coat of arms}}}]]|{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} }}<!--
--></td>
</tr><!--
------end subtable:-------
--></table>
</td>
</tr><!--
-->}}<!--
-->}}<!--
============================================================
Motto
============================================================
-->{{#if:{{{national_motto|}}}{{{motto|}}}
| <tr>
<td colspan="3" style="text-align:center;line-height:1.2em;"><!--
-->'''Motto: '''{{{motto|{{{national_motto|}}}}}}<!--
-->{{#if:{{{englishmotto|}}}|<br/>{{small|{{{englishmotto}}} }} }}</td>
</tr><!--
-->}}<!--
============================================================
Anthem/s
============================================================
-->{{#if:{{{national_anthem|}}}{{{anthem|}}}{{{royal_anthem|}}}
| <tr>
<td class="anthem" colspan="3" style="text-align:center;line-height:1.2em;"><!--
-->{{#if:{{{national_anthem|}}}{{{anthem|}}}
|'''Anthem: '''{{{national_anthem|{{{anthem|}}}}}}
}}<!--
-->{{#if:{{{royal_anthem|}}}
| {{#if:{{{national_anthem|}}}{{{anthem|}}} |<br/>}}<!--
-->'''[[Royal anthem]]: '''{{{royal_anthem}}}<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
Other symbol/s
============================================================
-->{{#if:{{{other_symbol|}}}{{{text_symbol|}}}
| <tr>
<td colspan="3" style="text-align:center;line-height:1.2em;"><!--
-->{{#if:{{{other_symbol_type|}}}{{{text_symbol_type|}}}
| '''{{{other_symbol_type|{{{text_symbol_type|}}}}}}'''<br/>}}<!--
-->{{{other_symbol|}}}{{{text_symbol|}}}</td>
</tr><!--
-->}}<!--
============================================================
Maps
============================================================
-->{{#if:{{{image_map|}}}
| <tr>
<td colspan="3" style="padding:0.6em 0 0.3em;text-align:center;"><!--
-->[[File:{{{image_map}}}|center<!--
-->|{{{map_width|250px}}}<!--
-->|alt={{{alt_map|{{{map_caption|}}}}}}<!--
-->|{{{alt_map|{{{map_caption|Location of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}} }}}}}}}}}}}}}}}<!--
-->]]<!--
--><div style="padding:0.3em;line-height:1.2em;font-size:85%;">{{{map_caption|}}}</div>
</td>
</tr><!--
-->}}<!--
-->{{#if:{{{image_map2|}}}
| <tr class="mergedtoprow">
<td colspan="3" style="padding:0.6em 0 0.3em;text-align:center;"><!--
-->[[File:{{{image_map2}}}|center<!--
-->|{{{map2_width|250px}}}<!--
-->|alt={{{alt_map2|{{{map_caption2|}}}}}}<!--
-->|{{{alt_map2|{{{map_caption2|Location of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}} }}}}}}}}}}}}}}}<!--
-->]]<!--
--><div style="position:relative;top:0.3em;line-height:1.2em;font-size:85%;">{{{map_caption2|}}}</div>
</td>
</tr><!--
-->}}<!--
============================================================
Status
============================================================
-->{{#if:{{{status|}}}
| <tr>
<td colspan="2">'''Status''' </td>
<td>{{{status}}}</td>
</tr><!--
-->}}<!--
============================================================
Location
============================================================
-->{{#if:{{{loctext|}}}
| <tr>
<td colspan="2">'''Location''' </td>
<td>{{{loctext}}}</td>
</tr><!--
-->}}<!--
============================================================
Capital/Admin center; Largest city/ies or settlement/s
============================================================
-->{{#if:{{{capital|}}}{{{admin_center|}}}{{{largest_city|}}}{{{largest_settlement|}}}
| <tr class="mergedtoprow"><!--
-->{{#if:{{{capital|}}}{{{admin_center|}}}
| <td colspan="2"><!--
-->{{#if:{{{capital|}}}
| {{#if:{{{capital_type|}}} |'''{{{capital_type}}}''' |'''Capital'''}}
| {{#if:{{{admin_center_type|}}}|'''{{{admin_center_type|}}}'''|Administrative center}}
}}<!--
-------------------------------------------------
If capital provided, check whether largest_city
or largest_settlement (if provided) equals
"capital", capital or [[capital]]:
-------------------------------------------------
-->{{#ifeq: {{#ifeq:{{{largest_city|}}}{{{largest_settlement|}}}|capital
|capital<!--
-->|{{#switch:{{{capital}}}
| [[{{{largest_city|}}}{{{largest_settlement|}}}]] = capital
| {{{largest_city|}}}{{{largest_settlement|}}} = capital
| not capital
}}<!--
-->}}|capital <!--
(#ifeq:)-->|<!------------------------------------------
capital is largest_city/_settlement:
-------------------------------------------
--><br/>and {{{largest_settlement_type|largest city}}}<!--
--></td><!--
--------Add capital:--------
--><td>{{{capital}}}<!--
---------Add capital's lat/longitude
(if provided):---------
-->{{#if:{{{latd|}}}
|<br/><span style="white-space:nowrap;font-size:85%;"><!--
-->{{coord|{{{latd}}}|{{{latm}}}|{{{latNS}}}<!--
-->|{{{longd}}}|{{{longm}}}|{{{longEW}}}<!--
-->|type:city<!--
-->}}<!--
--></span><!--
-->}}<!--
--></td><!--
(#ifeq:)-->|<!------------------------------------------
capital isn't largest_city/_settlement:
------------------------------------------
--></td><!--
--------Add capital/admin center:--------
--><td>{{#if:{{{capital|}}}|{{{capital|}}}|{{{admin_center|}}}}}<!--
----Add capital/admin center's lat/longitude
(if provided):----
-->{{#if:{{{latd|}}}
|<br/><span style="white-space:nowrap;font-size:85%;"><!--
-->{{coord|{{{latd}}}|{{{latm}}}|{{{latNS}}}<!--
-->|{{{longd}}}|{{{longm}}}|{{{longEW}}}<!--
-->|type:city<!--
-->}}<!--
--></span><!--
-->}}<!--
--></td><!--
--------Add largest_city/_settlement
(if provided):--------
-->{{#if:{{{largest_city|}}}{{{largest_settlement|}}}
| </tr>
<tr class="mergedbottomrow">
<th colspan="2">Largest {{{largest_settlement_type|city}}}</th>
<td>{{{largest_city|{{{largest_settlement|}}}}}}</td><!--
-->}}<!--
(#ifeq:)-->}}<!--
-->|<!-------------------------------------------------
Capital not provided,
so add largest_city/_settlement (if provided):
--------------------------------------------------
-->{{#if:{{{largest_city|}}}{{{largest_settlement|}}}
| <th colspan="2">Largest {{{largest_settlement_type|city}}}</th>
<td>{{{largest_city|{{{largest_settlement|}}}}}}</td><!--
-->}}<!--
-->}}<!--
--></tr><!--
-->}}<!--
============================================================
Languages
============================================================
-->{{#if:{{{official_languages|}}}
| <tr>
<th colspan="2" style="white-space:nowrap;">Official languages</th>
<td>{{{official_languages}}}</td>
</tr><!--
-->{{#if:{{{recognized_languages|{{{recognised_languages|}}}}}}
| <tr class="mergedbottomrow">
<td colspan="2">{{#if:{{{recognized_languages|}}}|Recognized|Recognised}} languages</td>
<td style="vertical-align:middle;">{{{recognized_languages|{{{recognised_languages}}}}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{recognized_national_languages|{{{recognised_national_languages|{{{national_languages|}}}}}}}}}
| <tr>
<td colspan="2">{{#if:{{{recognized_national_languages|}}}|Recognized|Recognised}} national languages</td>
<td style="vertical-align:middle;">{{{recognized_national_languages|{{{recognised_national_languages|{{{national_languages}}}}}}}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{recognized_regional_languages|{{{recognised_regional_languages|{{{regional_languages|}}}}}}}}}
| <tr class="mergedbottomrow">
<td colspan="2">{{#if:{{{recognized_regional_languages|}}}|Recognized|Recognised}} regional languages</td>
<td style="vertical-align:middle;">{{{recognized_regional_languages|{{{recognised_regional_languages|{{{regional_languages}}}}}}}}}</td>
</tr><!--
-->}}<!--
-->}}<!--
-------- Customizable language entries: --------
-->{{#if:{{{languages|}}}
| <tr {{#ifeq:{{{languages2_sub|}}}|yes
|{{#ifeq:{{{languages_sub|}}}|yes |class="mergedrow"|}}
|{{#ifeq:{{{languages_sub|}}}|yes |class="mergedbottomrow"|}}<!--
-->}}>
<{{#ifeq:{{{languages_sub|}}}|yes |td |th}} colspan="2" style="white-space:nowrap;"><!--
-->{{{languages_type}}}<!--
--></{{#ifeq:{{{languages_sub|}}}|yes |td |th}}>
<td>{{{languages}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{languages2|}}}
| <tr {{#ifeq:{{{languages2_sub|}}}|yes |class="mergedbottomrow"|}}>
<{{#ifeq:{{{languages2_sub|}}}|yes |td |th}} colspan="2" style="white-space:nowrap;"><!--
-->{{{languages2_type}}}<!--
--></{{#ifeq:{{{languages2_sub|}}}|yes |td |th}}>
<td>{{{languages2}}}</td>
</tr><!--
-->}}<!--
============================================================
Ethnic groups
============================================================
-->{{#if:{{{ethnic_groups|}}}
| <tr>
<td colspan="2">'''[[Ethnic groups|Ethnic groups]]''' <!--
-->{{#if:{{{ethnic_groups_year|}}} |({{{ethnic_groups_year}}})}}</td>
<td>{{{ethnic_groups}}}</td>
</tr><!--
-->}}<!--
============================================================
Religion
============================================================
-->{{#if:{{{religion|}}}
| <tr>
<th colspan="2">Religion</th>
<td style="vertical-align:middle;">{{{religion}}}</td>
</tr><!--
-->}}<!--
============================================================
Demonym
============================================================
-->{{#if:{{{demonym|}}}
| <tr>
<th colspan="2">Demonym</th>
<td>{{#ifexist:{{{demonym}}} people
| [[{{{demonym}}} people|{{{demonym}}}]]
| {{{demonym}}}<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
Organization type / Membership (geopolitical org)
============================================================
-->{{#if:{{{org_type|}}}
| <tr>
<td colspan="2">'''Type'''</td>
<td>{{{org_type}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{membership|}}}
| <tr>
<td colspan="2"
style="vertical-align:middle;">'''{{{membership_type|Membership}}}'''</td>
<td>{{{membership}}}</td>
</tr><!--
-->}}<!--
============================================================
Government heading(country/territory)
Leaders heading (geopolitical organization)
============================================================
-->{{#if:{{{government_type|}}}
| <tr>
<th colspan="2"><!--
-->{{#if:{{{politics_link|}}}
| [[{{{politics_link}}}|{{#ifeq:{{{micronation|}}}|yes|Organizational structure|Government}}]]<!--
-->| {{#ifexist:Politics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Politics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|{{#ifeq:{{{micronation|}}}|yes|Organizational structure|Government}}]]<!--
-->| {{#ifeq:{{{micronation|}}}|yes|Organizational structure|Government}}<!--
-->}}<!--
-->}}<!--
--></th>
<td>{{{government_type}}}</td>
</tr><!--
-->|<!----------------------------------------------------
No government_type provided, so, if at least one
leader provided, use "Leaders" (geopolitical org)
or "Government" (country/territory):
-----------------------------------------------------
-->{{#if:{{{leader_title1|}}}{{{leader_name1|}}}
| {{#if:{{{name|}}}{{{membership|}}}
<!--template being used for geopolitical org:-->
| <tr><th colspan="3">Leaders</th></tr><!--
<!--template being used for country/territory:
-->| <tr><th colspan="3">Government</th></tr><!--
-->}}<!--
-->}}<!--
-->}}<!--
============================================================
Leaders
============================================================
-->{{#if:{{{leader_title1|}}}
| <tr class="{{#if:{{{leader_title2|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title1}}}</td>
<td>{{{leader_name1}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title2|}}}
| <tr class="{{#if:{{{leader_title3|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title2}}}</td>
<td>{{{leader_name2}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title3|}}}
| <tr class="{{#if:{{{leader_title4|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title3}}}</td>
<td>{{{leader_name3}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title4|}}}
| <tr class="{{#if:{{{leader_title5|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title4}}}</td>
<td>{{{leader_name4}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title5|}}}
| <tr class="{{#if:{{{leader_title6|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title5}}}</td>
<td>{{{leader_name5}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title6|}}}
| <tr class="{{#if:{{{leader_title7|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title6}}}</td>
<td>{{{leader_name6}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title7|}}}
| <tr class="{{#if:{{{leader_title8|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title7}}}</td>
<td>{{{leader_name7}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title8|}}}
| <tr class="{{#if:{{{leader_title9|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title8}}}</td>
<td>{{{leader_name8}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title9|}}}
| <tr class="{{#if:{{{leader_title10|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title9}}}</td>
<td>{{{leader_name9}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title10|}}}
| <tr class="{{#if:{{{leader_title11|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title10}}}</td>
<td>{{{leader_name10}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title11|}}}
| <tr class="{{#if:{{{leader_title12|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title11}}}</td>
<td>{{{leader_name11}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title12|}}}
| <tr class="{{#if:{{{leader_title13|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title12}}}</td>
<td>{{{leader_name12}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title13|}}}
| <tr class="{{#if:{{{leader_title14|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title13}}}</td>
<td>{{{leader_name13}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title14|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title14}}}</td>
<td>{{{leader_name14}}}</td>
</tr><!--
-->}}<!--
============================================================
Legislature
============================================================
-->{{#if:{{{legislature|}}}
| <tr>
<th colspan="2">Legislature</th>
<td>{{{legislature}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{upper_house|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">[[Upper house]]</td>
<td>{{{upper_house}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{lower_house|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">[[Lower house]]</td>
<td>{{{lower_house}}}</td>
</tr><!--
-->}}<!--
============================================================
Sovereignty (country/territory)
Establishment (geopolitical organization)
============================================================
-->{{#if:{{{established_event1|}}}{{{sovereignty_type|}}}{{{established|}}}
| <tr {{#if:{{{established_event1|}}} |class="mergedtoprow"}}><!--
----------Sovereignty----------
-->{{#if:{{{sovereignty_type|}}}
| <th colspan="3">{{{sovereignty_type}}}<!--
-->{{#if:{{{sovereignty_note|}}} | {{nobold|{{{sovereignty_note}}} }}}}<!--
--></th><!--
---------Establishment----------
-->| {{#if:{{{established|}}}
| <th colspan="2">Establishment</th>
<td>{{{established}}}</td><!--
-->| <th colspan="3">Establishment</th><!--
-->}}<!--
-->}}<!--
--></tr><!--
-->}}<!--
============================================================
Significant events in country/territory
or organization's establishment
============================================================
-->{{#if:{{{established_event1|}}}
| <tr class="{{#if:{{{established_event2|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event1}}}</td>
<td>{{{established_date1|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event2|}}}
| <tr class="{{#if:{{{established_event3|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event2}}}</td>
<td>{{{established_date2|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event3|}}}
| <tr class="{{#if:{{{established_event4|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event3}}}</td>
<td>{{{established_date3|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event4|}}}
| <tr class="{{#if:{{{established_event5|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event4}}}</td>
<td>{{{established_date4|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event5|}}}
| <tr class="{{#if:{{{established_event6|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event5}}}</td>
<td>{{{established_date5|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event6|}}}
| <tr class="{{#if:{{{established_event7|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event6}}}</td>
<td>{{{established_date6|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event7|}}}
| <tr class="{{#if:{{{established_event8|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event7}}}</td>
<td>{{{established_date7|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event8|}}}
| <tr class="{{#if:{{{established_event9|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event8}}}</td>
<td>{{{established_date8|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event9|}}}
| <tr class="{{#if:{{{established_event10|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event9}}}</td>
<td>{{{established_date9|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event10|}}}
| <tr class="{{#if:{{{established_event11|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event10}}}</td>
<td>{{{established_date10|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event11|}}}
| <tr class="{{#if:{{{established_event12|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event11}}}</td>
<td>{{{established_date11|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event12|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event12}}}</td>
<td>{{{established_date12|}}} </td>
</tr><!--
-->}}<!--
============================================================
Area
(area_label, area_km2, area_label2, area_data2, ...)
============================================================
-->{{#if:{{{area_km2|{{{area_ha|}}}}}}
| <tr class="mergedtoprow">
<th colspan="3"><!--
-->{{#if:{{{area_link|}}}
| [[{{{area_link}}}|Area {{#ifeq:{{{micronation|}}}|yes|claimed|}}]]
| {{#ifexist:Geography of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Geography of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|Area {{#ifeq:{{{micronation|}}}|yes|claimed|}}]]
| Area {{#ifeq:{{{micronation|}}}|yes|claimed|}}<!--
-->}}<!--
-->}}<!--
--></th>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;"><!--
-->{{{area_label|Total}}}<!--
---France-related footnote:-->{{#if:{{{FR_foot4|}}} |{{{FR_foot4}}}}}</td>
<td>{{formatnum:{{{area_km2|{{{area_ha|}}}}}}}} {{#if:{{{area_km2|}}}
|km{{smallsup|2}}
|ha
}}<!--
-->{{#if:{{{area_footnote|}}} |{{{area_footnote}}} }}<!--
-->{{#if:{{{area_rank|}}} | ([[List of countries and dependencies by area|{{{area_rank}}}]]) }}<!--
-->{{#if:{{{area_sq_mi|}}}
|<br/>{{formatnum:{{{area_sq_mi}}}}} sq mi<!--
-->|<br/>{{#if:{{{area_acre|}}}
|{{formatnum:{{{area_acre}}}}} acre{{#ifexpr:{{{area_acre}}}=1||s}}
|{{#if:{{{area_km2|}}}
|{{formatnum:<!--
-->{{#expr:{{{area_km2|}}} div 2.589988110336 round 0}}}} sq mi
|{{formatnum:<!--
-->{{#expr:{{{area_ha|}}} div 0.4046856422 round 0}}}} acres
}}
}}<!--
-->}}</td>
</tr><!--
-->}}<!--
-------------------Percentage water--------------------
-->{{#if:{{{percent_water|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Water (%)</td>
<td>{{{percent_water}}}</td>
</tr><!--
-->}}<!--
------------------Area 2 (customized)-------------------
-->{{#if:{{{area_label2|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{area_label2|}}}</td>
<td>{{{area_data2|}}}</td>
</tr><!--
-->}}<!--
------------------Area 3 (customized)-------------------
-->{{#if:{{{area_label3|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{area_label3|}}}</td>
<td>{{{area_data3|}}}</td>
</tr><!--
-->}}<!--
-----------Areas of France-----------
-->{{#if:{{{FR_metropole|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td colspan="2" style="padding-left:0;">{{{FR_metropole}}}</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> </td>
<td style="padding-left:0;"> • [[Institut Géographique National|IGN]]{{{FR_foot2|}}}</td>
<td>{{formatnum:{{{FR_IGN_area_km2|}}}}} km{{smallsup|2}} ([[List of countries and dependencies by area|{{{FR_IGN_area_rank|}}}]])<!--
-->{{#if:{{{FR_IGN_area_sq_mi|}}}
|<br/>{{formatnum:{{{FR_IGN_area_sq_mi|}}}}}<!--
-->|<br/>{{formatnum:{{#expr:{{{FR_IGN_area_km2|}}} div 2.589988110336 round 0}}}}<!--
-->}} sq mi</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> </td>
<td style="padding-left:0;"> • [[Cadastre]]{{{FR_foot3|}}}</td>
<td>{{formatnum:{{{FR_cadastre_area_km2|}}}}} km{{smallsup|2}} ([[List of countries and dependencies by area|{{{FR_cadastre_area_rank|}}}]])<!--
-->{{#if:{{{FR_cadastre_area_sq_mi|}}}
|<br/>{{formatnum:{{{FR_cadastre_area_sq_mi|}}}}}
|<br/>{{formatnum:{{#expr:{{{FR_cadastre_area_km2|}}} div 2.589988110336 round 0}}}}<!--
-->}} sq mi</td>
</tr><!--
-->}}<!--
============================================================
Population
============================================================
-->{{#if:{{{population_estimate|}}}{{{population_census|}}}{{{FR_metropole_population|}}}
| <tr class="mergedtoprow">
<th colspan="3"><!--
-->{{#if:{{{population_link|}}}
| [[{{{population_link}}}|Population]]<!--
-->| {{#ifexist:Demographics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Demographics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|Population]]<!--
-->| Population<!--
-->}}<!--
-->}}<!--
--></th>
</tr><!--
---------------Estimate---------------
-->{{#if:{{{population_estimate|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;"><!--
-->{{#if:{{{population_estimate_year|}}} |{{{population_estimate_year}}} }}<!--
-->estimate</td>
<td>{{{population_estimate}}}<!--
-->{{#if:{{{population_estimate_rank|}}} | ([[List of countries by population|{{{population_estimate_rank}}}]])}}</td>
</tr><!--
-->}}<!--
------------------Population 2 (customized)-------------------
-->{{#if:{{{population_label2|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{population_label2|}}}</td>
<td>{{{population_data2|}}}</td>
</tr><!--
-->}}<!--
------------------Population 3 (customized)-------------------
-->{{#if:{{{population_label3|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{population_label3|}}}</td>
<td>{{{population_data3|}}}</td>
</tr><!--
-->}}<!--
----------------Census----------------
-->{{#if:{{{population_census|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;"><!--
-->{{#if:{{{population_census_year|}}} |{{{population_census_year}}} }}<!--
-->census</td>
<td>{{{population_census|}}}<!--
-->{{#if:{{{population_census_rank|}}} | ([[List of countries by population|{{{population_census_rank}}}]])}}</td>
</tr><!--
-->}}<!--
-->}}<!--
-------(France)-------
-->{{#if:{{{FR_metropole_population|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> </td>
<td colspan="2" style="padding-left:0;">({{{FR_total_population_estimate_year}}})</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Total{{{FR_foot}}}</td>
<td>{{{FR_total_population_estimate}}} ([[List of countries by population in 2005|{{{FR_total_population_estimate_rank}}}]])</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{FR_metropole}}}</td>
<td>{{{FR_metropole_population}}} ([[List of countries by population in 2005|{{{FR_metropole_population_estimate_rank}}}]])</td>
</tr><!--
-->}}<!--
---------------Density----------------
-->{{#if:{{{population_density_km2|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Density<!--
---France-related footnote:-->{{#if:{{{FR_foot5|}}} |{{{FR_foot5}}}}}</td>
<td>{{{population_density_km2|}}}/km{{smallsup|2}}<!--
-->{{#if:{{{pop_den_footnote|}}} |{{{pop_den_footnote|}}}}}<!--
-->{{#if:{{{population_density_rank|}}} | ([[List of sovereign states and dependent territories by population density|{{{population_density_rank}}}]])}}<!--
-->{{#if:{{{population_density_sq_mi|}}}
|<br/>{{formatnum:{{{population_density_sq_mi|}}}}}
|<br/>{{formatnum:{{#expr:{{{population_density_km2|}}} * 2.589988110336 round 1}}}}<!--
-->}}/sq mi</td>
</tr><!--
-->}}<!--
-->{{#if:{{{nummembers|}}}<!--
-->| {{#if:{{{population_estimate|}}}{{{population_census|}}}{{{FR_metropole_population|}}}
| <tr class="mergedbottomrow"> | <tr class="mergedtoprow">}}
<th colspan="2">Population</th>
<td style="vertical-align:middle;">{{{nummembers}}}</td>
</tr><!--
-->}}<!--
============================================================
GDP
============================================================
-----------------PPP-----------------
-->{{#if:{{{GDP_PPP|}}}
| <tr class="mergedtoprow">
<td colspan="2">'''{{#ifeq:{{{micronation|}}}|yes|Claimed|}} [[Gross domestic product|GDP]]''' ([[Purchasing power parity|PPP]])</td>
<td>{{#if:{{{GDP_PPP_year|}}} |{{{GDP_PPP_year}}} }}estimate</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Total</td>
<td>{{{GDP_PPP}}}<!--
-->{{#if:{{{GDP_PPP_rank|}}} | ([[List of countries by GDP (PPP)|{{{GDP_PPP_rank}}}]])}}</td>
</tr><!--
-------(PPP per capita)-------
-->{{#if:{{{GDP_PPP_per_capita|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Per capita</td>
<td>{{{GDP_PPP_per_capita}}}<!--
-->{{#if:{{{GDP_PPP_per_capita_rank|}}} | ([[List of countries by GDP (PPP) per capita|{{{GDP_PPP_per_capita_rank}}}]])}}</td>
</tr><!--
-->}}<!--
-->}}<!--
---------------Nominal---------------
-->{{#if:{{{GDP_nominal|}}}
| <tr class="mergedtoprow">
<td colspan="2">'''{{#ifeq:{{{micronation|}}}|yes|Claimed|}} [[Gross domestic product|GDP]]''' (nominal)</td>
<td>{{#if:{{{GDP_nominal_year|}}} |{{{GDP_nominal_year}}} }}estimate</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Total</td>
<td>{{{GDP_nominal}}}<!--
-->{{#if:{{{GDP_nominal_rank|}}} | ([[List of countries by GDP (nominal)|{{{GDP_nominal_rank}}}]])}}</td>
</tr><!--
-------(Nominal per capita)-------
-->{{#if:{{{GDP_nominal_per_capita|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Per capita</td>
<td>{{{GDP_nominal_per_capita}}}<!--
-->{{#if:{{{GDP_nominal_per_capita_rank|}}} | ([[List of countries by GDP (nominal) per capita|{{{GDP_nominal_per_capita_rank}}}]])}}</td>
</tr><!--
-->}}<!--
-->}}<!--
============================================================
Gini
============================================================
-->{{#if:{{{Gini|}}}
| <tr>
<td colspan="2">'''[[Gini_coefficient|Gini]]'''<!--
-->{{#if:{{{Gini_year|}}} | ({{{Gini_year}}})}}</td><!--
-----Include increase/decrease/steady icon
(if Gini_change provided):-----
--><td>{{#switch:{{{Gini_change|}}}
|increase = {{increaseNegative}} <!--
-->|decrease = {{decreasePositive}} <!--
-->|steady = {{steady}} <!--
-->}}<!--
-------Add Gini (and Gini_ref if supplied):-------
-->{{{Gini}}}{{{Gini_ref|}}}<br/><!--
---------Evaluate and add Gini category:----------
--><span style="white-space:nowrap;"><!--
-->{{#iferror:<!--
-->{{#ifexpr:{{{Gini}}}>100 <!--
-->| {{error|Error: Gini value above 100}}<!--Handled by outer #iferror, not visible to users--><!--
-->| {{#ifexpr:{{{Gini}}}>=60 |{{color|red|very high}}<!--
-->| {{#ifexpr:{{{Gini}}}>=46 <!--
-->| {{color|darkred|high}}<!--
-->| {{#ifexpr:{{{Gini}}}>=30 <!--
-->| {{color|orange|medium}}<!--
-->| {{#ifexpr:{{{Gini}}}>=0 <!--
-->| {{color|forestgreen|low}}<!--
-->| {{error|Error:Gini value below 0}}<!--Handled by outer #iferror, not visible to users--><!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->| {{error|Error: Invalid Gini value}}{{#ifeq: {{NAMESPACE}} | {{ns:0}} | [[Category:Country articles requiring maintenance]] }}<!--
-->}}<!--
--></span><!--
-----------Add Gini_rank (if supplied):----------
-->{{#if:{{{Gini_rank|}}}
|{{·}}[[List of countries by income equality|{{{Gini_rank}}}]]<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
HDI
============================================================
-->{{#if:{{{HDI|}}}
| <tr>
<td colspan="2"><!--
-->'''[[Human Development Index|HDI]]''' <!--
-->{{#if:{{{HDI_year|}}} |({{{HDI_year}}})}}</td><!--
-----Include increase/decrease/steady icon
(if HDI_change provided):-----
--><td>{{#switch:{{{HDI_change|}}}
|increase = {{increase}} <!--
-->|decrease = {{decrease}} <!--
-->|steady = {{steady}} <!--
-->}}<!--
-------Add HDI (and HDI_ref if supplied):-------
-->{{{HDI}}}{{{HDI_ref|}}}<br/><!--
---------Evaluate and add HDI category:---------
--><span style="white-space:nowrap;"><!--
-->{{#iferror:<!--
-->{{#ifexpr:{{{HDI}}}>1 <!--
-->| {{error|Error: HDI value greater than 1}}<!--Handled by outer #iferror, not visible to users--><!--
-->| {{#ifexpr:{{{HDI}}}>0.799 <!--
-->| {{color|darkgreen|very high}}<!--
-->| {{#ifexpr:{{{HDI}}}>0.699 <!--
-->| {{color|forestgreen|high}}<!--
-->| {{#ifexpr:{{{HDI}}}>0.549 <!--
-->| {{color|orange|medium}}<!--
-->| {{#ifexpr:{{{HDI}}}>=0.000<!--
-->| {{color|red|low}}<!--
-->| {{error|Error: HDI value less than 0}}<!--Handled by outer #iferror, not visible to users--><!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->| {{error|Error: Invalid HDI value}}{{#ifeq: {{NAMESPACE}} | {{ns:0}} | [[Category:Country articles requiring maintenance]] }}<!--
-->}}<!--
--></span><!--
----------Add HDI_rank (if supplied):-----------
-->{{#if:{{{HDI_rank|}}}
|{{·}}[[List of countries by Human Development Index|{{{HDI_rank}}}]]<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
Currency
============================================================
-->{{#if:{{{currency|}}}
| <tr>
<th colspan="2" style="vertical-align:middle;">{{#ifeq:{{{micronation|}}}|yes|Purported currency|Currency}}</th>
<td>{{{currency}}} {{#if:{{{currency_code|}}} |([[ISO 4217|{{{currency_code}}}]])}}</td>
</tr><!--
-->}}<!--
============================================================
Time zone
============================================================
-->{{#if:{{{time_zone|}}}{{{utc_offset|}}}
| <tr {{#if:{{{utc_offset_DST|}}}{{{DST_note|}}} |class="mergedtoprow"}}>
<th colspan="2">Time zone</th>
<td>{{{time_zone|}}} <!--
-->{{#if:{{{utc_offset|}}}
|{{nowrap|([[Coordinated Universal Time|UTC]]{{{utc_offset}}})}}<!--
-->}}</td>
</tr><!--
-->{{#if:{{{time_zone_DST|}}}{{{utc_offset_DST|}}}
| <tr class="{{#if:{{{DST_note|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Summer ([[Daylight saving time|DST]])</td>
<td>{{{DST|{{{time_zone_DST|}}}}}} ([[Coordinated Universal Time|UTC]]{{{utc_offset_DST}}})</td>
</tr><!--
-->}}<!--
-->}}<!--
-->{{#if:{{{DST_note|}}}
| <tr class="mergedbottomrow">
<td colspan="2"></td>
<td>{{{DST_note}}}</td>
</tr><!--
-->}}<!--
============================================================
Antipodes
============================================================
-->{{#if:{{{antipodes|}}}
| <tr>
<th colspan="2">[[Antipodes]]</th>
<td>{{{antipodes}}}</td>
</tr><!--
-->}}<!--
============================================================
Date format
============================================================
-->{{#if:{{{date_format|}}}
| <tr>
<th colspan="2">Date format</th>
<td>{{{date_format}}}</td>
</tr><!--
-->}}<!--
============================================================
Rule of the road
============================================================
-->{{#if:{{{drives_on|}}}
| <tr>
<th colspan="2">[[Right- and left-hand traffic|Drives on the]]</th>
<td>{{lcfirst:{{{drives_on}}}}}</td>
</tr><!--
-->}}<!--
============================================================
Calling code
============================================================
-->{{#if:{{{calling_code|}}}
| <tr>
<th colspan="2"><!--
-->{{#ifexist:Telephone numbers in {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Telephone numbers in {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|Calling code]]
| Calling code
}}</th>
<td>{{{calling_code}}}</td>
</tr><!--
-->}}<!--
============================================================
Patron saint/s
============================================================
-->{{#if:{{{patron_saint|{{{patron_saints|}}}}}}
| <tr>
<th colspan="2" >[[Patron saint]]{{#if:{{{patron_saints|}}}|s}}</th>
<td>{{{patron_saint|{{{patron_saints}}}}}}</td>
</tr><!--
-->}}<!--
============================================================
ISO 3166 code
============================================================
-->{{#switch:{{{iso3166code|}}}
|omit = <!--(do nothing)-->
| = <!--if iso3166code is not supplied:
-->{{#if:{{{common_name|}}}
| {{#ifexist:Template:ISO 3166 code {{{common_name|}}}
| <tr class="mergedtoprow">
<th colspan="2" style="white-space:nowrap;">[[ISO 3166|ISO 3166 code]]</th>
<td>[[ISO 3166-2:{{ISO 3166 code {{{common_name}}}}}|{{ISO 3166 code {{{common_name}}}}}]]</td>
</tr>
}}
}}
|#default = <tr>
<th colspan="2" style="white-space:nowrap;">[[ISO 3166|ISO 3166 code]]</th>
<td>[[ISO 3166-2:{{uc:{{{iso3166code}}}}}|{{uc:{{{iso3166code}}}}}]]</td>
</tr>
}}<!--
============================================================
Internet TLD
============================================================
-->{{#if:{{{cctld|}}}
| <tr>
<th colspan="2">[[Country code top-level domain|Internet TLD]]</th>
<td>{{{cctld}}}</td>
</tr><!--
-->}}<!--
============================================================
Official website (geopolitical organization)
============================================================
-->{{#if:{{{official_website|}}}
| <tr>
<td colspan="3" style="text-align:center;line-height:11pt;"><!--
-->'''Website'''<br/>{{{official_website}}}</td>
</tr><!--
-->}}<!--
============================================================
Bottom map
============================================================
-->{{#if:{{{image_map3|}}}
| <tr class="mergedtoprow">
<td colspan="3" style="padding:0.6em 0 0.3em;text-align:center;"><!--
-->[[File:{{{image_map3}}}|center<!--
-->|{{{map3_width|250px}}}<!--
-->|alt={{{alt_map3|}}}<!--
-->|Location of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}<!--
-->]]<!--
--><div style="position:relative;top:0.3em;font-size:85%;">{{{map_caption3|}}}</div>
</td>
</tr><!--
-->}}<!--
================================================================
Footnotes
================================================================
--------------------------------
Lettered
--------------------------------
-->{{#if:{{{footnote_a|}}}
| <tr style="font-size:85%;">
<td style="text-align:right;">{{lower|0.3em|<sup>a.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_a}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_b|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_c|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>b.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_b}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_c|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_d|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>c.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_c}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_d|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_e|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>d.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_d}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_e|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_f|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>e.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_e}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_f|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_g|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup><big>f.</big></sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_f}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_g|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_h|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>g.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_g}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_h|}}}
| <tr style="font-size:85%;" class="mergedbottomrow">
<td style="text-align:right;">{{lower|0.3em|<sup><big>h.</big></sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_h}}}</td>
</tr><!--
-->}}<!--
--------------------------------
Numbered
--------------------------------
-->{{#if:{{{footnote1|}}}
| <tr style="font-size:85%;">
<td style="text-align:right;">{{lower|0.3em|<sup>1.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote1}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote2|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote3|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>2.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote2}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote3|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote4|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>3.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote3}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote4|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote5|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>4.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote4}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote5|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote6|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>5.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote5}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote6|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote7|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>6.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote6}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote7|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote8|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>7.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote7}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote8|}}}
| <tr style="font-size:85%;" class="mergedbottomrow">
<td style="text-align:right;">{{lower|0.3em|<sup>8.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote8}}}</td>
</tr><!--
-->}}<!--
--------------------------------
Non-specific
--------------------------------
-->{{#if:{{{footnotes|}}}
| <tr>
<td colspan="3" style="font-size:85%;">{{{footnotes}}}</td>
</tr><!--
-->}}<!--
============================================================
Navbar
============================================================
-->{{#if:{{{navbar|}}}
| <tr class="mergedtoprow noprint">
<td colspan="3" style="text-align:center;">{{navbar|{{{navbar|}}}}}</td>
</tr><!--
-->}}<!--
--></table><noinclude>
{{documentation}}
</noinclude>
7befd87413bc2404be605b7053b2cc7ce12fc16d
Template:Infobox religion
10
225
448
2021-08-10T21:42:50Z
mh>Jokes
0
wikitext
text/x-wiki
<includeonly>{{Infobox
| above = {{#if: {{{icon|}}} |[[file:{{{icon}}}|{{{icon_width|25px}}}|alt={{{icon_alt|}}}]]<br/>{{{name|}}}|{{{name|{{PAGENAMEBASE}}}}}}}
| subheader = {{#if:{{{native_name|}}}|<span class="nickname">'''{{#if:{{{native_name_lang|}}}|{{lang|{{{native_name_lang}}}|{{{native_name}}}}}|{{{native_name}}}}}'''</span>}}
| bodystyle = width: 24em; font-size: 88%; text-align: left;
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{imagewidth|200px}}}|sizedefault=frameless|alt={{{alt|{{{imagealttext|}}}}}}}}
| caption = {{{caption|}}}
| labelstyle = white-space: nowrap;
| label1 = Abbreviation
| data1 = {{{abbreviation|}}}
| label2 = Type
| data2 = {{{type|}}}
| label3 = Classification
| data3 = {{{main_classification|}}}
| label4 = Orientation
| data4 = {{{orientation|}}}
| label5 = Scripture
| data5 = {{{scripture|}}}
| label6 = Theology
| data6 = {{{theology|}}}
| label7 = [[Ecclesiastical polity|Polity]]
| data7 = {{{polity|}}}
| label8 = [[Ecclesiastical polity|Governance]]
| data8 = {{{governance|}}}
| label9 = Structure
| data9 = {{{structure|}}}
| label10 = {{#if: {{{leader_title|}}} | {{{leader_title}}} | Moderator }}
| data10 = {{{leader_name|{{{leader/moderator|}}} }}}
| label11 = {{#if: {{{leader_title1|}}} | {{{leader_title1}}} | Leader }}
| data11 = {{{leader_name1|{{{leader|}}} }}}
| label12 = {{#if: {{{leader_title2|}}} | {{{leader_title2}}} | Director }}
| data12 = {{{leader_name2|{{{director|}}} }}}
| label13 = {{#if: {{{leader_title3|}}} | {{{leader_title3}}} }}
| data13 = {{{leader_name3|}}}
| label14 = {{#if: {{{fellowships_type|}}} | {{{fellowships_type}}} | Distinct fellowships }}
| data14 = {{{fellowships|}}}
| label15= {{#if: {{{fellowships_type1|}}} | {{{fellowships_type1}}} | Distinct fellowships }}
| data15= {{{fellowships1|}}}
| label16 = {{#if: {{{division_type|}}} | {{{division_type}}} | Divisions }}
| data16 = {{{division|}}}
| label17 = {{#if: {{{division_type1|}}} | {{{division_type1}}} | Divisions }}
| data17 = {{{division1|}}}
| label18 = {{#if: {{{division_type2|}}} | {{{division_type2}}} | Divisions }}
| data18 = {{{division2|}}}
| label19 = {{#if: {{{division_type3|}}} | {{{division_type3}}} | Divisions }}
| data19 = {{{division3|}}}
| label20 = Associations
| data20 = {{{associations|}}}
| label21 = Full Communion
| data21 = {{{full_communion|}}}
| label22 = Region
| data22 = {{{area|}}}
| label23 = Language
| data23 = {{{language|}}}
| label24 = Liturgy
| data24 = {{{liturgy|}}}
| label25 = Headquarters
| data25 = {{{headquarters|}}}
| label26 = Territory
| data26 = {{{territory|}}}
| label27 = Possessions
| data27 = {{{possessions|}}}
| label28 = Founder
| data28 = {{{founder|}}}
| label29 = Origin
| data29 = {{#if: {{{founded_date|}}} | {{{founded_date}}} }} {{#if:{{{founded_date|}}}{{{founded_place|}}} |}}{{#if:{{{founded_place|}}}| <br />{{{founded_place}}} }}
| label30 = Independence
| data30 = {{{independence|}}}
| label31 = Reunion
| data31 = {{{reunion|}}}
| label32 = Recognition
| data32 = {{{recognition|}}}
| label33 = [[Schism|Separated from]]
| data33 = {{{separated_from|}}}
| label34 = Branched from
| data34 = {{{branched_from|}}}
| label35 = [[Temple union|Merger of]]
| data35 = {{{merger|}}}
| label36 = Absorbed
| data36 = {{{absorbed|}}}
| label37 = Separations
| data37 = {{{separations|}}}
| label38 = Merged into
| data38 = {{{merged_into|}}}
| label39 = Defunct
| data39 = {{{defunct|}}}
| label40 = {{#if:{{{congregations_type|}}}|{{{congregations_type}}}|Congregations}}
| data40 = {{{congregations|}}}
| label41 = {{#if:{{{number_of_followers|}}}|Number of followers|Members}}
| data41 = {{#if:{{{number_of_followers|}}}|{{{number_of_followers}}}|{{{members|}}}}}
| label42 = {{#if:{{{ministers_type|}}} | {{{ministers_type}}} | [[Minister (Christianity)|Ministers]]}}
| data42 = {{{ministers|}}}
| label43 = Missionaries
| data43 = {{{missionaries|}}}
| label44 = Temple buildings
| data44 = {{{temples|}}}
| label45 = Hospitals
| data45 = {{{hospitals|}}}
| label46 = Nursing homes
| data46 = {{{nursing_homes|}}}
| label47 = Aid organization
| data47 = {{{aid|}}}
| label48 = [[Primary education|Primary schools]]
| data48 = {{{primary_schools|}}}
| label49 = [[Secondary education|Secondary schools]]
| data49 = {{{secondary_schools|}}}
| label50 = [[501c3|Tax status]]
| data50 = {{{tax_status|}}}
| label51 = [[Higher education|Tertiary institutions]]
| data51 = {{{tertiary|}}}
| label52 = Other name(s)
| data52 = {{{other_names|}}}
| label53 = Publications
| data53 = {{{publications|}}}
| label54 = Official website
| data54 = {{{website|}}}
| label55 = {{#if: {{{website_title1|}}} | {{{website_title1}}} | }}
| data55 = {{{website1|{{{website1|}}} }}}
| label56 = Slogan
| data56 = {{{slogan|}}}
| label57 = Logo
| data57 = {{{logo|}}}
| data58 = {{{misc|{{{module|}}}}}}
| belowstyle =
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox Christian denomination with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox Christian denomination]] with unknown parameter "_VALUE_"|ignoreblank=y| abbreviation | absorbed | aid | alt | area | associations | branched_from | caption | temples | congregations | congregations_type | defunct | director | division | division_type | division_type1 | division_type2 | division_type3 | division1 | division2 | division3 | fellowships | fellowships_type | fellowships_type1 | fellowships1 | footnotes | founded_date | founded_place | founder | full_communion | governance | headquarters | hospitals | icon | icon_alt | icon_width | image | imagealttext | imagewidth | independence | language | leader | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_title | leader_title1 | leader_title2 | leader_title3 | leader/moderator | liturgy | logo | main_classification | members | merged_into | merger | ministers | ministers_type | missionaries | module | name | native_name | native_name_lang | number_of_followers | nursing_homes | orientation | other_names | polity | possessions | primary_schools | publications | recognition | reunion | scripture | secondary_schools | separated_from | separations | slogan | structure | tax_status | territory | tertiary | theology | type | website | website_title1 | website1 }}</includeonly><noinclude>
{{documentation}}
</noinclude>
0c789ced5ab2306757f039cd2a1698b8f440fa7b
Template:Infobox person
10
226
450
2021-10-07T05:05:38Z
mh>Ham62
0
added character race and IGN
wikitext
text/x-wiki
{{Infobox|child={{{child|}}}
| bodyclass = biography vcard
| above = {{Br separated entries
| 1 = {{#if:{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}|<span class="honorific-prefix" style="font-size: 77%; font-weight: normal;">{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}</span>}}
| 2 = <span class="fn">{{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}</span>
| 3 = {{#if:{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}|<span class="honorific-suffix" style="font-size: 77%; font-weight: normal;">{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}</span>}}
}}
| abovestyle = {{{abovestyle|}}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption = {{{image caption|{{{caption|{{{image_caption|}}}}}}}}}
| label1 = Native name
| data1 = {{#if:{{{native_name|}}}|<span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}
| label2 = Pronunciation
| data2 = {{{pronunciation|}}}
| label10 = Born
| data10 = {{Br separated entries|1={{#if:{{{birth_name|{{{birthname|}}}}}}|<span class="nickname">{{{birth_name|{{{birthname|}}}}}}</span>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<span class="birthplace">{{{birth_place|}}}</span>}}}}
| label420 = IGN
| data420 = {{{ign|}}}
| label421 = Race
| data421 = {{{race|}}}
| label11 = Bapti{{#if:{{{baptized|}}}|z|s}}ed
| data11 = {{#if:{{{birth_date|}}}||{{{baptized|{{{baptised|}}}}}}}}
| label12 = Disappeared
| data12 = {{Br separated entries|1={{{disappeared_date|}}}|2={{{disappeared_place|}}}}}
| label13 = Status
| data13 = {{{status|{{{disappeared_status|}}}}}}
| label14 = Died
| data14 = {{Br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<span class="deathplace">{{{death_place|}}}</span>}}}}
| label15 = Cause of death
| data15 = {{{death cause|{{{death_cause|}}}}}}
| label16 = Body discovered
| data16 = {{{body discovered|{{{body_discovered|}}}}}}
| label17 = {{#if:{{{burial_place|}}}|Burial place|Resting place}}
| data17 = {{#if:{{{burial_place|}}}|{{Br separated entries|1={{{burial_place|}}}|2={{{burial_coordinates|}}}}}|{{Br separated entries|1={{{resting place|{{{resting_place|{{{restingplace|}}}}}}}}}|2={{{resting place coordinates|{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}}}}}}}}
| class17 = label
| label18 = Monuments
| data18 = {{{monuments|}}}
| label19 = Residence
| data19 = {{{residence|}}}
| class19 = {{#if:{{{death_date|}}}{{{death_place|}}}||label}}
| label20 = Nationality
| data20 = {{{nationality|}}}
| class20 = category
| label21 = Other names
| data21 = {{{other names|{{{other_names|{{{othername|{{{nickname|{{{alias|}}}}}}}}}}}}}}}
| class21 = nickname
| label23 = Citizenship
| data23 = {{{citizenship|}}}
| class23 = category
| label24 = Education
| data24 = {{{education|}}}
| label25 = Alma mater
| data25 = {{{alma mater|{{{alma_mater|}}}}}}
| label26 = Occupation
| data26 = {{{occupation|}}}
| class26 = role
| label27 = Years active
| data27 = {{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}
| label28 = Era
| data28 = {{{era|}}}
| class28 = category
| label29 = Employer
| data29 = {{{employer|}}}
| class29 = org
| label30 = {{#if:{{{organisation|}}}|Organisation|Organization}}
| data30 = {{{organisation|{{{organization|{{{organizations|}}}}}}}}}
| class30 = org
| label31 = Agent
| data31 = {{{agent|}}}
| class31 = agent
| label32 = Known for
| data32 = {{{known for|{{{known_for|{{{known|}}}}}}}}}
| label33 = <span style="white-space:nowrap;">{{#if:{{{works|}}}|Works|{{#if:{{{credits|}}}|Notable credit(s)|{{#if:{{{label_name|}}}|Label(s)|Notable work}}}}}}</span>
| data33 = {{#if:{{{works|}}}|{{{works|}}}|{{#if:{{{credits|}}}|{{{credits}}}|{{#if:{{{label_name|}}}|{{{label_name}}}|{{{notable works|{{{notable_works|}}}}}}}}}}}}
| label34 = Style
| data34 = {{{style|}}}
| class34 = category
| label37 = Home town
| data37 = {{{home town|{{{home_town|}}}}}}
| label38 = Salary
| data38 = {{{salary|}}}
| label39 = Net worth
| data39 = {{{net worth|{{{net_worth|{{{networth|}}}}}}}}}
| label40 = Height
| data40 = {{#if:{{{height_m|{{{height_cm|}}}}}}{{{height_ft|}}}{{{height_in|}}} | {{convinfobox|{{{height_m|{{{height_cm|}}}}}}|{{#if:{{{height_m|}}}|m|cm}}|{{{height_ft|}}}|ft|{{{height_in|}}}|in}}}}{{#if:{{{height|}}} | {{infobox person/height|{{{height|}}}}}}}
| label41 = Weight
| data41 = {{#if:{{{weight_kg|}}}{{{weight_st|}}}{{{weight_lb|}}} | {{convinfobox|{{{weight_kg|}}}|kg|{{{weight_st|}}}|st|{{{weight_lb|}}}|lb}}}}{{#if:{{{weight|}}} | {{infobox person/weight|{{{weight|}}}}}}}
| label42 = Television
| data42 = {{{television|}}}
| label43 = {{#if:{{{office|}}}|Office|Title}}
| data43 = {{{office|{{{title|}}}}}}
| class43 = title
| label44 = Term
| data44 = {{{term|}}}
| label45 = Predecessor
| data45 = {{{predecessor|}}}
| label46 = Successor
| data46 = {{{successor|}}}
| label47 = Political party
| data47 = {{{party|}}}
| class47 = org
| label48 = Movement
| data48 = {{{movement|}}}
| class48 = category
| label49 = <span class="nowrap">Opponent(s)</span>
| data49 = {{{opponents|}}}
| label50 = Board member of
| data50 = {{{boards|}}}
| label51 = Criminal charge
| data51 = {{{criminal charge|{{{criminal_charge|}}}}}}
| label52 = Criminal penalty
| data52 = {{{criminal penalty|{{{criminal_penalty|}}}}}}
| label53 = {{#if:{{{judicial status|{{{judicial_status|}}}}}}|Judicial status|Criminal status}}
| data53 = {{#if:{{{judicial status|{{{judicial_status|}}}}}} | {{{judicial status|{{{judicial_status}}}}}} | {{{criminal status|{{{criminal_status|}}}}}}}}
| class53 = category
| label54 = <span class="nowrap">Spouse(s)</span>
| data54 = {{{spouse|{{{spouses|{{{spouse(s)|}}}}}}}}}
| label55 = <span class="nowrap">Partner(s)</span>
| data55 = {{{partner|{{{domesticpartner|{{{domestic_partner|{{{partners|{{{partner(s)|}}}}}}}}}}}}}}}
| label56 = Children
| data56 = {{{children|}}}
| label57 = Parent{{#if:{{{parents|}}}|(s)|{{#if:{{{father|}}}|{{#if:{{{mother|}}}|s|(s)}}|(s)}}}}
| data57 = {{#if:{{{parents|}}}|{{{parents}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}
| label58 = Relatives
| data58 = {{{relations|{{{relatives|}}}}}}
| label59 = Family
| data59 = {{{family|}}}
| label60 = Call-sign
| data60 = {{{callsign|}}}
| label61 = Awards
| data61 = {{{awards|}}}
| label62 = {{#if:{{{honours|}}}|Honours|Honors}}
| data62 = {{{honours|{{{honors|}}}}}}
| label63 = Website
| data63 = {{{website|{{{homepage|{{{URL|{{{url|}}}}}}}}}}}}
| data64 = {{{misc|{{{module|}}}}}}
| data65 = {{{misc2|{{{module2|}}}}}}
| data66 = {{{misc3|{{{module3|}}}}}}
| data67 = {{{misc4|{{{module4|}}}}}}
| data68 = {{{misc5|{{{module5|}}}}}}
| data69 = {{{misc6|{{{module6|}}}}}}
| header70 = {{#if:{{{signature|}}}|Signature}}
| data71 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}}
| header72 = {{#if:{{{footnotes|}}}|Notes}}
| data73 = {{#if:{{{footnotes|}}}|<div style="text-align: left;">
{{{footnotes}}}</div>}}
}}<!--
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox person with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox person]] with unknown parameter "_VALUE_"|ignoreblank=y
| abovestyle | agent | alias | alma mater | alma_mater | alt | awards | baptised | baptized | birth_date | birth_name | birth_place | birthname | boards | body discovered | body_discovered | burial_coordinates | burial_place | callsign | caption | child | children | citizenship | credits | criminal charge | criminal penalty | criminal status | criminal_charge | criminal_penalty | criminal_status | death cause | death_cause | death_date | death_place | disappeared_date | disappeared_place | disappeared_status | domestic_partner | domesticpartner | education | employer | era | family | father | footnotes | height | height_cm | height_ft | height_in | height_m | home town | home_town | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | honorific-prefix | honorific-suffix | honors | honours | image | image caption | image size | image_caption | image_size | image_upright | imagesize | judicial status | judicial_status | known | known for | known_for | label_name | misc | misc2 | misc3 | misc4 | misc5 | misc6 | module | module2 | module3 | module4 | module5 | module6 | monuments | mother | movement | name | nationality | native_name | native_name_lang | net worth | net_worth | networth | nickname | nocat_wdimage | notable works | notable_works | occupation | office | opponents | organisation | organization | organizations | other names | other_names | othername | parents | partner | partner | partner(s) | party | predecessor | pre-nominals | post-nominals | pronunciation | relations | relatives | residence | resting place | resting place coordinates | resting_place | resting_place_coordinates | restingplace | restingplacecoordinates | salary | signature | signature alt | signature_alt | signature_size | spouse | spouses | spouse(s) | status | style | successor | television | term | title | URL | url | website | weight | weight_kg | weight_lb | weight_st | works | years active | years_active | yearsactive}}{{main other|
{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}|[[Category:Infobox person using numbered parameter]]}}<!--
-->{{#if:{{{box_width|}}}|[[Category:Infobox person using boxwidth parameter]]}}<!--
-->{{#if:{{{death_date|}}}{{{death_place|}}}|{{#if:{{{salary|}}}{{{net worth|{{{net_worth|{{{networth|}}}}}}}}}|[[Category:Infobox person using certain parameters when dead]]}}}}<!--
-->{{#if:{{{influences|}}}{{{influenced|}}}|[[Category:Infobox person using influence]]}}<!--
-->{{#if:{{{ethnicity|}}}|[[Category:Infobox person using ethnicity]]}}<!--
-->{{#if:{{{religion|}}}|[[Category:Infobox person using religion]]}}<!--
-->{{#if:{{{denomination|}}}|[[Category:Infobox person using denomination]]}}<!--
-->{{#if:{{{pronunciation|}}}|[[Category:Biography template using pronunciation]]}}<!--
-->{{#if:{{{signature|}}}|[[Category:Biography with signature]]}}<!--
-->{{#if:{{{image|}}}|[[Category:Articles with hCards]]
}}}}<noinclude>
{{Documentation}}{{En-WP attribution notice|Template:Infobox person}}</noinclude>
eb958daafe6ae0010c95d1b367afe7e72f9a4b5c
Template:Category link with count
10
32
62
2021-10-15T05:27:52Z
mh>Zaktoslph
0
1 revision imported from [[:wikipedia:Template:Category_link_with_count]]
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Module:Hatnote/styles.css
828
113
224
2021-10-15T05:28:15Z
mh>Zaktoslph
0
1 revision imported from [[:wikipedia:Module:Hatnote/styles.css]]
text
text/plain
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Module:Infobox
828
13
24
2021-10-15T05:28:16Z
mh>Zaktoslph
0
1 revision imported from [[:wikipedia:Module:Infobox]]
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages which use infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages which use embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
base_templatestyles, -- see function description
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
c38bb7c8249049bbfd594fa42a9aca6b5b9b8ded
Module:Infobox/styles.css
828
14
26
2021-10-15T05:28:17Z
mh>Zaktoslph
0
1 revision imported from [[:wikipedia:Module:Infobox/styles.css]]
text
text/plain
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
4e60b3cfbf50d1fd637f4a5af11a460a6569e988
Module:Lua banner
828
101
200
2021-10-15T05:28:17Z
mh>Zaktoslph
0
1 revision imported from [[:wikipedia:Module:Lua_banner]]
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Lua String-based templates',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation'] = 'Lua-based citation templates'
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
c2b844759e77866802cbfea71da923198539a90c
Module:Navbar
828
192
382
2021-10-15T05:28:18Z
mh>Zaktoslph
0
1 revision imported from [[:wikipedia:Module:Navbar]]
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
font_style = (font_style or '') .. ';text-decoration:inherit;'
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
daf988cd3d1f449dbc3ff6129578c8bec3dd9ec4
Module:Navbar/styles.css
828
194
386
2022-11-16T00:15:38Z
mh>KyleJoebiley
0
KyleJoebiley changed the content model of the page [[Module:Navbar/styles.css]] from "plain text" to "Sanitized CSS"
text
text/plain
/* {{pp|small=yes}} */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
/* Navbar styling when nested in infobox and navbox
Should consider having a separate TemplateStyles for those specific places
using an infobox/navbox and a navbar, or possibly override from using template */
.infobox .navbar {
font-size: 100%;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
f4cf6b1111f177ad6af0154b14f9c942400f3636
Template:Infobox continent/doc
10
270
538
2023-06-13T18:54:10Z
mh>Rikke
0
Changed "nations" to "states"
wikitext
text/x-wiki
{{Documentation subpage}}
=== Usage ===
<syntaxhighlight>
{{Infobox continent
|title =
|image =
|imagecaption =
|area =
|population =
|ethnic_groups =
|demonym =
|states =
|cities =
|footnotes =
}}
</syntaxhighlight>
=== Template data ===
{{TemplateData header}}
<templatedata>
{
"params": {
"title": {
"description": "The name of the article",
"type": "string"
},
"image": {
"description": "An image of the continent",
"type": "wiki-file-name"
},
"area": {
"description": "The total land area of the continent"
},
"population": {
"description": "The total population of the continent"
},
"demonym": {
"description": "A name for a resident of locality derived from the name of the continent",
"type": "string"
},
"states": {
"description": "The total number of states whose capital is located on the continent",
"type": "number"
},
"cities": {
"description": "The most notable and highly populated cities on the continent"
},
"footnotes": {}
},
"description": "A template used to give an overview of a continent."
}
</templatedata>
4e00c9d4bed6ea60a9ef30a8ca5c675bf4c61f8a
Template:Infobox lore book/doc
10
229
456
2023-06-20T08:01:04Z
mh>Rikke
0
Fixed typo
wikitext
text/x-wiki
{{Documentation subpage}}
== Usage ==
<syntaxhighlight>
{{Infobox lore book
|title =
|image =
|caption =
|author =
|genre =
|pages =
|created =
|publisher =
|location =
}}
</syntaxhighlight>
=== Template data ===
{{TemplateData header}}
<templatedata>
{
"params": {
"title": {
"description": "The in-game name for the written book",
"type": "string",
"suggested": true
},
"image": {
"description": "Picture of the book",
"type": "wiki-file-name",
"default": "File:Minecraft-how-to-make-a-book.jpg",
"suggested": true,
"example": "File:Minecraft-how-to-make-a-book.jpg"
},
"caption": {
"description": "A caption for the image",
"example": "Written book depicting the text"
},
"author": {
"description": "The person or group responsible for creating the book",
"type": "string",
"default": "Unknown",
"suggested": true
},
"genre": {
"type": "string",
"suggested": true,
"default": "Lore",
"example": "History, fiction"
},
"pages": {
"description": "Total number of pages in the book",
"type": "number",
"example": "0"
},
"created": {
"description": "The in-lore date for the book's creation",
"type": "string",
"suggested": true
},
"publisher": {
"description": "The organization that prints and distributes the book",
"type": "string"
},
"location": {
"description": "Where the book is currently being stored and/or available for viewing",
"example": "Town library",
"type": "string",
"default": "Unknown",
"suggested": true
}
},
"description": "This is an altered version of the default book template that only contains the infobox and has no requirements other than the book title. Feel free to use it to document any of your books."
}
</templatedata>
adf8b3cbb701c60a580fd8a5dfd0417f874fcee0
Template:Infobox lore book
10
224
446
2023-06-20T08:06:37Z
mh>Rikke
0
Added a header
wikitext
text/x-wiki
{{Infobox
| title = {{{title|}}}
| image = {{{image|}}}
| caption1 = {{{caption|}}}
| headerstyle = background:lightgrey
| header1 = General information
| label2 = Author
| data2 = {{{author|}}}
| label3 = Genre
| data3 = {{{genre|}}}
| label4 = Page count
| data4 = {{{pages|}}}
| label5 = Created
| data5 = {{{created|}}}
| label6 = Publisher
| data6 = {{{publisher|}}}
| label7 = Current location
| data7 = {{{location|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
e35fb453971baf9c887567ef3fae2d49c1aec402
Template:Archive/doc
10
185
368
2023-07-27T10:26:40Z
mh>Rikke
0
Parameter fix test #1
wikitext
text/x-wiki
{{Documentation subpage}}
The '''Archive''' template is a maintenance template used for creating message boxes related to archival work.
=== Usage ===
The full template syntax is as follows: {{tlx|Archive|status{{=}}''status''|''category''}}
By placing {{tlx|Archive|status{{=}}''status''}} at the top of a page, an informational banner will appear. The parameter for ''status'' is required, while ''category'' is suggested to be used when archiving is complete.
The following table contains ''status'' keywords that automatically fill the banner with relevant information:
{|class="wikitable"
! Status
! Description
|-
|done
|Use for articles which have been properly archived
|-
|undone
|Use for articles that need to be archived and protected from edits. Page is placed into [[:Category:Articles for archiving]]
|-
|}
Providing a ''category'' value automatically places the page into an archive category. Its values include:
{|class="wikitable"
! Value
! Category
|-
|nation
|[[:Category:Alathra Nations Archive]]
|-
|town
|[[:Category:Alathra Towns Archive]]
|-
|place
|[[:Category:Alathra Places Archive]]
|-
|event
|[[:Category:Alathra Events Archive]]
|-
|player
|[[:Category:Alathra Players Archive]]
|-
|org
|[[:Category:Alathra Organizations Archive]]
|-
|religion
|[[:Category:Alathra Religions Archive]]
|-
|lore
|[[:Category:Alathra Lore Archive]]
|-
|item
|[[:Category:Alathra Artifacts/Items Archive]]
|-
|book
|[[:Category:Alathra Books Archive]]
|}
=== Template data ===
{{TemplateData header}}
<templatedata>
{
"params": {
"status": {
"description": "Status of the page relating to archiving",
"type": "string",
"required": true
}
},
"description": "General template for archival-related message boxes."
}
</templatedata>
dd62cd3657d58ab8e5fc24f37d46d55ed06bd64e
Main Page/styles.css
0
327
652
2023-07-31T22:18:51Z
mh>UpsideKen
0
wikitext
text/x-wiki
.header-img
{
border-radius: 15px;
}
.menu {
background-color: #7E7E7E;
font-size: 24;
}
35a1b2a34195b7e4f604fc3001c0266455611d05
Template:Infobox character
10
314
626
2024-03-12T19:39:40Z
mh>Rikke
0
Centered labels to potentially fix mobile view misalignment
wikitext
text/x-wiki
{{Infobox
| title = <small>{{{title|}}}</small>
| abovestyle = background:#ffc757; text-align:center;
| above = {{#if: {{{name|}}} | {{{name|}}} | {{PAGENAME}}}}
| subheaderstyle = text-align:center;
| subheader = {{{nickname|}}}
| imagestyle = text-align:center;
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| captionstyle = text-align:center;
| caption = {{{caption|}}}
| headerstyle = background:#f5dba6; text-align:center;
| header1 = {{{governance|}}}
| data2 = {{{govern_period|}}}
| label3 = Preceded by
| data3 = {{#if: {{{governance|}}} | {{{predecessor|}}}}}
| label4 = Succeeded by
| data4 = {{#if: {{{governance|}}} | {{{successor|}}}}}
| header5 = Personal information
| label6 = Born
| data6 = {{#if: {{{birth_name|}}} | {{#if: {{{birth_date|}}} | {{#if: {{{birth_place|}}} | {{{birth_name|}}}</br>{{{birth_date|}}}</br>{{{birth_place|}}} | {{{birth_name|}}}</br>{{{birth_date|}}}}} | {{{birth_name|}}}}} | {{#if: {{{birth_date|}}} | {{#if: {{{birth_place|}}} | {{{birth_date|}}}</br>{{{birth_place|}}} | {{{birth_date|}}}}} | {{{birth_place|}}}}}
}}
| label7 = Died
| data7 = {{#if: {{{death_date|}}} | {{#if: {{{death_place|}}} | {{{death_date|}}}</br>{{{death_place|}}} | {{{death_date|}}}}} | {{{death_place|}}}}}
| label8 = Former names
| data8 = {{{former_names|}}}
| label9 = Resting place
| data9 = {{{resting_place|}}}
| label10 = Nationality
| data10 = {{{nationality|}}}
| label11 = Citizenship
| data11 = {{{citizenship|}}}
| label12 = Education
| data12 = {{{education|}}}
| label13 = Occupation
| data13 = {{{occupation|}}}
| label14 = Years active
| data14 = {{{years_active|}}}
| label15 = Organization
| data15 = {{{organization|}}}
| label16 = Height
| data16 = {{{height|}}}
| label17 = Awards
| data17 = {{{awards|}}}
| label18 = Notable work
| data18 = {{{notable_work|}}}
| header19 = {{#if: {{{spouse1|}}}{{{children|}}}{{{parents|}}} | Family info}}
| label20 = {{#if: {{{spouse2|}}}{{{spouse3|}}} | Spouses | Spouse}}
| data20 = {{#if: {{{spouse2|}}} | {{{spouse1|}}}</br>{{{spouse2|}}} | {{{spouse1|}}}}}{{#if: {{{spouse3|}}} | </br>{{{spouse3|}}}}}
| label21 = Children
| data21 = {{{children|}}}
| label22 = Parents
| data22 = {{{parents|}}}
| data23 = {{#if: {{{signature|}}} | ''Signature''}}
| data24 = {{{module1|}}}
| data25 = {{{module1|}}}
| data26 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
d08a64d7bfca81fbc507465be1c78770ea62411c
Template:Infobox continent
10
227
452
2024-03-14T15:41:09Z
mh>Rikke
0
Centered labels to potentially fix mobile view misalignment
wikitext
text/x-wiki
{{Infobox
|titlestyle = text-align:center;
|title = {{{title|}}}
|imagestyle = text-align:center;
|image = {{{image|}}}
|caption = {{{imagecaption|}}}
|label1 = Area
|data1 = {{{area|}}}
|label2 = Population
|data2 = {{{population|}}}
|label3 = Demonym
|data3 = {{{demonym|}}}
|label4 = States
|data4 = {{{states|}}}
|label5 = Largest cities
|data5 = {{{cities|}}}
|belowstyle = text-align:left; border-top:#aaa 1px solid;
|below = {{{footnotes|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
29bb455ef339661a4f04d566a9d53e5d117410f5
Module:Message box
828
18
34
2024-03-26T10:05:30Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Message_box]]
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s%s|alt=]]', self.typeImage
or 'Information icon4.svg', imageSize, self.typeImageNeedsLink and "" or "|link=" )
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
f2fb84f7b817d2d88747f57c40902a0d8be8158a
Module:Message box/configuration
828
19
36
2024-03-26T10:05:30Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Message_box/configuration]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox-license.svg'
},
["license-related"] = {
class = 'imbox-license',
image = 'Imbox-license.svg'
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg',
imageNeedsLink = true
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
ccb6bdf2868087b6833d203307f2f6a92b3b0a01
Module:Check for unknown parameters
828
11
20
2024-03-26T10:05:33Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Check_for_unknown_parameters]]
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Module:String
828
17
32
2024-03-26T10:05:33Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:String]]
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The first index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
2ad0905c56ef4955950b75a8f00974fe82aed5e4
Module:List
828
26
50
2024-03-26T10:05:33Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:List]]
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Module:TableTools
828
23
44
2024-03-26T10:05:34Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:TableTools]]
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
Template:Distinguish
10
186
370
2024-03-26T10:05:36Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:Distinguish]]
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
Module:Hatnote
828
112
222
2024-03-26T10:05:37Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Hatnote]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
3ae1ed7094c5005ca0896395ec9a587287a0bef1
Module:Format link
828
178
354
2024-03-26T10:05:37Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Format_link]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) then
local success, exists = pcall(function() return title.exists end)
if success and not exists then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
1253bdd2683ee4badc33856bfd5499b09a7dca1f
Module:Hatnote list
828
179
356
2024-03-26T10:05:38Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Hatnote_list]]
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation at end of string, ignoring italics and links
local function punctuationCollapse (text)
return text:match("[.?!]('?)%1(%]?)%2%.$") and text:sub(1, -2) or text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
1c8e6212115f76ecc3db8d05137011cd18207988
Template:Documentation
10
27
52
2024-03-26T10:05:41Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:Documentation]]
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Module:Documentation
828
29
56
2024-03-26T10:05:41Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Documentation]]
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
-- 'module-sandbox-category' --> 'Module sandboxes'
-- 'other-sandbox-category' --> 'Sandboxes outside of template or module namespace'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype, sandboxCat
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
sandboxCat = message('sandbox-category')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
sandboxCat = message('module-sandbox-category')
else
pagetype = message('sandbox-notice-pagetype-other')
sandboxCat = message('other-sandbox-category')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(sandboxCat)
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
return message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
return message('create-module-doc-blurb', {createLink})
.. '<br />'
end
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
return makeCategoryLink(message('strange-usage-category'))
end
return ''
end
return p
d6c1bffca24be2d81fa882315ac613f5bb6b227c
57
56
2024-06-03T23:42:36Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements {{documentation}}.
-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
-- Get the config table.
local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions.
local ugsub = mw.ustring.gsub
local format = mw.ustring.format
----------------------------------------------------------------------------
-- Helper functions
--
-- These are defined as local functions, but are made available in the p
-- table for testing purposes.
----------------------------------------------------------------------------
local function message(cfgKey, valArray, expectType)
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- The function raises an error if the value from the cfg table is not
-- of the type expectType. The default type for expectType is 'string'.
-- If the table valArray is present, strings such as $1, $2 etc. in the
-- message are substituted with values from the table keys [1], [2] etc.
-- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
--]]
local msg = cfg[cfgKey]
expectType = expectType or 'string'
if type(msg) ~= expectType then
error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
end
if not valArray then
return msg
end
local function getMessageVal(match)
match = tonumber(match)
return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
end
return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
end
p.message = message
local function makeWikilink(page, display)
if display then
return format('[[%s|%s]]', page, display)
else
return format('[[%s]]', page)
end
end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort)
local catns = mw.site.namespaces[14].name
return makeWikilink(catns .. ':' .. cat, sort)
end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display)
return format('[%s %s]', url, display)
end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...)
local ret = {}
local lim = select('#', ...)
if lim < 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
-- 'documentation-toolbar'
return format(
'<span class="%s">(%s)</span>',
message('toolbar-class'),
table.concat(ret, ' | ')
)
end
p.makeToolbar = makeToolbar
----------------------------------------------------------------------------
-- Argument processing
----------------------------------------------------------------------------
local function makeInvokeFunc(funcName)
return function (frame)
local args = getArgs(frame, {
valueFunc = function (key, value)
if type(value) == 'string' then
value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
if key == 'heading' or value ~= '' then
return value
else
return nil
end
else
return value
end
end
})
return p[funcName](args)
end
end
----------------------------------------------------------------------------
-- Entry points
----------------------------------------------------------------------------
function p.nonexistent(frame)
if mw.title.getCurrentTitle().subpageText == 'testcases' then
return frame:expandTemplate{title = 'module test cases notice'}
else
return p.main(frame)
end
end
p.main = makeInvokeFunc('_main')
function p._main(args)
--[[
-- This function defines logic flow for the module.
-- @args - table of arguments passed by the user
--]]
local env = p.getEnvironment(args)
local root = mw.html.create()
root
:wikitext(p._getModuleWikitext(args, env))
:wikitext(p.protectionTemplate(env))
:wikitext(p.sandboxNotice(args, env))
:tag('div')
-- 'documentation-container'
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:tag('div')
-- 'documentation'
:addClass(message('main-div-classes'))
:newline()
:wikitext(p._startBox(args, env))
:wikitext(p._content(args, env))
:tag('div')
-- 'documentation-clear'
:addClass(message('clear'))
:done()
:newline()
:done()
:wikitext(p._endBox(args, env))
:done()
:wikitext(p.addTrackingCategories(env))
-- 'Module:Documentation/styles.css'
return mw.getCurrentFrame():extensionTag (
'templatestyles', '', {src=cfg['templatestyles']
}) .. tostring(root)
end
----------------------------------------------------------------------------
-- Environment settings
----------------------------------------------------------------------------
function p.getEnvironment(args)
--[[
-- Returns a table with information about the environment, including title
-- objects and other namespace- or path-related data.
-- @args - table of arguments passed by the user
--
-- Title objects include:
-- env.title - the page we are making documentation for (usually the current title)
-- env.templateTitle - the template (or module, file, etc.)
-- env.docTitle - the /doc subpage.
-- env.sandboxTitle - the /sandbox subpage.
-- env.testcasesTitle - the /testcases subpage.
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
--
-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
-- returned will be nil.
--]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
-- returned by that function is memoized in the env table so that we don't call any of the functions
-- more than once. (Nils won't be memoized.)
setmetatable(env, {
__index = function (t, key)
local envFunc = envFuncs[key]
if envFunc then
local success, val = pcall(envFunc)
if success then
env[key] = val -- Memoise the value.
return val
end
end
return nil
end
})
function envFuncs.title()
-- The title object for the current page, or a test page passed with args.page.
local title
local titleArg = args.page
if titleArg then
title = mw.title.new(titleArg)
else
title = mw.title.getCurrentTitle()
end
return title
end
function envFuncs.templateTitle()
--[[
-- The template (or module, etc.) title object.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
-- 'testcases-subpage' --> 'testcases'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local subpage = title.subpageText
if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
return mw.title.makeTitle(subjectSpace, title.baseText)
else
return mw.title.makeTitle(subjectSpace, title.text)
end
end
function envFuncs.docTitle()
--[[
-- Title object of the /doc subpage.
-- Messages:
-- 'doc-subpage' --> 'doc'
--]]
local title = env.title
local docname = args[1] -- User-specified doc page.
local docpage
if docname then
docpage = docname
else
docpage = env.docpageBase .. '/' .. message('doc-subpage')
end
return mw.title.new(docpage)
end
function envFuncs.sandboxTitle()
--[[
-- Title object for the /sandbox subpage.
-- Messages:
-- 'sandbox-subpage' --> 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --> 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
function envFuncs.subjectSpace()
-- The subject namespace number.
return mw.site.namespaces[env.title.namespace].subject.id
end
function envFuncs.docSpace()
-- The documentation namespace number. For most namespaces this is the
-- same as the subject namespace. However, pages in the Article, File,
-- MediaWiki or Category namespaces must have their /doc, /sandbox and
-- /testcases pages in talk space.
local subjectSpace = env.subjectSpace
if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
return subjectSpace + 1
else
return subjectSpace
end
end
function envFuncs.docpageBase()
-- The base page of the /doc, /sandbox, and /testcases subpages.
-- For some namespaces this is the talk page, rather than the template page.
local templateTitle = env.templateTitle
local docSpace = env.docSpace
local docSpaceText = mw.site.namespaces[docSpace].name
-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
return docSpaceText .. ':' .. templateTitle.text
end
function envFuncs.compareUrl()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
if templateTitle.exists and sandboxTitle.exists then
local compareUrl = mw.uri.canonicalUrl(
'Special:ComparePages',
{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
return tostring(compareUrl)
else
return nil
end
end
return env
end
----------------------------------------------------------------------------
-- Auxiliary templates
----------------------------------------------------------------------------
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')
function p._getModuleWikitext(args, env)
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.contentModel ~= 'Scribunto' then return end
pcall(require, currentTitle.prefixedText) -- if it fails, we don't care
local moduleWikitext = package.loaded["Module:Module wikitext"]
if moduleWikitext then
return moduleWikitext.main()
end
end
function p.sandboxNotice(args, env)
--[=[
-- Generates a sandbox notice for display above sandbox pages.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --> 'sandbox page'
-- 'sandbox-notice-compare-link-display' --> 'diff'
-- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
-- 'module-sandbox-category' --> 'Module sandboxes'
-- 'other-sandbox-category' --> 'Sandboxes outside of template or module namespace'
--]=]
local title = env.title
local sandboxTitle = env.sandboxTitle
local templateTitle = env.templateTitle
local subjectSpace = env.subjectSpace
if not (subjectSpace and title and sandboxTitle and templateTitle
and mw.title.equals(title, sandboxTitle)) then
return nil
end
-- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local pagetype, sandboxCat
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
sandboxCat = message('sandbox-category')
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
sandboxCat = message('module-sandbox-category')
else
pagetype = message('sandbox-notice-pagetype-other')
sandboxCat = message('other-sandbox-category')
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local compareUrl = env.compareUrl
if compareUrl then
local compareDisplay = message('sandbox-notice-compare-link-display')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
else
text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
end
-- Get the test cases page blurb if the page exists. This is something like
-- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
local testcasesTitle = env.testcasesTitle
if testcasesTitle and testcasesTitle.exists then
if testcasesTitle.contentModel == "Scribunto" then
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
else
local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
end
end
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(sandboxCat)
-- 'documentation-clear'
return '<div class="' .. message('clear') .. '"></div>'
.. require('Module:Message box').main('ombox', omargs)
end
function p.protectionTemplate(env)
-- Generates the padlock icon in the top right.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'protection-template' --> 'pp-template'
-- 'protection-template-args' --> {docusage = 'yes'}
local protectionLevels = env.protectionLevels
if not protectionLevels then
return nil
end
local editProt = protectionLevels.edit and protectionLevels.edit[1]
local moveProt = protectionLevels.move and protectionLevels.move[1]
if editProt then
-- The page is edit-protected.
return require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
-- The page is move-protected but not edit-protected. Exclude move
-- protection with the level "autoconfirmed", as this is equivalent to
-- no move protection at all.
return require('Module:Protection banner')._main{
action = 'move', small = true
}
else
return nil
end
end
----------------------------------------------------------------------------
-- Start box
----------------------------------------------------------------------------
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env)
--[[
-- This function generates the start box.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
-- which generate the box HTML.
--]]
env = env or p.getEnvironment(args)
local links
local content = args.content
if not content or args[1] then
-- No need to include the links if the documentation is on the template page itself.
local linksData = p.makeStartBoxLinksData(args, env)
if linksData then
links = p.renderStartBoxLinks(linksData)
end
end
-- Generate the start box html.
local data = p.makeStartBoxData(args, env, links)
if data then
return p.renderStartBox(data)
else
-- User specified no heading.
return nil
end
end
function p.makeStartBoxLinksData(args, env)
--[[
-- Does initial processing of data to make the [view] [edit] [history] [purge] links.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'view-link-display' --> 'view'
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'create-link-display' --> 'create'
--]]
local subjectSpace = env.subjectSpace
local title = env.title
local docTitle = env.docTitle
if not title or not docTitle then
return nil
end
if docTitle.isRedirect then
docTitle = docTitle.redirectTarget
end
-- Create link if /doc doesn't exist.
local preload = args.preload
if not preload then
if subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
else
preload = message('docpage-preload')
end
end
return {
title = title,
docTitle = docTitle,
-- View, display, edit, and purge links if /doc exists.
viewLinkDisplay = message('view-link-display'),
editLinkDisplay = message('edit-link-display'),
historyLinkDisplay = message('history-link-display'),
purgeLinkDisplay = message('purge-link-display'),
preload = preload,
createLinkDisplay = message('create-link-display')
}
end
function p.renderStartBoxLinks(data)
--[[
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
local docTitle = data.docTitle
-- yes, we do intend to purge the template page on which the documentation appears
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return "[" .. viewLink .. "] [" .. editLink .. "] [" .. historyLink .. "] [" .. purgeLink .. "]"
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return "[" .. createLink .. "] [" .. purgeLink .. "]"
end
return ret
end
function p.makeStartBoxData(args, env, links)
--[=[
-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
--
-- Messages:
-- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --> 'Template documentation'
-- 'module-namespace-heading' --> 'Module documentation'
-- 'file-namespace-heading' --> 'Summary'
-- 'other-namespaces-heading' --> 'Documentation'
-- 'testcases-create-link-display' --> 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an "other namespaces" namespace, so that we get at least some output
-- if an error occurs.
subjectSpace = 2
end
local data = {}
-- Heading
local heading = args.heading -- Blank values are not removed.
if heading == '' then
-- Don't display the start box if the heading arg is defined but blank.
return nil
end
if heading then
data.heading = heading
elseif subjectSpace == 10 then -- Template namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
elseif subjectSpace == 828 then -- Module namespace
data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
elseif subjectSpace == 6 then -- File namespace
data.heading = message('file-namespace-heading')
else
data.heading = message('other-namespaces-heading')
end
-- Heading CSS
local headingStyle = args['heading-style']
if headingStyle then
data.headingStyleText = headingStyle
else
-- 'documentation-heading'
data.headingClass = message('main-div-heading-class')
end
-- Data for the [view][edit][history][purge] or [create] links.
if links then
-- 'mw-editsection-like plainlinks'
data.linksClass = message('start-box-link-classes')
data.links = links
end
return data
end
function p.renderStartBox(data)
-- Renders the start box html.
-- @data - a table of data generated by p.makeStartBoxData.
local sbox = mw.html.create('div')
sbox
-- 'documentation-startbox'
:addClass(message('start-box-class'))
:newline()
:tag('span')
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:wikitext(data.heading)
local links = data.links
if links then
sbox:tag('span')
:addClass(data.linksClass)
:attr('id', data.linksId)
:wikitext(links)
end
return tostring(sbox)
end
----------------------------------------------------------------------------
-- Documentation content
----------------------------------------------------------------------------
p.content = makeInvokeFunc('_content')
function p._content(args, env)
-- Displays the documentation contents
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
local content = args.content
if not content and docTitle and docTitle.exists then
content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
end
-- The line breaks below are necessary so that "=== Headings ===" at the start and end
-- of docs are interpreted correctly.
return '\n' .. (content or '') .. '\n'
end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env)
env = env or p.getEnvironment(args)
local docTitle = env.docTitle
if not args.content and docTitle and docTitle.exists then
return docTitle.prefixedText
else
return ''
end
end
----------------------------------------------------------------------------
-- End box
----------------------------------------------------------------------------
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
--]=]
-- Get environment data.
env = env or p.getEnvironment(args)
local subjectSpace = env.subjectSpace
local docTitle = env.docTitle
if not subjectSpace or not docTitle then
return nil
end
-- Check whether we should output the end box at all. Add the end
-- box by default if the documentation exists or if we are in the
-- user, module or template namespaces.
local linkBox = args['link box']
if linkBox == 'off'
or not (
docTitle.exists
or subjectSpace == 2
or subjectSpace == 828
or subjectSpace == 10
)
then
return nil
end
-- Assemble the link box.
local text = ''
if linkBox then
text = text .. linkBox
else
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. (p.makeExperimentBlurb(args, env) or '') .. '<br />'
if not args.content and not args[1] then
-- "Please add categories to the /doc subpage."
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
end
end
local box = mw.html.create('div')
-- 'documentation-metadata'
box:attr('role', 'note')
:addClass(message('end-box-class'))
-- 'plainlinks'
:addClass(message('end-box-plainlinks'))
:wikitext(text)
:done()
return '\n' .. tostring(box)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --> 'edit'
-- 'history-link-display' --> 'history'
-- 'transcluded-from-blurb' -->
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Help:Transclusion|transcluded]] from $1.'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --> 'create'
-- 'create-module-doc-blurb' -->
-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
--]=]
local docTitle = env.docTitle
if not docTitle then
return nil
end
if docTitle.exists then
-- /doc exists; link to it.
local docLink = makeWikilink(docTitle.prefixedText)
local editDisplay = message('edit-link-display')
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, editDisplay)
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
return message('transcluded-from-blurb', {docLink})
.. ' '
.. makeToolbar(editLink, historyLink)
.. '<br />'
elseif env.subjectSpace == 828 then
-- /doc does not exist; ask to create it.
local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
return message('create-module-doc-blurb', {createLink})
.. '<br />'
end
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --> 'sandbox'
-- 'sandbox-edit-link-display' --> 'edit'
-- 'compare-link-display' --> 'diff'
-- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --> 'create'
-- 'mirror-edit-summary' --> 'Create sandbox version of $1'
-- 'mirror-link-display' --> 'mirror'
-- 'mirror-link-preload' --> 'Template:Documentation/mirror'
-- 'sandbox-link-display' --> 'sandbox'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display'--> 'edit'
-- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --> 'create'
-- 'testcases-link-display' --> 'testcases'
-- 'testcases-edit-link-display' --> 'edit'
-- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local testcasesTitle = env.testcasesTitle
local templatePage = templateTitle.prefixedText
if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
return nil
end
-- Make links.
local sandboxLinks, testcasesLinks
if sandboxTitle.exists then
local sandboxPage = sandboxTitle.prefixedText
local sandboxDisplay = message('sandbox-link-display')
local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
local sandboxEditDisplay = message('sandbox-edit-link-display')
local sandboxEditLink = makeWikilink("Special:EditPage/" .. sandboxPage, sandboxEditDisplay)
local compareUrl = env.compareUrl
local compareLink
if compareUrl then
local compareDisplay = message('compare-link-display')
compareLink = makeUrlLink(compareUrl, compareDisplay)
end
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
local sandboxPreload
if subjectSpace == 828 then
sandboxPreload = message('module-sandbox-preload')
else
sandboxPreload = message('template-sandbox-preload')
end
local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}
local sandboxCreateDisplay = message('sandbox-create-link-display')
local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
local mirrorPreload = message('mirror-link-preload')
local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
if subjectSpace == 828 then
mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
end
local mirrorDisplay = message('mirror-link-display')
local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
end
if testcasesTitle.exists then
local testcasesPage = testcasesTitle.prefixedText
local testcasesDisplay = message('testcases-link-display')
local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}
local testcasesEditDisplay = message('testcases-edit-link-display')
local testcasesEditLink = makeWikilink("Special:EditPage/" .. testcasesPage, testcasesEditDisplay)
-- for Modules, add testcases run link if exists
if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
local testcasesRunLinkDisplay = message('testcases-run-link-display')
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
else
testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
end
else
local testcasesPreload
if subjectSpace == 828 then
testcasesPreload = message('module-testcases-preload')
else
testcasesPreload = message('template-testcases-preload')
end
local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}
local testcasesCreateDisplay = message('testcases-create-link-display')
local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
end
local messageName
if subjectSpace == 828 then
messageName = 'experiment-blurb-module'
else
messageName = 'experiment-blurb-template'
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
--[[
-- Generates the text "Please add categories to the /doc subpage."
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --> '/doc'
-- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
--]]
local docTitle = env.docTitle
if not docTitle then
return nil
end
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
--[[
-- Generates the "Subpages of this template" link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --> 'template'
-- 'module-pagetype' --> 'module'
-- 'default-pagetype' --> 'page'
-- 'subpages-link-display' --> 'Subpages of this $1'
--]]
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
local subpagesLink = makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
return message('subpages-blurb', {subpagesLink})
end
----------------------------------------------------------------------------
-- Tracking categories
----------------------------------------------------------------------------
function p.addTrackingCategories(env)
--[[
-- Check if {{documentation}} is transcluded on a /doc or /testcases page.
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'display-strange-usage-category' --> true
-- 'doc-subpage' --> 'doc'
-- 'testcases-subpage' --> 'testcases'
-- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
--
-- /testcases pages in the module namespace are not categorised, as they may have
-- {{documentation}} transcluded automatically.
--]]
local title = env.title
local subjectSpace = env.subjectSpace
if not title or not subjectSpace then
return nil
end
local subpage = title.subpageText
if message('display-strange-usage-category', nil, 'boolean')
and (
subpage == message('doc-subpage')
or subjectSpace ~= 828 and subpage == message('testcases-subpage')
)
then
return makeCategoryLink(message('strange-usage-category'))
end
return ''
end
return p
d6c1bffca24be2d81fa882315ac613f5bb6b227c
Module:Documentation/config
828
30
58
2024-03-26T10:05:41Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Documentation/config]]
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category'] - A category to add to all template sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all module sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all sandboxe not in templates or modules.
cfg['sandbox-category'] = 'Template sandboxes'
cfg['module-sandbox-category'] = 'Module sandboxes'
cfg['other-sandbox-category'] = 'Sandboxes outside of template or module namespace'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
56b6127664e31128dea1cecf2e392cf9313df6a3
59
58
2024-06-03T23:42:37Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
----------------------------------------------------------------------------------------------------
--
-- Configuration for Module:Documentation
--
-- Here you can set the values of the parameters and messages used in Module:Documentation to
-- localise it to your wiki and your language. Unless specified otherwise, values given here
-- should be string values.
----------------------------------------------------------------------------------------------------
local cfg = {} -- Do not edit this line.
----------------------------------------------------------------------------------------------------
-- Protection template configuration
----------------------------------------------------------------------------------------------------
-- cfg['protection-reason-edit']
-- The protection reason for edit-protected templates to pass to
-- [[Module:Protection banner]].
cfg['protection-reason-edit'] = 'template'
--[[
----------------------------------------------------------------------------------------------------
-- Sandbox notice configuration
--
-- On sandbox pages the module can display a template notifying users that the current page is a
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
-- messages that the notices contains.
----------------------------------------------------------------------------------------------------
--]]
-- cfg['sandbox-notice-image']
-- The image displayed in the sandbox notice.
cfg['sandbox-notice-image'] = '[[File:Sandbox.svg|50px|alt=|link=]]'
--[[
-- cfg['sandbox-notice-pagetype-template']
-- cfg['sandbox-notice-pagetype-module']
-- cfg['sandbox-notice-pagetype-other']
-- The page type of the sandbox page. The message that is displayed depends on the current subject
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
-- cfg['sandbox-notice-diff-blurb'].
--]]
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
--[[
-- cfg['sandbox-notice-blurb']
-- cfg['sandbox-notice-diff-blurb']
-- cfg['sandbox-notice-diff-display']
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
-- type, which is either cfg['sandbox-notice-pagetype-template'],
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
-- the sandbox and the main template. The display value of the diff link is set by
-- cfg['sandbox-notice-compare-link-display'].
--]]
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
cfg['sandbox-notice-compare-link-display'] = 'diff'
--[[
-- cfg['sandbox-notice-testcases-blurb']
-- cfg['sandbox-notice-testcases-link-display']
-- cfg['sandbox-notice-testcases-run-blurb']
-- cfg['sandbox-notice-testcases-run-link-display']
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
-- cases page, and $2 is a link to the page to run it.
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
-- cases.
--]]
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
cfg['sandbox-notice-testcases-link-display'] = 'test cases'
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
cfg['sandbox-notice-testcases-run-link-display'] = 'run'
-- cfg['sandbox-category'] - A category to add to all template sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all module sandboxes.
-- cfg['module-sandbox-category'] - A category to add to all sandboxe not in templates or modules.
cfg['sandbox-category'] = 'Template sandboxes'
cfg['module-sandbox-category'] = 'Module sandboxes'
cfg['other-sandbox-category'] = 'Sandboxes outside of template or module namespace'
----------------------------------------------------------------------------------------------------
-- Start box configuration
----------------------------------------------------------------------------------------------------
-- cfg['documentation-icon-wikitext']
-- The wikitext for the icon shown at the top of the template.
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- cfg['template-namespace-heading']
-- The heading shown in the template namespace.
cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading']
-- The heading shown in the module namespace.
cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading']
-- The heading shown in the file namespace.
cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading']
-- The heading shown in other namespaces.
cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display']
-- The text to display for "view" links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for "edit" links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for "history" links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for "purge" links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for "create" links.
cfg['create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Link box (end box) configuration
----------------------------------------------------------------------------------------------------
-- cfg['transcluded-from-blurb']
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'
--[[
-- cfg['create-module-doc-blurb']
-- Notice displayed in the module namespace when the documentation subpage does not exist.
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
-- display cfg['create-link-display'].
--]]
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
----------------------------------------------------------------------------------------------------
-- Experiment blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['experiment-blurb-template']
-- cfg['experiment-blurb-module']
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
-- It is only shown in the template and module namespaces. With the default English settings, it
-- might look like this:
--
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
--
-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
--
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
-- on what namespace we are in.
--
-- Parameters:
--
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
--
-- If the sandbox doesn't exist, it is in the format:
--
-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
--
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
-- loads a default edit summary of cfg['mirror-edit-summary'].
--
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
--
-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
--
-- If the test cases page doesn't exist, it is in the format:
--
-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
--
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
-- namespace.
--]]
cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
----------------------------------------------------------------------------------------------------
-- Sandbox link configuration
----------------------------------------------------------------------------------------------------
-- cfg['sandbox-subpage']
-- The name of the template subpage typically used for sandboxes.
cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload']
-- Preload file for template sandbox pages.
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload']
-- Preload file for Lua module sandbox pages.
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display']
-- The text to display for "sandbox" links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox "edit" links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox "create" links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for "compare" links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
-- template page.
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display']
-- The text to display for "mirror" links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the "mirror" link.
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
----------------------------------------------------------------------------------------------------
-- Test cases link configuration
----------------------------------------------------------------------------------------------------
-- cfg['testcases-subpage']
-- The name of the template subpage typically used for test cases.
cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload']
-- Preload file for template test cases pages.
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload']
-- Preload file for Lua module test cases pages.
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display']
-- The text to display for "testcases" links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases "edit" links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases "run" links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases "create" links.
cfg['testcases-create-link-display'] = 'create'
----------------------------------------------------------------------------------------------------
-- Add categories blurb configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['add-categories-blurb']
-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
-- link to the /doc subpage with a display value of cfg['doc-link-display'].
--]]
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'
-- cfg['doc-link-display']
-- The text to display when linking to the /doc subpage.
cfg['doc-link-display'] = '/doc'
----------------------------------------------------------------------------------------------------
-- Subpages link configuration
----------------------------------------------------------------------------------------------------
--[[
-- cfg['subpages-blurb']
-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
-- the link followed by a period, and the link display provides the actual text.
--]]
cfg['subpages-blurb'] = '$1.'
--[[
-- cfg['subpages-link-display']
-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
-- the template namespace, the module namespace, or another namespace.
--]]
cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype']
-- The pagetype to display for template pages.
cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype']
-- The pagetype to display for Lua module pages.
cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype']
-- The pagetype to display for pages other than templates or Lua modules.
cfg['default-pagetype'] = 'page'
----------------------------------------------------------------------------------------------------
-- Doc link configuration
----------------------------------------------------------------------------------------------------
-- cfg['doc-subpage']
-- The name of the subpage typically used for documentation pages.
cfg['doc-subpage'] = 'doc'
-- cfg['docpage-preload']
-- Preload file for template documentation pages in all namespaces.
cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload']
-- Preload file for Lua module documentation pages.
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
----------------------------------------------------------------------------------------------------
-- HTML and CSS configuration
----------------------------------------------------------------------------------------------------
-- cfg['templatestyles']
-- The name of the TemplateStyles page where CSS is kept.
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.
cfg['templatestyles'] = 'Module:Documentation/styles.css'
-- cfg['container']
-- Class which can be used to set flex or grid CSS on the
-- two child divs documentation and documentation-metadata
cfg['container'] = 'documentation-container'
-- cfg['main-div-classes']
-- Classes added to the main HTML "div" tag.
cfg['main-div-classes'] = 'documentation'
-- cfg['main-div-heading-class']
-- Class for the main heading for templates and modules and assoc. talk spaces
cfg['main-div-heading-class'] = 'documentation-heading'
-- cfg['start-box-class']
-- Class for the start box
cfg['start-box-class'] = 'documentation-startbox'
-- cfg['start-box-link-classes']
-- Classes used for the [view][edit][history] or [create] links in the start box.
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'
-- cfg['end-box-class']
-- Class for the end box.
cfg['end-box-class'] = 'documentation-metadata'
-- cfg['end-box-plainlinks']
-- Plainlinks
cfg['end-box-plainlinks'] = 'plainlinks'
-- cfg['toolbar-class']
-- Class added for toolbar links.
cfg['toolbar-class'] = 'documentation-toolbar'
-- cfg['clear']
-- Just used to clear things.
cfg['clear'] = 'documentation-clear'
----------------------------------------------------------------------------------------------------
-- Tracking category configuration
----------------------------------------------------------------------------------------------------
-- cfg['display-strange-usage-category']
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
-- or a /testcases subpage. This should be a boolean value (either true or false).
cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category']
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
-- /doc subpage or a /testcases subpage.
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
----------------------------------------------------------------------------------------------------
-- End configuration
--
-- Don't edit anything below this line.
----------------------------------------------------------------------------------------------------
--]]
return cfg
56b6127664e31128dea1cecf2e392cf9313df6a3
Module:Documentation/styles.css
828
31
60
2024-03-26T10:05:41Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Documentation/styles.css]]
text
text/plain
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
html.skin-theme-clientpref-night .documentation,
html.skin-theme-clientpref-night .documentation-metadata {
background-color: inherit;
}
@media (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .documentation,
html.skin-theme-clientpref-os .documentation-metadata {
background-color: inherit;
}
}
a086e12b14e61c1254b77cddf71625c15359e806
61
60
2024-06-03T23:42:38Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp|small=yes}} */
.documentation,
.documentation-metadata {
border: 1px solid #a2a9b1;
background-color: #ecfcf4;
clear: both;
}
.documentation {
margin: 1em 0 0 0;
padding: 1em;
}
.documentation-metadata {
margin: 0.2em 0; /* same margin left-right as .documentation */
font-style: italic;
padding: 0.4em 1em; /* same padding left-right as .documentation */
}
.documentation-startbox {
padding-bottom: 3px;
border-bottom: 1px solid #aaa;
margin-bottom: 1ex;
}
.documentation-heading {
font-weight: bold;
font-size: 125%;
}
.documentation-clear { /* Don't want things to stick out where they shouldn't. */
clear: both;
}
.documentation-toolbar {
font-style: normal;
font-size: 85%;
}
html.skin-theme-clientpref-night .documentation,
html.skin-theme-clientpref-night .documentation-metadata {
background-color: inherit;
}
@media (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .documentation,
html.skin-theme-clientpref-os .documentation-metadata {
background-color: inherit;
}
}
a086e12b14e61c1254b77cddf71625c15359e806
Template:Documentation subpage
10
44
86
2024-03-26T10:05:42Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:Documentation_subpage]]
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Template:High-use
10
187
372
2024-03-26T10:05:43Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:High-use]]
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Template:TemplateData header
10
77
152
2024-03-26T10:05:44Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:TemplateData_header]]
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|{{{1|{{BASEPAGENAME}}}}}|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|{{{1|{{BASEPAGENAME}}}}}|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
748b89c815a11e78b365c5617460ea569f3f96cb
Template:Template parameter usage
10
79
156
2024-03-26T10:05:44Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:Template_parameter_usage]]
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|S|s}}ee a monthly parameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
83e574f5e031df639a2cdcef5b91d6b1094ae648
Module:High-use
828
191
380
2024-03-26T10:05:44Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:High-use]]
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return "a very large number of"
else
return "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
if frame.args[1] == "risk" then
return "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then
return "risk"
end
end
return ""
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise and not mw.title.getCurrentTitle().isRedirect then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
e22649bbbdf0185575aade09174113873db5066a
Module:Transclusion count
828
195
388
2024-03-26T10:05:45Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Transclusion_count]]
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Module:Transclusion count/data/I
828
273
544
2024-03-26T10:05:47Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Transclusion_count/data/I]]
Scribunto
text/plain
return {
["IAST"] = 6700,
["IBDB_name"] = 9200,
["ICD10"] = 4900,
["ICD9"] = 4400,
["ICS"] = 3000,
["IDN"] = 3500,
["IMDb_episode"] = 10000,
["IMDb_episodes"] = 2900,
["IMDb_name"] = 157000,
["IMDb_title"] = 194000,
["IMO_Number"] = 4200,
["IMSLP"] = 8400,
["INA"] = 2200,
["IND"] = 7800,
["INR"] = 6800,
["INRConvert"] = 5900,
["INRConvert/CurrentRate"] = 5800,
["INRConvert/USD"] = 5800,
["INRConvert/out"] = 5800,
["IOBDB_name"] = 2000,
["IP"] = 2700,
["IPA"] = 145000,
["IPA-de"] = 8300,
["IPA-es"] = 7900,
["IPA-fr"] = 44000,
["IPA-it"] = 5900,
["IPA-nl"] = 3900,
["IPA-pl"] = 4100,
["IPA-pt"] = 3300,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 3500,
["IPA_link"] = 3900,
["IPAc-cmn"] = 2400,
["IPAc-en"] = 49000,
["IPAc-pl"] = 51000,
["IPC_athlete"] = 3300,
["IPSummary"] = 78000,
["IP_summary"] = 79000,
["IPtalk"] = 18000,
["IPuser"] = 7100,
["IPvandal"] = 2900,
["IRC"] = 7200,
["IRI"] = 2300,
["IRL"] = 5500,
["IRN"] = 3700,
["ISBN"] = 464000,
["ISBN?"] = 2200,
["ISBNT"] = 40000,
["ISBN_missing"] = 2700,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2200,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2800,
["ISO_3166_code"] = 504000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8400,
["ISP"] = 4700,
["ISR"] = 4900,
["ISSN"] = 12000,
["ISSN_link"] = 31000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 18000,
["ITF"] = 6400,
["ITF_profile"] = 9100,
["ITIS"] = 4800,
["ITN_talk"] = 11000,
["ITN_talk/date"] = 11000,
["IUCN_banner"] = 15000,
["I_sup"] = 4300,
["Ice_hockey"] = 5400,
["Ice_hockey_stats"] = 19000,
["Icehockeystats"] = 12000,
["Icon"] = 588000,
["If"] = 283000,
["If_all"] = 6600,
["If_between"] = 3800,
["If_both"] = 133000,
["If_empty"] = 3750000,
["If_first_display_both"] = 73000,
["If_in_page"] = 12000,
["If_last_display_both"] = 31000,
["If_preview"] = 59000,
["If_then_show"] = 313000,
["Ifempty"] = 4000,
["Ifeq"] = 17000,
["Iferror_then_show"] = 3300,
["Ifexist_not_redirect"] = 1350000,
["Ifnotempty"] = 15000,
["Ifnumber"] = 39000,
["Ifsubst"] = 470000,
["Ih"] = 7600,
["Ill"] = 132000,
["Illm"] = 6400,
["Image_frame"] = 5200,
["Image_label"] = 4500,
["Image_label_begin"] = 3900,
["Image_label_end"] = 3800,
["Image_label_small"] = 2600,
["Image_needed"] = 4900,
["Image_other"] = 271000,
["Image_requested"] = 170000,
["Image_requested/Category_helper"] = 161000,
["Imbox"] = 925000,
["Imdb_name"] = 5300,
["Imdb_title"] = 3300,
["Import_style"] = 12000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 15000,
["Importance/colour"] = 30000,
["Importance_mask"] = 10600000,
["Improve_categories"] = 7800,
["Improve_documentation"] = 2800,
["In_class"] = 5600,
["In_lang"] = 363000,
["In_progress"] = 3300,
["In_string"] = 81000,
["In_title"] = 20000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 26000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 46000,
["Incumbent_pope"] = 4300,
["Indent"] = 4700,
["IndexFungorum"] = 2200,
["Indian_English"] = 4400,
["Indian_Rupee"] = 11000,
["Indian_railway_code"] = 3200,
["Inflation"] = 22000,
["Inflation-fn"] = 5500,
["Inflation-year"] = 4600,
["Inflation/IN/startyear"] = 5800,
["Inflation/UK"] = 4500,
["Inflation/UK/dataset"] = 4500,
["Inflation/UK/startyear"] = 4500,
["Inflation/US"] = 13000,
["Inflation/US-GDP"] = 2500,
["Inflation/US-GDP/dataset"] = 2500,
["Inflation/US-GDP/startyear"] = 2500,
["Inflation/US/dataset"] = 13000,
["Inflation/US/startyear"] = 13000,
["Inflation/fn"] = 6400,
["Inflation/year"] = 27000,
["Info"] = 7100,
["Infobox"] = 3270000,
["Infobox/Columns"] = 2500,
["Infobox/mobileviewfix.css"] = 148000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5200,
["Infobox_Aircraft_Type"] = 4600,
["Infobox_Athletics_Championships"] = 2800,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2100,
["Infobox_COA_wide"] = 3300,
["Infobox_Canada_electoral_district"] = 2500,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5600,
["Infobox_Chinese"] = 21000,
["Infobox_Chinese/Chinese"] = 2800,
["Infobox_Chinese/Footer"] = 8400,
["Infobox_Chinese/Header"] = 8400,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2600,
["Infobox_Gaelic_games_player"] = 5100,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2900,
["Infobox_Greek_Dimos"] = 2900,
["Infobox_Hindu_temple"] = 2600,
["Infobox_Indian_constituency"] = 5200,
["Infobox_Indian_constituency/defaultdata"] = 5200,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_NASCAR_race_report"] = 2300,
["Infobox_NCAA_team_season"] = 17000,
["Infobox_NFL_biography"] = 29000,
["Infobox_NFL_player"] = 7500,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 73000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4500,
["Infobox_Olympic_event"] = 7400,
["Infobox_Olympic_event/games_text"] = 7400,
["Infobox_Pan_American_Games_event"] = 2300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2000,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4500,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 19000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3800,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 8100,
["Infobox_UK_place/NoPostCode"] = 3300,
["Infobox_UK_place/area"] = 2600,
["Infobox_UK_place/dens"] = 2200,
["Infobox_UK_place/dist"] = 2800,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3900,
["Infobox_US_Supreme_Court_case/courts"] = 3900,
["Infobox_Wikipedia_user"] = 10000,
["Infobox_YouTube_personality"] = 2900,
["Infobox_YouTube_personality/styles.css"] = 2900,
["Infobox_academic"] = 15000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2400,
["Infobox_aircraft_type"] = 13000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 163000,
["Infobox_album/color"] = 195000,
["Infobox_album/link"] = 163000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5600,
["Infobox_animanga/Footer"] = 7000,
["Infobox_animanga/Header"] = 7000,
["Infobox_animanga/Print"] = 5700,
["Infobox_animanga/Video"] = 4800,
["Infobox_architect"] = 3800,
["Infobox_artist"] = 29000,
["Infobox_artist_discography"] = 6000,
["Infobox_artwork"] = 12000,
["Infobox_athlete"] = 2800,
["Infobox_automobile"] = 8500,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_baseball_team_season"] = 3300,
["Infobox_baseball_team_season/leagueseason"] = 3300,
["Infobox_baseball_team_season/season"] = 3300,
["Infobox_baseball_team_season/styles.css"] = 3300,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3100,
["Infobox_basketball_club/styles.css"] = 3100,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4500,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 53000,
["Infobox_boxer"] = 5800,
["Infobox_bridge"] = 6100,
["Infobox_building"] = 28000,
["Infobox_character"] = 7600,
["Infobox_chess_biography"] = 4100,
["Infobox_chess_player"] = 3400,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2500,
["Infobox_civilian_attack"] = 5900,
["Infobox_college_coach"] = 12000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_football_player"] = 2400,
["Infobox_college_sports_team_season"] = 41000,
["Infobox_college_sports_team_season/link"] = 41000,
["Infobox_college_sports_team_season/name"] = 41000,
["Infobox_college_sports_team_season/succession"] = 41000,
["Infobox_college_sports_team_season/team"] = 41000,
["Infobox_comic_book_title"] = 3100,
["Infobox_comics_character"] = 3600,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 84000,
["Infobox_computing_device"] = 2400,
["Infobox_concert"] = 3400,
["Infobox_constituency"] = 5700,
["Infobox_country"] = 6600,
["Infobox_country/formernext"] = 6200,
["Infobox_country/imagetable"] = 5400,
["Infobox_country/multirow"] = 8500,
["Infobox_country/status_text"] = 2800,
["Infobox_country/styles.css"] = 6600,
["Infobox_country_at_games"] = 16000,
["Infobox_country_at_games/core"] = 16000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4800,
["Infobox_court_case/images"] = 2600,
["Infobox_cricket_tournament"] = 2400,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7600,
["Infobox_criminal"] = 6600,
["Infobox_curler"] = 2700,
["Infobox_cycling_race_report"] = 4600,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5700,
["Infobox_deity"] = 2100,
["Infobox_deity/color"] = 2000,
["Infobox_designation_list"] = 20000,
["Infobox_designation_list/entry"] = 18000,
["Infobox_dim"] = 7000,
["Infobox_dim/core"] = 7000,
["Infobox_diocese"] = 3900,
["Infobox_drug"] = 10000,
["Infobox_drug/chemical_formula"] = 10000,
["Infobox_drug/data_page_link"] = 10000,
["Infobox_drug/formatATC"] = 10000,
["Infobox_drug/formatCASnumber"] = 10000,
["Infobox_drug/formatChEBI"] = 10000,
["Infobox_drug/formatChEMBL"] = 10000,
["Infobox_drug/formatChemDBNIAID"] = 10000,
["Infobox_drug/formatChemSpider"] = 10000,
["Infobox_drug/formatCompTox"] = 10000,
["Infobox_drug/formatDrugBank"] = 10000,
["Infobox_drug/formatIUPHARBPS"] = 10000,
["Infobox_drug/formatJmol"] = 10000,
["Infobox_drug/formatKEGG"] = 10000,
["Infobox_drug/formatPDBligand"] = 9600,
["Infobox_drug/formatPubChemCID"] = 10000,
["Infobox_drug/formatPubChemSID"] = 10000,
["Infobox_drug/formatUNII"] = 10000,
["Infobox_drug/legal_status"] = 11000,
["Infobox_drug/licence"] = 10000,
["Infobox_drug/maintenance_categories"] = 10000,
["Infobox_drug/non-ref-space"] = 4600,
["Infobox_drug/pregnancy_category"] = 10000,
["Infobox_drug/title"] = 10000,
["Infobox_election"] = 31000,
["Infobox_election/row"] = 31000,
["Infobox_election/shortname"] = 29000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7400,
["Infobox_event"] = 5800,
["Infobox_family"] = 2200,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 160000,
["Infobox_film/short_description"] = 156000,
["Infobox_film_awards"] = 2700,
["Infobox_film_awards/link"] = 2700,
["Infobox_film_awards/style"] = 2700,
["Infobox_food"] = 7000,
["Infobox_football_biography"] = 209000,
["Infobox_football_club"] = 28000,
["Infobox_football_club_season"] = 21000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 20000,
["Infobox_football_match"] = 6000,
["Infobox_football_tournament_season"] = 8200,
["Infobox_former_subdivision"] = 3500,
["Infobox_former_subdivision/styles.css"] = 3500,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2600,
["Infobox_game_score"] = 3600,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4100,
["Infobox_golfer"] = 4500,
["Infobox_golfer/highest_ranking"] = 4500,
["Infobox_government_agency"] = 11000,
["Infobox_government_cabinet"] = 2800,
["Infobox_gridiron_football_person"] = 2300,
["Infobox_gridiron_football_person/position"] = 5600,
["Infobox_gymnast"] = 3600,
["Infobox_handball_biography"] = 5000,
["Infobox_historic_site"] = 12000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6400,
["Infobox_hospital/care_system"] = 6400,
["Infobox_hospital/lists"] = 6400,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3100,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5900,
["Infobox_islands"] = 9000,
["Infobox_islands/area"] = 9400,
["Infobox_islands/density"] = 9400,
["Infobox_islands/length"] = 9000,
["Infobox_islands/styles.css"] = 9000,
["Infobox_journal"] = 9800,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9500,
["Infobox_journal/Former_check"] = 9500,
["Infobox_journal/ISO_4_check"] = 9500,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9600,
["Infobox_journal/MathSciNet_check"] = 9500,
["Infobox_journal/NLM_check"] = 9500,
["Infobox_journal/frequency"] = 8700,
["Infobox_lake"] = 4200,
["Infobox_language"] = 9600,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6600,
["Infobox_language/linguistlist"] = 9600,
["Infobox_language/ref"] = 7100,
["Infobox_law_enforcement_agency"] = 2000,
["Infobox_legislation"] = 2100,
["Infobox_legislature"] = 3800,
["Infobox_library"] = 2200,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 5000,
["Infobox_magazine"] = 7700,
["Infobox_manner_of_address"] = 3400,
["Infobox_mapframe"] = 83000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 427000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8100,
["Infobox_medical_details"] = 2100,
["Infobox_medical_person"] = 2000,
["Infobox_military_conflict"] = 23000,
["Infobox_military_installation"] = 9900,
["Infobox_military_person"] = 46000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2200,
["Infobox_model"] = 2300,
["Infobox_monument"] = 2100,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2400,
["Infobox_museum"] = 11000,
["Infobox_musical_artist"] = 123000,
["Infobox_musical_artist/color"] = 123000,
["Infobox_musical_artist/hCard_class"] = 320000,
["Infobox_musical_composition"] = 3000,
["Infobox_name"] = 7600,
["Infobox_name_module"] = 7400,
["Infobox_newspaper"] = 9900,
["Infobox_nobility"] = 2300,
["Infobox_noble"] = 7400,
["Infobox_officeholder"] = 229000,
["Infobox_officeholder/office"] = 235000,
["Infobox_official_post"] = 8300,
["Infobox_organization"] = 37000,
["Infobox_pageant_titleholder"] = 3000,
["Infobox_park"] = 7800,
["Infobox_person"] = 493000,
["Infobox_person/Wikidata"] = 4600,
["Infobox_person/height"] = 105000,
["Infobox_person/length"] = 7100,
["Infobox_person/weight"] = 68000,
["Infobox_philosopher"] = 3500,
["Infobox_planet"] = 4700,
["Infobox_play"] = 4200,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3100,
["Infobox_prepared_food"] = 2900,
["Infobox_professional_wrestler"] = 4400,
["Infobox_professional_wrestling_event"] = 2800,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5600,
["Infobox_racing_driver"] = 4300,
["Infobox_racing_driver_series_section"] = 2400,
["Infobox_radio_show"] = 2100,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 3000,
["Infobox_rail_line"] = 7400,
["Infobox_rail_service"] = 3000,
["Infobox_rail_service/doc"] = 3000,
["Infobox_reality_competition_season"] = 3700,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6600,
["Infobox_religious_biography"] = 5500,
["Infobox_religious_building"] = 13000,
["Infobox_religious_building/color"] = 18000,
["Infobox_restaurant"] = 3200,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2400,
["Infobox_rockunit"] = 6400,
["Infobox_royalty"] = 22000,
["Infobox_royalty/short_description"] = 12000,
["Infobox_rugby_biography"] = 17000,
["Infobox_rugby_biography/correct_date"] = 17000,
["Infobox_rugby_biography/depcheck"] = 16000,
["Infobox_rugby_league_biography"] = 10000,
["Infobox_rugby_league_biography/PLAYER"] = 9900,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5100,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5700,
["Infobox_school_district/styles.css"] = 5700,
["Infobox_scientist"] = 49000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 565000,
["Infobox_settlement/areadisp"] = 241000,
["Infobox_settlement/columns"] = 96000,
["Infobox_settlement/columns/styles.css"] = 96000,
["Infobox_settlement/densdisp"] = 441000,
["Infobox_settlement/impus"] = 83000,
["Infobox_settlement/lengthdisp"] = 170000,
["Infobox_settlement/link"] = 96000,
["Infobox_settlement/metric"] = 213000,
["Infobox_settlement/pref"] = 296000,
["Infobox_settlement/styles.css"] = 565000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3500,
["Infobox_short_story"] = 2400,
["Infobox_skier"] = 2600,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 77000,
["Infobox_song/color"] = 77000,
["Infobox_song/link"] = 77000,
["Infobox_spaceflight"] = 3600,
["Infobox_spaceflight/styles.css"] = 3600,
["Infobox_sport_event"] = 2200,
["Infobox_sports_competition_event"] = 18000,
["Infobox_sports_competition_event/medalrow"] = 12000,
["Infobox_sports_league"] = 5100,
["Infobox_sports_season"] = 5600,
["Infobox_sports_team"] = 2300,
["Infobox_sportsperson"] = 109000,
["Infobox_stadium"] = 3200,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3600,
["Infobox_swimmer"] = 10000,
["Infobox_television"] = 58000,
["Infobox_television/Short_description"] = 56000,
["Infobox_television_channel"] = 6300,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9800,
["Infobox_television_station"] = 3400,
["Infobox_tennis_biography"] = 11000,
["Infobox_tennis_event"] = 2700,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9500,
["Infobox_tennis_tournament_year/color"] = 29000,
["Infobox_tennis_tournament_year/footer"] = 29000,
["Infobox_tournament_season"] = 11000,
["Infobox_train"] = 2300,
["Infobox_university"] = 26000,
["Infobox_user"] = 2700,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5600,
["Infobox_weapon"] = 7400,
["Infobox_weather_event"] = 2100,
["Infobox_weather_event/Effects"] = 2100,
["Infobox_weather_event/Footer"] = 2100,
["Infobox_weather_event/History"] = 2000,
["Infobox_weather_event/meteorology"] = 2000,
["Infobox_weather_event/styles.css"] = 2100,
["Infobox_website"] = 7700,
["Infobox_writer"] = 40000,
["Information"] = 97000,
["Information/styles.css"] = 97000,
["Inline"] = 2100,
["Inline_block"] = 4800,
["Inprogress"] = 2500,
["Input_link"] = 32000,
["Instagram"] = 12000,
["Interlanguage_link"] = 170000,
["Interlanguage_link_multi"] = 17000,
["Internet_Archive_author"] = 19000,
["Internet_Archive_film"] = 2600,
["Intitle"] = 13000,
["Iptalk"] = 17000,
["IranCensus2006"] = 45000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 45000,
["Irc"] = 2100,
["Irish_place_name"] = 2700,
["IsIPAddress"] = 37000,
["IsValidPageName"] = 2700,
["Is_MLB_league"] = 3200,
["Is_NPB_league"] = 3300,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 6000,
["Is_italic_taxon"] = 510000,
["Is_redirect"] = 28000,
["Isbn"] = 8300,
["Isfdb_name"] = 3400,
["Isfdb_title"] = 4300,
["Isnum"] = 2000,
["Isnumeric"] = 145000,
["Iso2continent"] = 37000,
["Iso2country"] = 24000,
["Iso2country/article"] = 23000,
["Iso2country/data"] = 24000,
["Iso2nationality"] = 207000,
["Issubst"] = 71000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5300,
["Italic_title"] = 271000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3900,
["Italictitle"] = 3800,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 125000,
["Ivory_messagebox"] = 148000,
["Module:I18n/complex_date"] = 68000,
["Module:IP"] = 133000,
["Module:IPA"] = 145000,
["Module:IPA/data"] = 131000,
["Module:IPA/styles.css"] = 117000,
["Module:IPA_symbol"] = 5200,
["Module:IPA_symbol/data"] = 5300,
["Module:IPAc-en"] = 49000,
["Module:IPAc-en/data"] = 49000,
["Module:IPAc-en/phonemes"] = 49000,
["Module:IPAc-en/pronunciation"] = 49000,
["Module:IPAddress"] = 189000,
["Module:ISO_3166"] = 1030000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2600,
["Module:ISO_3166/data/CN"] = 2200,
["Module:ISO_3166/data/DE"] = 15000,
["Module:ISO_3166/data/ES"] = 3700,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 9900,
["Module:ISO_3166/data/National"] = 1030000,
["Module:ISO_3166/data/PL"] = 7500,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 68000,
["Module:Icon"] = 594000,
["Module:Icon/data"] = 594000,
["Module:If_any_equal"] = 2800,
["Module:If_empty"] = 3770000,
["Module:If_in_page"] = 12000,
["Module:If_preview"] = 303000,
["Module:If_preview/configuration"] = 303000,
["Module:If_preview/styles.css"] = 303000,
["Module:Import_style"] = 12000,
["Module:In_lang"] = 363000,
["Module:Indent"] = 4700,
["Module:Infobox"] = 4190000,
["Module:Infobox/dates"] = 70000,
["Module:Infobox/styles.css"] = 4450000,
["Module:Infobox3cols"] = 302000,
["Module:InfoboxImage"] = 4520000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 422000,
["Module:Infobox_military_conflict"] = 23000,
["Module:Infobox_military_conflict/styles.css"] = 23000,
["Module:Infobox_multi-lingual_name"] = 21000,
["Module:Infobox_multi-lingual_name/data"] = 21000,
["Module:Infobox_power_station"] = 3100,
["Module:Infobox_road"] = 26000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 25000,
["Module:Infobox_road/route"] = 26000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 58000,
["Module:Infobox_television_disambiguation_check"] = 65000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 9300,
["Module:Infobox_television_season_name"] = 9800,
["Module:Internet_Archive"] = 19000,
["Module:IrelandByCountyCatNav"] = 3400,
["Module:Is_article"] = 2000,
["Module:Is_infobox_in_lead"] = 380000,
["Module:Is_instance"] = 329000,
["Module:Italic_title"] = 1140000,
["Module:Italic_title2"] = 5300,
}
3da13f86a7ccd60f530629ea56764dbf3fc10efa
Module:Message box/ombox.css
828
313
624
2024-03-26T10:05:47Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Message_box/ombox.css]]
text
text/plain
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Template:Hlist/styles.css
10
312
622
2024-03-26T14:47:25Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Template:Hlist/styles.css]]: Hlist fix
text
text/plain
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
Module:Message box/ambox.css
828
181
360
2024-03-27T15:31:06Z
mh>Rikke
0
1 revision imported from [[:wikipedia:Module:Message_box/ambox.css]]
text
text/plain
/* {{pp|small=y}} */
.ambox {
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
/* Single border between stacked boxes. Take into account base templatestyles,
* user styles, and Template:Dated maintenance category.
* remove link selector when T200206 is fixed
*/
.ambox + link + .ambox,
.ambox + link + style + .ambox,
.ambox + link + link + .ambox,
/* TODO: raise these as "is this really that necessary???". the change was Dec 2021 */
.ambox + .mw-empty-elt + link + .ambox,
.ambox + .mw-empty-elt + link + style + .ambox,
.ambox + .mw-empty-elt + link + link + .ambox {
margin-top: -1px;
}
/* For the "small=left" option. */
/* must override .ambox + .ambox styles above */
html body.mediawiki .ambox.mbox-small-left {
/* @noflip */
margin: 4px 1em 4px 0;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
.ambox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.5em;
width: 100%;
}
.ambox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.5em;
text-align: center;
}
.ambox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.5em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ambox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ambox .mbox-image-div {
width: 52px;
}
/* Hack around MobileFrontend being opinionated */
html.client-js body.skin-minerva .mbox-text-span {
margin-left: 23px !important;
}
@media (min-width: 720px) {
.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
}
}
29898fdc5160b39a8f580c76efe77afa1f6f58a4
Template:Nobold/styles.css
10
119
236
2024-03-28T15:17:20Z
mh>Rikke
0
Rikke changed the content model of the page [[Template:Nobold/styles.css]] from "plain text" to "Sanitized CSS": Template page keeps asking for it
text
text/plain
/* {{pp-template}} */
/* Styling for Template:Nobold */
.nobold {
font-weight: normal;
}
83e5f0adacf8c7984251f1fd9d11ed82ebaadf03
Template:Infobox character/doc
10
315
628
2024-04-21T13:47:09Z
mh>Rikke
0
Fixed typo
wikitext
text/x-wiki
{{Documentation subpage}}
== Usage ==
Users should note that all parameters are made to be optional. Provide as much or as little information as you choose. If you wish to enter more than one data line to a single parameter, use <code><nowiki></br></nowiki></code> between the entries.
<syntaxhighlight>
{{Infobox character
|title = <!-- use only for royal, governmental or honorary titles -->
|name = <!-- if left blank, will default to the title of the page -->
|nickname = <!-- short and/or commonly used name for the character -->
|image =
|image_size = <!-- use this if the image appears too large/small, set a value e.g. 200px -->
|caption =
|governance = <!-- political/hereditary position of power -->
|govern_period = <!-- time spent governing -->
|predecessor = <!-- character previously in the governing position -->
|successor = <!-- character following in the governing position -->
|birth_name =
|birth_date =
|birth_place =
|death_date =
|death_place =
|former_names = <!-- use if the same character has changed names -->
|resting_place = <!-- place of burial/memorial -->
|nationality = <!-- usually country/region of birth -->
|citizenship = <!-- the country the character is formally associated with -->
|education =
|occupation = <!-- use this for regular jobs, for political positions/rulers, use "governance" given above -->
|years_active =
|organization =
|height =
|awards =
|notable_work = <!-- italics to work titles need to be added manually -->
|spouse1 =
|spouse2 =
|spouse3 =
|children =
|parents =
|signature =
|signature_size = <!-- use this if the image appears too large/small, set a value e.g. 100px -->
}}
</syntaxhighlight>
0e63b6f14443f222bfbe29aa2665853bf0df5f13
Template:Archive
10
175
348
2024-05-20T18:16:26Z
mh>Rikke
0
Attempted fix #2
wikitext
text/x-wiki
<includeonly>
{{#if: {{{status|}}}
|{{#invoke:Message box
|ambox
|name=Archive
|type= content
|issue=
This article '''contains information about the previous version of Alathra.''' {{#ifeq: {{{status|}}} | done | <br /> It has been permanently archived and given a protected status to prevent any further edits. | <br /> It will soon be archived and placed into the relevant archival category.}}
}}
}}
{{#ifeq: {{{status|}}} | undone | [[Category:Articles for archiving]] | {{#switch: {{{1}}}
|nation = [[Category:Archived nations]]
|town = [[Category:Archived towns]]
|place = [[Category:Archived places]]
|event = [[Category:Archived events]]
|player = [[Category:Archived players]]
|org = [[Category:Archived organizations]]
|religion = [[Category:Archived religions]]
|lore = [[Category:Archived lore]]
|item = [[Category:Archived artifacts]]
|book = [[Category:Archived books]]}}}}</includeonly>
<noinclude>
{{Documentation}}
</noinclude>
80fcb3c32f385d55d4ad8141a6e62bb6b161362a
Main Page
0
1
1
2024-06-03T21:09:02Z
MediaWiki default
1
Welcome to Miraheze!
wikitext
text/x-wiki
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
=== For the bureaucrat(s) of this wiki ===
Hello, and welcome to your new wiki! Thank you for choosing Miraheze for the hosting of your wiki, we hope you will enjoy our hosting.
You can immediately start working on your wiki or whenever you want.
Need help? No problem! We will help you with your wiki as needed. To start, try checking out these helpful links:
* [[mw:Special:MyLanguage/Help:Contents|MediaWiki guide]] (e.g. navigation, editing, deleting pages, blocking users)
* [[meta:Special:MyLanguage/FAQ|Miraheze FAQ]]
* [[meta:Special:MyLanguage/Request features|Request settings changes on your wiki]]. (Extensions, Skin and Logo/Favicon changes should be done through [[Special:ManageWiki]] on your wiki, see [[meta:Special:MyLanguage/ManageWiki|ManageWiki]] for more information.)
==== I still don't understand X! ====
Well, that's no problem. Even if something isn't explained in the documentation/FAQ, we are still happy to help you. You can find us here:
* [[meta:Special:MyLanguage/Help center|On our own Miraheze wiki]]
* On [[phorge:|Phorge]]
* On [https://miraheze.org/discord Discord]
* On IRC in #miraheze on irc.libera.chat ([irc://irc.libera.chat/%23miraheze direct link]; [https://web.libera.chat/?channel=#miraheze webchat])
=== For visitors of this wiki ===
Hello, the default Main Page of this wiki (this page) has not yet been replaced by the bureaucrat(s) of this wiki. The bureaucrat(s) might still be working on a Main Page, so please check again later!
070d9e6457eab136df99905438a1f57c037772b0
Template:Infobox settlement
10
2
3
2
2024-06-03T23:42:25Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#if:{{#invoke:String|match|{{#invoke:Plain text|main|{{{settlement_type|{{{type|}}}}}}}}|{{#invoke:Plain text|main|{{{subdivision_name|}}}}}|plain=true|ignore_errors=1}}{{#if:{{{subdivision_name1|}}}|{{#invoke:String|match|{{#invoke:Plain text|main|{{{settlement_type|{{{type|}}}}}}}}|{{#invoke:Plain text|main|{{{subdivision_name1|}}}}}|plain=true|ignore_errors=1}}}}|[[Category:Infobox settlement pages with bad settlement type]]}}{{Infobox
| child = {{yesno|{{{embed|}}}}}
| bodyclass = geography vcard
| bodystyle = width:23em
| headerstyle = text-align:left
| abovestyle = font-size:1.25em; white-space:nowrap
| {{#ifeq:{{yesno|{{{embed|}}}}}|yes|title|above}} = {{#ifeq:{{yesno|{{{embed|}}}}}|yes|
|<span class="fn org">{{if empty|{{{name|}}}|{{{official_name|}}}|{{PAGENAMEBASE}}}}</span>
}}{{#if:{{{native_name|}}}|<br /><span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}{{#if:{{{other_name|}}}|<br /><span class="nickname" style="font-size:78%">{{{other_name}}}</span>}}
<!--** names, type, and transliterations ** -->
| subheaderstyle = background-color:#cddeff; font-weight:bold;
| subheader = {{#if:{{both|{{{name|}}}{{{official_name|}}}{{#ifeq:{{yesno|{{{embed|}}}}}|yes|1}}|{{{settlement_type|{{{type|}}}}}}}}|<span class="category">{{{settlement_type|{{{type}}}}}}</span>}}
| rowclass1 = mergedtoprow
| rowcellstyle1 = font-weight:bold;
| data1 = {{#if:{{{name|}}}|{{{official_name|}}}}}
<!-- ***Transliteration language 1*** -->
| rowclass2 = mergedtoprow
| header2 = {{#if:{{{translit_lang1|}}}|{{{translit_lang1}}} transcription(s)}}
| rowclass3 = {{#if:{{{translit_lang1_type1|}}}|mergedrow|mergedbottomrow}}
| label3 = • {{{translit_lang1_type}}}
| data3 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type|}}}|{{{translit_lang1_info|}}}}}}}
| rowclass4 = {{#if:{{{translit_lang1_type2|}}}|mergedrow|mergedbottomrow}}
| label4 = • {{{translit_lang1_type1}}}
| data4 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type1|}}}|{{{translit_lang1_info1|}}}}}}}
| rowclass5 = {{#if:{{{translit_lang1_type3|}}}|mergedrow|mergedbottomrow}}
| label5 = • {{{translit_lang1_type2}}}
| data5 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type2|}}}|{{{translit_lang1_info2|}}}}}}}
| rowclass6 = {{#if:{{{translit_lang1_type4|}}}|mergedrow|mergedbottomrow}}
| label6 = • {{{translit_lang1_type3}}}
| data6 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type3|}}}|{{{translit_lang1_info3|}}}}}}}
| rowclass7 = {{#if:{{{translit_lang1_type5|}}}|mergedrow|mergedbottomrow}}
| label7 = • {{{translit_lang1_type4}}}
| data7 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type4|}}}|{{{translit_lang1_info4|}}}}}}}
| rowclass8 = {{#if:{{{translit_lang1_type6|}}}|mergedrow|mergedbottomrow}}
| label8 = • {{{translit_lang1_type5}}}
| data8 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type5|}}}|{{{translit_lang1_info5|}}}}}}}
| rowclass9 = mergedbottomrow
| label9 = • {{{translit_lang1_type6}}}
| data9 = {{#if:{{{translit_lang1|}}}|{{#if:{{{translit_lang1_type6|}}}|{{{translit_lang1_info6|}}}}}}}
<!-- ***Transliteration language 2*** -->
| rowclass10 = mergedtoprow
| header10 = {{#if:{{{translit_lang2|}}}|{{{translit_lang2}}} transcription(s)}}
| rowclass11 = {{#if:{{{translit_lang2_type1|}}}|mergedrow|mergedbottomrow}}
| label11 = • {{{translit_lang2_type}}}
| data11 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type|}}}|{{{translit_lang2_info|}}}}}}}
| rowclass12 = {{#if:{{{translit_lang2_type2|}}}|mergedrow|mergedbottomrow}}
| label12 = • {{{translit_lang2_type1}}}
| data12 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type1|}}}|{{{translit_lang2_info1|}}}}}}}
| rowclass13 = {{#if:{{{translit_lang2_type3|}}}|mergedrow|mergedbottomrow}}
| label13 = • {{{translit_lang2_type2}}}
| data13 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type2|}}}|{{{translit_lang2_info2|}}}}}}}
| rowclass14 = {{#if:{{{translit_lang2_type4|}}}|mergedrow|mergedbottomrow}}
| label14 = • {{{translit_lang2_type3}}}
| data14 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type3|}}}|{{{translit_lang2_info3|}}}}}}}
| rowclass15 = {{#if:{{{translit_lang2_type5|}}}|mergedrow|mergedbottomrow}}
| label15 = • {{{translit_lang2_type4}}}
| data15 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type4|}}}|{{{translit_lang2_info4|}}}}}}}
| rowclass16 = {{#if:{{{translit_lang2_type6|}}}|mergedrow|mergedbottomrow}}
| label16 = • {{{translit_lang2_type5}}}
| data16 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type5|}}}|{{{translit_lang2_info5|}}}}}}}
| rowclass17 = mergedbottomrow
| label17 = • {{{translit_lang2_type6}}}
| data17 = {{#if:{{{translit_lang2|}}}|{{#if:{{{translit_lang2_type6|}}}|{{{translit_lang2_info6|}}}}}}}
<!-- end ** names, type, and transliterations ** -->
<!-- ***Skyline Image*** -->
| rowclass18 = mergedtoprow
<!--| rowcellstyle18 = padding:0.7em 0.8em-->
| data18 = {{#if:{{{image_skyline|}}}{{{image|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{#if:{{{image_skyline|}}}|{{{image_skyline}}}|{{{image|}}}}}|size={{{image_size|{{{imagesize|}}}}}}|sizedefault=250px|alt={{{image_alt|{{{alt|}}}}}}|title={{{image_caption|{{{caption|Skyline of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}}}}{{#if:{{{image_caption|{{{caption|}}}}}}|<div>{{{image_caption|{{{caption|}}}}}}</div>}} }}
<!-- ***Flag, Seal, Shield and Coat of arms*** -->
| rowclass19 = mergedtoprow
| class19 = maptable
| data19 = {{#if:{{{image_flag|}}}{{{image_seal|}}}{{{image_shield|}}}{{{image_blank_emblem|}}}{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}
|{{Infobox settlement/columns
| 1 = {{#if:{{{image_flag|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_flag}}}|size={{{flag_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|border={{yesno |{{{flag_border|}}}|yes=yes|blank=yes}}|alt={{{flag_alt|}}}|title=Flag of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type=Flag|link={{{flag_link|}}}|name={{{official_name}}}}}</small>}}
| 2 = {{#if:{{{image_seal|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_seal|}}}|size={{{seal_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{seal_alt|}}}|title=Official seal of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type={{#if:{{{seal_type|}}}|{{{seal_type}}}|Seal}}|link={{{seal_link|}}}|name={{{official_name}}}}}</small>}}
| 3 = {{#if:{{{image_shield|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_shield|}}}||size={{{shield_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{shield_alt|}}}|title=Coat of arms of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type=Coat of arms|link={{{shield_link|}}}|name={{{official_name}}}}}</small>}}
| 4 = {{#if:{{{image_blank_emblem|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_blank_emblem|}}}|size={{{blank_emblem_size|}}}|sizedefault={{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}|85px|100px}}|alt={{{blank_emblem_alt|}}}|title=Official logo of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}<br /><small>{{Infobox settlement/link|type={{#if:{{{blank_emblem_type|}}}|{{{blank_emblem_type}}}|Logo}}|link={{{blank_emblem_link|}}}|name={{{official_name}}}}}</small>}}
| 5 = {{#if:{{{image_map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=100px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br />{{{map_caption}}}}} }}
| 0 = {{#if:{{{pushpin_map_narrow|}}}|{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}}}
|float = center
|width = {{#if:{{{pushpin_mapsize|}}}|{{{pushpin_mapsize}}}|150}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
}} }}
<!-- ***Etymology*** -->
| rowclass20 = mergedtoprow
| data20 = {{#if:{{{etymology|}}}|Etymology: {{{etymology}}} }}
<!-- ***Nickname*** -->
| rowclass21 = {{#if:{{{etymology|}}}|mergedrow|mergedtoprow}}
| data21 = {{#if:{{{nickname|}}}|Nickname(s): <span class="nickname">{{{nickname}}}</span>}}
<!-- ***Motto*** -->
| rowclass22 = {{#if:{{{etymology|}}}{{{nickname|}}}|mergedrow|mergedtoprow}}
| data22 = {{#if:{{{motto|}}}|Motto(s): {{{motto}}} }}
<!-- ***Anthem*** -->
| rowclass23 = {{#if:{{{etymology|}}}{{{nickname|}}}{{{motto|}}}|mergedrow|mergedtoprow}}
| data23 = {{#if:{{{anthem|}}}|Anthem: {{{anthem}}} }}
<!-- ***Map*** -->
| rowclass24 = mergedtoprow
| data24 = {{#if:{{both|{{{pushpin_map_narrow|}}}|{{{pushpin_map|}}}}}||{{#if:{{{image_map|}}}
|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map}}}|size={{{mapsize|}}}|sizedefault=250px|alt={{{map_alt|}}}|title={{{map_caption|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption|}}}|<br /><small>{{{map_caption}}}</small>}}
}}}}
| rowclass25 = mergedrow
| data25 = {{#if:{{{image_map1|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{image_map1}}}|size={{{mapsize1|}}}|sizedefault=250px|alt={{{map_alt1|}}}|title={{{map_caption1|Location of {{#if:{{{name|}}}|{{{name}}}|{{{official_name}}}}}}}}}}{{#if:{{{map_caption1|}}}|<br /><small>{{{map_caption1}}}</small>}} }}
<!-- ***Pushpin Map*** -->
| rowclass26 = mergedtoprow
| data26 = {{#if:{{{pushpin_map_narrow|}}}||{{#if:{{both| {{{pushpin_map|}}} | {{{coordinates|}}} }}|
{{location map|{{{pushpin_map|}}}
|border = infobox
|alt = {{{pushpin_map_alt|}}}
|caption ={{#if:{{{pushpin_map_caption_notsmall|}}}|{{{pushpin_map_caption_notsmall|}}}|{{#if:{{{pushpin_map_caption|}}}|<small>{{{pushpin_map_caption}}}</small>|{{#if:{{{map_caption|}}}|<small>{{{map_caption}}}</small>}}}}}}
|float = center
|width = {{{pushpin_mapsize|}}}
|default_width = 250
|relief= {{{pushpin_relief|}}}
|AlternativeMap = {{{pushpin_image|}}}
|overlay_image = {{{pushpin_overlay|}}}
|coordinates = {{{coordinates|}}}
|label = {{#ifeq: {{lc: {{{pushpin_label_position|}}} }} | none | | {{#if:{{{pushpin_label|}}}|{{{pushpin_label}}}|{{#if:{{{name|}}}|{{{name}}}|{{{official_name|}}}}}}} }}
|marksize =6
|outside = {{{pushpin_outside|}}}<!-- pin is outside the map -->
|position = {{{pushpin_label_position|}}}
}}
}} }}
<!-- ***Coordinates*** -->
| rowclass27 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|{{#if:{{{grid_position|}}}|mergedrow|mergedbottomrow}}}}
| data27 = {{#if:{{{coordinates|}}}
|Coordinates{{#if:{{{coor_pinpoint|{{{coor_type|}}}}}}| ({{{coor_pinpoint|{{{coor_type|}}}}}})}}: {{#invoke:Coordinates|coordinsert|{{{coordinates|}}}|type:city{{#if:{{{population_total|}}}|{{#iferror:{{#expr:{{formatnum:{{{population_total}}}|R}}+1}}||({{formatnum:{{{population_total}}}|R}})}}}}|{{#if:{{{subdivision_name|}}}|region:{{Country abbreviation|{{{subdivision_name}}}|{{{subdivision_name1|{{{subdivision_name2|{{{subdivision_name3|}}}}}}}}} }} }} }}{{{coordinates_footnotes|}}} }}
| rowclass28 = {{#if:{{{image_map|}}}{{{image_map1|}}}{{{pushpin_map|}}}|mergedbottomrow|mergedrow}}
| label28 = {{ifempty|{{{grid_name|}}}|Grid position}}
| data28 = {{{grid_position|}}}
<!-- ***Subdivisions*** -->
| rowclass29 = mergedtoprow
| label29 = {{{subdivision_type}}}
| data29 = {{#if:{{{subdivision_type|}}}|{{{subdivision_name|}}} }}
| rowclass30 = mergedrow
| label30 = {{{subdivision_type1}}}
| data30 = {{#if:{{{subdivision_type1|}}}|{{{subdivision_name1|}}} }}
| rowclass31 = mergedrow
| label31 = {{{subdivision_type2}}}
| data31 = {{#if:{{{subdivision_type2|}}}|{{{subdivision_name2|}}} }}
| rowclass32 = mergedrow
| label32 = {{{subdivision_type3}}}
| data32 = {{#if:{{{subdivision_type3|}}}|{{{subdivision_name3|}}} }}
| rowclass33 = mergedrow
| label33 = {{{subdivision_type4}}}
| data33 = {{#if:{{{subdivision_type4|}}}|{{{subdivision_name4|}}} }}
| rowclass34 = mergedrow
| label34 = {{{subdivision_type5}}}
| data34 = {{#if:{{{subdivision_type5|}}}|{{{subdivision_name5|}}} }}
| rowclass35 = mergedrow
| label35 = {{{subdivision_type6}}}
| data35 = {{#if:{{{subdivision_type6|}}}|{{{subdivision_name6|}}} }}
<!--***Established*** -->
| rowclass36 = mergedtoprow
| label36 = {{{established_title}}}
| data36 = {{#if:{{{established_title|}}}|{{{established_date|}}} }}
| rowclass37 = mergedrow
| label37 = {{{established_title1}}}
| data37 = {{#if:{{{established_title1|}}}|{{{established_date1|}}} }}
| rowclass38 = mergedrow
| label38 = {{{established_title2}}}
| data38 = {{#if:{{{established_title2|}}}|{{{established_date2|}}} }}
| rowclass39 = mergedrow
| label39 = {{{established_title3}}}
| data39 = {{#if:{{{established_title3|}}}|{{{established_date3|}}} }}
| rowclass40 = mergedrow
| label40 = {{{established_title4}}}
| data40 = {{#if:{{{established_title4|}}}|{{{established_date4|}}} }}
| rowclass41 = mergedrow
| label41 = {{{established_title5}}}
| data41 = {{#if:{{{established_title5|}}}|{{{established_date5|}}} }}
| rowclass42 = mergedrow
| label42 = {{{established_title6}}}
| data42 = {{#if:{{{established_title6|}}}|{{{established_date6|}}} }}
| rowclass43 = mergedrow
| label43 = {{{established_title7}}}
| data43 = {{#if:{{{established_title7|}}}|{{{established_date7|}}} }}
| rowclass44 = mergedrow
| label44 = {{{extinct_title}}}
| data44 = {{#if:{{{extinct_title|}}}|{{{extinct_date|}}} }}
| rowclass45 = mergedrow
| label45 = Founded by
| data45 = {{{founder|}}}
| rowclass46 = mergedrow
| label46 = [[Namesake|Named for]]
| data46 = {{{named_for|}}}
<!-- ***Seat of government and subdivisions within the settlement*** -->
| rowclass47 = mergedtoprow
| label47 = {{#if:{{{seat_type|}}}|{{{seat_type}}}|Seat}}
| data47 = {{{seat|}}}
| rowclass48 = mergedrow
| label48 = {{#if:{{{seat1_type|}}}|{{{seat1_type}}}|Former seat}}
| data48 = {{{seat1|}}}
| rowclass49 = {{#if:{{{seat|}}}{{{seat1|}}}|mergedrow|mergedtoprow}}
| label49 = {{#if:{{{parts_type|}}}|{{{parts_type}}}|Boroughs}}
| data49 = {{#if:{{{parts|}}}{{{p1|}}}
|{{#ifeq:{{{parts_style|}}}|para
|<b>{{{parts|}}}{{#if:{{both|{{{parts|}}}|{{{p1|}}}}}|: |}}</b>{{comma separated entries|{{{p1|}}}|{{{p2|}}}|{{{p3|}}}|{{{p4|}}}|{{{p5|}}}|{{{p6|}}}|{{{p7|}}}|{{{p8|}}}|{{{p9|}}}|{{{p10|}}}|{{{p11|}}}|{{{p12|}}}|{{{p13|}}}|{{{p14|}}}|{{{p15|}}}|{{{p16|}}}|{{{p17|}}}|{{{p18|}}}|{{{p19|}}}|{{{p20|}}}|{{{p21|}}}|{{{p22|}}}|{{{p23|}}}|{{{p24|}}}|{{{p25|}}}|{{{p26|}}}|{{{p27|}}}|{{{p28|}}}|{{{p29|}}}|{{{p30|}}}|{{{p31|}}}|{{{p32|}}}|{{{p33|}}}|{{{p34|}}}|{{{p35|}}}|{{{p36|}}}|{{{p37|}}}|{{{p38|}}}|{{{p39|}}}|{{{p40|}}}|{{{p41|}}}|{{{p42|}}}|{{{p43|}}}|{{{p44|}}}|{{{p45|}}}|{{{p46|}}}|{{{p47|}}}|{{{p48|}}}|{{{p49|}}}|{{{p50|}}}}}
|{{#if:{{{p1|}}}|{{Collapsible list|title={{{parts|}}}|expand={{#switch:{{{parts_style|}}}|coll=|list=y|{{#if:{{{p6|}}}||y}}}}|1={{{p1|}}}|2={{{p2|}}}|3={{{p3|}}}|4={{{p4|}}}|5={{{p5|}}}|6={{{p6|}}}|7={{{p7|}}}|8={{{p8|}}}|9={{{p9|}}}|10={{{p10|}}}|11={{{p11|}}}|12={{{p12|}}}|13={{{p13|}}}|14={{{p14|}}}|15={{{p15|}}}|16={{{p16|}}}|17={{{p17|}}}|18={{{p18|}}}|19={{{p19|}}}|20={{{p20|}}}|21={{{p21|}}}|22={{{p22|}}}|23={{{p23|}}}|24={{{p24|}}}|25={{{p25|}}}|26={{{p26|}}}|27={{{p27|}}}|28={{{p28|}}}|29={{{p29|}}}|30={{{p30|}}}|31={{{p31|}}}|32={{{p32|}}}|33={{{p33|}}}|34={{{p34|}}}|35={{{p35|}}}|36={{{p36|}}}|37={{{p37|}}}|38={{{p38|}}}|39={{{p39|}}}|40={{{p40|}}}|41={{{p41|}}}|42={{{p42|}}}|43={{{p43|}}}|44={{{p44|}}}|45={{{p45|}}}|46={{{p46|}}}|47={{{p47|}}}|48={{{p48|}}}|49={{{p49|}}}|50={{{p50|}}}}}
|{{{parts}}}
}}
}} }}
<!-- ***Government type and Leader*** -->
| rowclass50 = mergedtoprow
| header50 = {{#if:{{{government_type|}}}{{{governing_body|}}}{{{leader_name|}}}{{{leader_name1|}}}{{{leader_name2|}}}{{{leader_name3|}}}{{{leader_name4|}}}|Government<span style="font-weight:normal">{{{government_footnotes|}}}</span>}}
<!-- ***Government*** -->
| rowclass51 = mergedrow
| label51 = • Type
| data51 = {{{government_type|}}}
| rowclass52 = mergedrow
| label52 = • Body
| class52 = agent
| data52 = {{{governing_body|}}}
| rowclass53 = mergedrow
| label53 = • {{{leader_title}}}
| data53 = {{#if:{{{leader_title|}}}|{{{leader_name|}}} {{#if:{{{leader_party|}}}|({{Polparty|{{{subdivision_name}}}|{{{leader_party}}}}})}}}}
| rowclass54 = mergedrow
| label54 = • {{{leader_title1}}}
| data54 = {{#if:{{{leader_title1|}}}|{{{leader_name1|}}}}}
| rowclass55 = mergedrow
| label55 = • {{{leader_title2}}}
| data55 = {{#if:{{{leader_title2|}}}|{{{leader_name2|}}}}}
| rowclass56 = mergedrow
| label56 = • {{{leader_title3}}}
| data56 = {{#if:{{{leader_title3|}}}|{{{leader_name3|}}}}}
| rowclass57 = mergedrow
| label57 = • {{{leader_title4}}}
| data57 = {{#if:{{{leader_title4|}}}|{{{leader_name4|}}}}}
<!-- ***Geographical characteristics*** -->
<!-- ***Area*** -->
| rowclass58 = mergedtoprow
| header58 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_rural_sq_mi|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_km2|}}}{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_metro_sq_mi|}}}{{{area_blank1_sq_mi|}}}
|{{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|<!-- displayed below -->
|Area<span style="font-weight:normal">{{{area_footnotes|}}}</span>
}}
}}
| rowclass59 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}|mergedtoprow|mergedrow}}
| label59 = {{#if:{{both|{{#ifeq:{{{total_type}}}| |1}}|{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}}}
|Area<span style="font-weight:normal">{{{area_footnotes|}}}</span>
| • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
}}
| data59 = {{#if:{{{area_total_km2|}}}{{{area_total_ha|}}}{{{area_total_acre|}}}{{{area_total_sq_mi|}}}{{{area_total_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_total_km2|}}}
|ha ={{{area_total_ha|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|dunam={{{area_total_dunam|}}}
|link ={{#switch:{{{dunam_link|}}}||on|total=on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
|mag ={{{area_magnitude|}}}
}}}}
| rowclass60 = mergedrow
| label60 = • Land
| data60 = {{#if:{{{area_land_km2|}}}{{{area_land_ha|}}}{{{area_land_acre|}}}{{{area_land_sq_mi|}}}{{{area_land_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_land_km2|}}}
|ha ={{{area_land_ha|}}}
|acre ={{{area_land_acre|}}}
|sqmi ={{{area_land_sq_mi|}}}
|dunam={{{area_land_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|land|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass61 = mergedrow
| label61 = • Water
| data61 = {{#if:{{{area_water_km2|}}}{{{area_water_ha|}}}{{{area_water_acre|}}}{{{area_water_sq_mi|}}}{{{area_water_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_water_km2|}}}
|ha ={{{area_water_ha|}}}
|acre ={{{area_water_acre|}}}
|sqmi ={{{area_water_sq_mi|}}}
|dunam={{{area_water_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|water|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}} {{#if:{{{area_water_percent|}}}| {{{area_water_percent}}}%}}}}
| rowclass62 = mergedrow
| label62 = • Urban<span style="font-weight:normal">{{{area_urban_footnotes|}}}</span>
| data62 = {{#if:{{{area_urban_km2|}}}{{{area_urban_ha|}}}{{{area_urban_acre|}}}{{{area_urban_sq_mi|}}}{{{area_urban_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_urban_km2|}}}
|ha ={{{area_urban_ha|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|urban|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass63 = mergedrow
| label63 = • Rural<span style="font-weight:normal">{{{area_rural_footnotes|}}}</span>
| data63 = {{#if:{{{area_rural_km2|}}}{{{area_rural_ha|}}}{{{area_rural_acre|}}}{{{area_rural_sq_mi|}}}{{{area_rural_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_rural_km2|}}}
|ha ={{{area_rural_ha|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|rural|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass64 = mergedrow
| label64 = • Metro<span style="font-weight:normal">{{{area_metro_footnotes|}}}</span>
| data64 = {{#if:{{{area_metro_km2|}}}{{{area_metro_ha|}}}{{{area_metro_acre|}}}{{{area_metro_sq_mi|}}}{{{area_metro_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_metro_km2|}}}
|ha ={{{area_metro_ha|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|metro|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Area rank*** -->
| rowclass65 = mergedrow
| label65 = Area rank
| data65 = {{{area_rank|}}}
| rowclass66 = mergedrow
| label66 = • {{{area_blank1_title}}}
| data66 = {{#if:{{{area_blank1_km2|}}}{{{area_blank1_ha|}}}{{{area_blank1_acre|}}}{{{area_blank1_sq_mi|}}}{{{area_blank1_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank1_km2|}}}
|ha ={{{area_blank1_ha|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank1|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass67 = mergedrow
| label67 = • {{{area_blank2_title}}}
| data67 = {{#if:{{{area_blank2_km2|}}}{{{area_blank2_ha|}}}{{{area_blank2_acre|}}}{{{area_blank2_sq_mi|}}}{{{area_blank2_dunam|}}}
|{{infobox_settlement/areadisp
|km2 ={{{area_blank2_km2|}}}
|ha ={{{area_blank2_ha|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|link ={{#ifeq:{{{dunam_link|}}}|blank2|on}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass68 = mergedrow
| label68 =
| data68 = {{#if:{{{area_note|}}}|<small>{{{area_note}}}</small>}}
<!-- ***Dimensions*** -->
| rowclass69 = mergedtoprow
| header69 = {{#if:{{{length_km|}}}{{{length_mi|}}}{{{width_km|}}}{{{width_mi|}}}|Dimensions<span style="font-weight:normal">{{{dimensions_footnotes|}}}</span>}}
| rowclass70 = mergedrow
| label70 = • Length
| data70 = {{#if:{{{length_km|}}}{{{length_mi|}}}
| {{infobox_settlement/lengthdisp
|km ={{{length_km|}}}
|mi ={{{length_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass71 = mergedrow
| label71 = • Width
| data71 = {{#if:{{{width_km|}}}{{{width_mi|}}}
|{{infobox_settlement/lengthdisp
|km ={{{width_km|}}}
|mi ={{{width_mi|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation*** -->
| rowclass72 = mergedtoprow
| label72 = Elevation<span style="font-weight:normal">{{{elevation_footnotes|}}}{{#if:{{{elevation_point|}}}| ({{{elevation_point}}})}}</span>
| data72 = {{#if:{{{elevation_m|}}}{{{elevation_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_m|}}}
|ft ={{{elevation_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
| rowclass73 = mergedtoprow
| label73 = Highest elevation<span style="font-weight:normal">{{{elevation_max_footnotes|}}}{{#if:{{{elevation_max_point|}}}| ({{{elevation_max_point}}})}}</span>
| data73 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_max_m|}}}
|ft ={{{elevation_max_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation max rank*** -->
| rowclass74 = mergedrow
| label74 = • Rank
| data74 = {{#if:{{{elevation_max_m|}}}{{{elevation_max_ft|}}}| {{{elevation_max_rank|}}} }}
| rowclass75 = {{#if:{{{elevation_min_rank|}}}|mergedrow|mergedbottomrow}}
| label75 = Lowest elevation<span style="font-weight:normal">{{{elevation_min_footnotes|}}}{{#if:{{{elevation_min_point|}}}| ({{{elevation_min_point}}})}}</span>
| data75 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}
|{{infobox_settlement/lengthdisp
|m ={{{elevation_min_m|}}}
|ft ={{{elevation_min_ft|}}}
|pref={{{unit_pref}}}
|name={{{subdivision_name}}}
}} }}
<!-- ***Elevation min rank*** -->
| rowclass76 = mergedrow
| label76 = • Rank
| data76 = {{#if:{{{elevation_min_m|}}}{{{elevation_min_ft|}}}|{{{elevation_min_rank|}}}}}
<!-- ***Population*** -->
| rowclass77 = mergedtoprow
| label77 = Population <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
| data77 = {{#if:{{{population|}}}
| {{formatnum:{{{population}}}}}
| {{#ifeq:{{{total_type}}}|
| {{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass78 = mergedtoprow
| header78 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}{{{population_urban|}}}{{{population_rural|}}}{{{population_metro|}}}{{{population_blank1|}}}{{{population_blank2|}}}{{{population_est|}}}
|Population <span style="font-weight:normal">{{#if:{{{population_as_of|}}}|({{{population_as_of}}})}}{{{population_footnotes|}}}</span>
}}
}}
}}
| rowclass79 = mergedrow
| label79 = • {{#if:{{{total_type|}}}|{{{total_type}}}|{{#if:{{{population_metro|}}}{{{population_urban|}}}{{{population_rural|}}}{{{area_metro_km2|}}}{{{area_metro_sq_mi|}}}{{{area_urban_km2|}}}{{{area_urban_sq_mi|}}}{{{area_rural_km2|}}}{{{area_rural_sq_mi|}}}|{{#if:{{{settlement_type|{{{type|}}}}}}|{{{settlement_type|{{{type}}}}}}|City}}|Total}}}}
| data79 = {{#if:{{{population|}}}
|
|{{#ifeq:{{{total_type}}}|
|
|{{#if:{{{population_total|}}}
| {{formatnum:{{{population_total}}}}}
}}
}}
}}
| rowclass80 = mergedrow
| label80 = • Estimate <span style="font-weight:normal">({{{pop_est_as_of}}}){{{pop_est_footnotes|}}}</span>
| data80 = {{#if:{{{population_est|}}}|{{formatnum:{{{population_est}}}}} }}
<!-- ***Population rank*** -->
| rowclass81 = mergedrow
| label81 = • Rank
| data81 = {{{population_rank|}}}
| rowclass82 = mergedrow
| label82 = • Density
| data82 = {{#if:{{{population_density_km2|}}}{{{population_density_sq_mi|}}}{{{population_total|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_km2|}}}
|/sqmi={{{population_density_sq_mi|}}}
|pop ={{{population_total|}}}
|dunam={{{area_total_dunam|}}}
|ha ={{{area_total_ha|}}}
|km2 ={{{area_total_km2|}}}
|acre ={{{area_total_acre|}}}
|sqmi ={{{area_total_sq_mi|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
<!-- ***Population density rank*** -->
| rowclass83 = mergedrow
| label83 = • Density rank
| data83 = {{{population_density_rank|}}}
| rowclass84 = mergedrow
| label84 = • [[Urban area|Urban]]<span style="font-weight:normal">{{{population_urban_footnotes|}}}</span>
| data84 = {{#if:{{{population_urban|}}}| {{formatnum:{{{population_urban}}}}} }}
| rowclass85 = mergedrow
| label85 = • Urban density
| data85 = {{#if:{{{population_density_urban_km2|}}}{{{population_density_urban_sq_mi|}}}{{{population_urban|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_urban_km2|}}}
|/sqmi={{{population_density_urban_sq_mi|}}}
|pop ={{{population_urban|}}}
|ha ={{{area_urban_ha|}}}
|km2 ={{{area_urban_km2|}}}
|acre ={{{area_urban_acre|}}}
|sqmi ={{{area_urban_sq_mi|}}}
|dunam={{{area_urban_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass86 = mergedrow
| label86 = • [[Rural area|Rural]]<span style="font-weight:normal">{{{population_rural_footnotes|}}}</span>
| data86 = {{#if:{{{population_rural|}}}|{{formatnum:{{{population_rural}}}}}}}
| rowclass87 = mergedrow
| label87 = • Rural density
| data87 = {{#if:{{{population_density_rural_km2|}}}{{{population_density_rural_sq_mi|}}}{{{population_rural|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_rural_km2|}}}
|/sqmi={{{population_density_rural_sq_mi|}}}
|pop ={{{population_rural|}}}
|ha ={{{area_rural_ha|}}}
|km2 ={{{area_rural_km2|}}}
|acre ={{{area_rural_acre|}}}
|sqmi ={{{area_rural_sq_mi|}}}
|dunam={{{area_rural_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass88 = mergedrow
| label88 = • [[Metropolitan area|Metro]]<span style="font-weight:normal">{{{population_metro_footnotes|}}}</span>
| data88 = {{#if:{{{population_metro|}}}| {{formatnum:{{{population_metro}}}}} }}
| rowclass89 = mergedrow
| label89 = • Metro density
| data89 = {{#if:{{{population_density_metro_km2|}}}{{{population_density_metro_sq_mi|}}}{{{population_metro|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_metro_km2|}}}
|/sqmi={{{population_density_metro_sq_mi|}}}
|pop ={{{population_metro|}}}
|ha ={{{area_metro_ha|}}}
|km2 ={{{area_metro_km2|}}}
|acre ={{{area_metro_acre|}}}
|sqmi ={{{area_metro_sq_mi|}}}
|dunam={{{area_metro_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass90 = mergedrow
| label90 = • {{{population_blank1_title|}}}<span style="font-weight:normal">{{{population_blank1_footnotes|}}}</span>
| data90 = {{#if:{{{population_blank1|}}}|{{formatnum:{{{population_blank1}}}}}}}
| rowclass91 = mergedrow
| label91 = • {{#if:{{{population_blank1_title|}}}|{{{population_blank1_title}}} density|Density}}
| data91 = {{#if:{{{population_density_blank1_km2|}}}{{{population_density_blank1_sq_mi|}}}{{{population_blank1|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank1_km2|}}}
|/sqmi={{{population_density_blank1_sq_mi|}}}
|pop ={{{population_blank1|}}}
|ha ={{{area_blank1_ha|}}}
|km2 ={{{area_blank1_km2|}}}
|acre ={{{area_blank1_acre|}}}
|sqmi ={{{area_blank1_sq_mi|}}}
|dunam={{{area_blank1_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass92 = mergedrow
| label92 = • {{{population_blank2_title|}}}<span style="font-weight:normal">{{{population_blank2_footnotes|}}}</span>
| data92 = {{#if:{{{population_blank2|}}}|{{formatnum:{{{population_blank2}}}}}}}
| rowclass93 = mergedrow
| label93 = • {{#if:{{{population_blank2_title|}}}|{{{population_blank2_title}}} density|Density}}
| data93 = {{#if:{{{population_density_blank2_km2|}}}{{{population_density_blank2_sq_mi|}}}{{{population_blank2|}}}
|{{infobox_settlement/densdisp
|/km2 ={{{population_density_blank2_km2|}}}
|/sqmi={{{population_density_blank2_sq_mi|}}}
|pop ={{{population_blank2|}}}
|ha ={{{area_blank2_ha|}}}
|km2 ={{{area_blank2_km2|}}}
|acre ={{{area_blank2_acre|}}}
|sqmi ={{{area_blank2_sq_mi|}}}
|dunam={{{area_blank2_dunam|}}}
|pref ={{{unit_pref}}}
|name ={{{subdivision_name}}}
}}}}
| rowclass94 = mergedrow
| label94 =
| data94 = {{#if:{{{population_note|}}}|<small>{{{population_note}}}</small>}}
| rowclass95 = mergedtoprow
| label95 = [[Demonym|Demonym(s)]]
| data95 = {{{population_demonym|}}}
<!-- ***Demographics 1*** -->
| rowclass96 = mergedtoprow
| header96 = {{#if:{{{demographics_type1|}}}
|{{{demographics_type1}}}<span style="font-weight:normal">{{{demographics1_footnotes|}}}</span>}}
| rowclass97 = mergedrow
| label97 = • {{{demographics1_title1}}}
| data97 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title1|}}}|{{{demographics1_info1|}}}}}}}
| rowclass98 = mergedrow
| label98 = • {{{demographics1_title2}}}
| data98 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title2|}}}|{{{demographics1_info2|}}}}}}}
| rowclass99 = mergedrow
| label99 = • {{{demographics1_title3}}}
| data99 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title3|}}}|{{{demographics1_info3|}}}}}}}
| rowclass100 = mergedrow
| label100 = • {{{demographics1_title4}}}
| data100 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title4|}}}|{{{demographics1_info4|}}}}}}}
| rowclass101 = mergedrow
| label101 = • {{{demographics1_title5}}}
| data101 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title5|}}}|{{{demographics1_info5|}}}}}}}
| rowclass102 = mergedrow
| label102 = • {{{demographics1_title6}}}
| data102 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title6|}}}|{{{demographics1_info6|}}}}}}}
| rowclass103 = mergedrow
| label103 = • {{{demographics1_title7}}}
| data103 = {{#if:{{{demographics_type1|}}}
|{{#if:{{{demographics1_title7|}}}|{{{demographics1_info7|}}}}}}}
<!-- ***Demographics 2*** -->
| rowclass104 = mergedtoprow
| header104 = {{#if:{{{demographics_type2|}}}
|{{{demographics_type2}}}<span style="font-weight:normal">{{{demographics2_footnotes|}}}</span>}}
| rowclass105 = mergedrow
| label105 = • {{{demographics2_title1}}}
| data105 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title1|}}}|{{{demographics2_info1|}}}}}}}
| rowclass106 = mergedrow
| label106 = • {{{demographics2_title2}}}
| data106 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title2|}}}|{{{demographics2_info2|}}}}}}}
| rowclass107 = mergedrow
| label107 = • {{{demographics2_title3}}}
| data107 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title3|}}}|{{{demographics2_info3|}}}}}}}
| rowclass108 = mergedrow
| label108 = • {{{demographics2_title4}}}
| data108 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title4|}}}|{{{demographics2_info4|}}}}}}}
| rowclass109 = mergedrow
| label109 = • {{{demographics2_title5}}}
| data109 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title5|}}}|{{{demographics2_info5|}}}}}}}
| rowclass110 = mergedrow
| label110 = • {{{demographics2_title6}}}
| data110 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title6|}}}|{{{demographics2_info6|}}}}}}}
| rowclass111 = mergedrow
| label111 = • {{{demographics2_title7}}}
| data111 = {{#if:{{{demographics_type2|}}}
|{{#if:{{{demographics2_title7|}}}|{{{demographics2_info7|}}}}}}}
<!-- ***Time Zones*** -->
| rowclass112 = mergedtoprow
| label112 = {{#if:{{{timezone2|}}}|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]s|[[{{#if:{{{timezone_link|}}}|{{{timezone_link}}}|Time zone}}|Time zone]]}}
| data112 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{{timezone1|{{{timezone}}}}}} {{#if:{{{utc_offset1|{{{utc_offset|}}} }}}|([[UTC{{{utc_offset1|{{{utc_offset}}}}}}]])}} }}
| rowclass113 = mergedrow
| label113 = <nowiki />
| data113 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone2|}}}|{{{timezone2}}} {{#if:{{{utc_offset2|{{{utc_offset2|}}} }}}|([[UTC{{{utc_offset2|{{{utc_offset2}}}}}}]])}} }} }}
| rowclass114 = mergedrow
| label114 = <span style="white-space:nowrap"> • Summer ([[Daylight saving time|DST]])</span>
| data114 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{{timezone1_DST|{{{timezone_DST|}}}}}} ([[UTC{{{utc_offset1_DST|{{{utc_offset_DST|}}}}}}]])}} }}
| rowclass115 = mergedrow
| label115 = <nowiki />
| data115 = {{#if:{{{timezone1|{{{timezone|}}}}}}|{{#if:{{{timezone1_DST|{{{timezone_DST|}}}}}}|{{#if:{{{timezone2_DST|}}}|{{{timezone2_DST}}} ([[UTC{{{utc_offset2_DST|}}}]])}} }} }}
<!-- ***Postal Code(s)*** -->
| rowclass116 = mergedtoprow
| label116 = {{{postal_code_type}}}
| class116 = adr
| data116 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|<span class="postal-code">{{{postal_code}}}</span>}}}}
| rowclass117 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}|mergedbottomrow|mergedtoprow}}
| label117 = {{{postal2_code_type}}}
| class117 = adr
| data117 = {{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|<span class="postal-code">{{{postal2_code}}}</span>}} }} }}
<!-- ***Area Code(s)*** -->
| rowclass118 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}|mergedrow|mergedtoprow}}
| label118 = {{#if:{{{area_code_type|}}}|{{{area_code_type}}}|[[Telephone numbering plan|Area code(s)]]}}
| data118 = {{{area_code|}}}
<!-- Geocode-->
| rowclass119 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}|mergedrow|mergedtoprow}}
| label119 = [[Geocode]]
| class119 = nickname
| data119 = {{{geocode|}}}
<!-- ISO Code-->
| rowclass120 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}|mergedrow|mergedtoprow}}
| label120 = [[ISO 3166|ISO 3166 code]]
| class120 = nickname
| data120 = {{{iso_code|}}}
<!-- Vehicle registration plate-->
| rowclass121 = {{#if:{{#if:{{{postal_code_type|}}}|{{#if:{{{postal_code|}}}|1}}}}{{#if:{{{postal_code_type|}}}|{{#if:{{{postal2_code_type|}}}|{{#if:{{{postal2_code|}}}|1}}}}}}{{{area_code|}}}{{{geocode|}}}{{{iso_code|}}}|mergedrow|mergedtoprow}}
| label121 = {{#if:{{{registration_plate_type|}}}|{{{registration_plate_type}}}|[[Vehicle registration plate|Vehicle registration]]}}
| data121 = {{{registration_plate|}}}
<!-- ***Blank Fields (two sections)*** -->
| rowclass122 = mergedtoprow
| label122 = {{{blank_name_sec1|{{{blank_name|}}}}}}
| data122 = {{#if:{{{blank_name_sec1|{{{blank_name|}}}}}}|{{{blank_info_sec1|{{{blank_info|}}}}}}}}
| rowclass123 = mergedrow
| label123 = {{{blank1_name_sec1|{{{blank1_name|}}}}}}
| data123 = {{#if:{{{blank1_name_sec1|{{{blank1_name|}}}}}}|{{{blank1_info_sec1|{{{blank1_info|}}}}}}}}
| rowclass124 = mergedrow
| label124 = {{{blank2_name_sec1|{{{blank2_name|}}}}}}
| data124 = {{#if:{{{blank2_name_sec1|{{{blank2_name|}}}}}}|{{{blank2_info_sec1|{{{blank2_info|}}}}}}}}
| rowclass125 = mergedrow
| label125 = {{{blank3_name_sec1|{{{blank3_name|}}}}}}
| data125 = {{#if:{{{blank3_name_sec1|{{{blank3_name|}}}}}}|{{{blank3_info_sec1|{{{blank3_info|}}}}}}}}
| rowclass126 = mergedrow
| label126 = {{{blank4_name_sec1|{{{blank4_name|}}}}}}
| data126 = {{#if:{{{blank4_name_sec1|{{{blank4_name|}}}}}}|{{{blank4_info_sec1|{{{blank4_info|}}}}}}}}
| rowclass127 = mergedrow
| label127 = {{{blank5_name_sec1|{{{blank5_name|}}}}}}
| data127 = {{#if:{{{blank5_name_sec1|{{{blank5_name|}}}}}}|{{{blank5_info_sec1|{{{blank5_info|}}}}}}}}
| rowclass128 = mergedrow
| label128 = {{{blank6_name_sec1|{{{blank6_name|}}}}}}
| data128 = {{#if:{{{blank6_name_sec1|{{{blank6_name|}}}}}}|{{{blank6_info_sec1|{{{blank6_info|}}}}}}}}
| rowclass129 = mergedrow
| label129 = {{{blank7_name_sec1|{{{blank7_name|}}}}}}
| data129 = {{#if:{{{blank7_name_sec1|{{{blank7_name|}}}}}}|{{{blank7_info_sec1|{{{blank7_info|}}}}}}}}
| rowclass130 = mergedtoprow
| label130 = {{{blank_name_sec2}}}
| data130 = {{#if:{{{blank_name_sec2|}}}|{{{blank_info_sec2|}}}}}
| rowclass131 = mergedrow
| label131 = {{{blank1_name_sec2}}}
| data131 = {{#if:{{{blank1_name_sec2|}}}|{{{blank1_info_sec2|}}}}}
| rowclass132 = mergedrow
| label132 = {{{blank2_name_sec2}}}
| data132 = {{#if:{{{blank2_name_sec2|}}}|{{{blank2_info_sec2|}}}}}
| rowclass133 = mergedrow
| label133 = {{{blank3_name_sec2}}}
| data133 = {{#if:{{{blank3_name_sec2|}}}|{{{blank3_info_sec2|}}}}}
| rowclass134 = mergedrow
| label134 = {{{blank4_name_sec2}}}
| data134 = {{#if:{{{blank4_name_sec2|}}}|{{{blank4_info_sec2|}}}}}
| rowclass135 = mergedrow
| label135 = {{{blank5_name_sec2}}}
| data135 = {{#if:{{{blank5_name_sec2|}}}|{{{blank5_info_sec2|}}}}}
| rowclass136 = mergedrow
| label136 = {{{blank6_name_sec2}}}
| data136 = {{#if:{{{blank6_name_sec2|}}}|{{{blank6_info_sec2|}}}}}
| rowclass137 = mergedrow
| label137 = {{{blank7_name_sec2}}}
| data137 = {{#if:{{{blank7_name_sec2|}}}|{{{blank7_info_sec2|}}}}}
<!-- ***Website*** -->
| rowclass138 = mergedtoprow
| label138 = Website
| data138 = {{#if:{{{website|}}}|{{{website}}}}}
<!-- ***Footnotes*** -->
| belowstyle = text-align:left; font-size:smaller
| belowrowclass = mergedtoprow
| below = {{{footnotes|}}}
}}<includeonly>{{#switch:{{{coordinates_region|}}}|CA-X|US-X|IN-X=[[Category:Infobox settlement uses with imprecise region codes]]
}}{{#if:{{{image_dot_map|}}}{{{dot_mapsize|}}}{{{dot_map_base_alt|}}}{{{dot_map_alt|}}}{{{dot_map_caption|}}}{{{dot_x|}}}{{{dot_y|}}}|[[Category:Pages using infobox settlement with a dot map]]
}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox settlement with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox settlement]] with unknown parameter "_VALUE_"|ignoreblank=y
| alt | anthem | area_blank1_acre | area_blank1_dunam | area_blank1_ha | area_blank1_km2 | area_blank1_sq_mi | area_blank1_title | area_blank2_acre | area_blank2_dunam | area_blank2_ha | area_blank2_km2 | area_blank2_sq_mi | area_blank2_title | area_code | area_code_type | area_footnotes | area_land_acre | area_land_dunam | area_land_ha | area_land_km2 | area_land_sq_mi | area_magnitude | area_metro_acre | area_metro_dunam | area_metro_footnotes | area_metro_ha | area_metro_km2 | area_metro_sq_mi | area_note | area_rank | area_rural_acre | area_rural_dunam | area_rural_footnotes | area_rural_ha | area_rural_km2 | area_rural_sq_mi | area_total_acre | area_total_dunam | area_total_ha | area_total_km2 | area_total_sq_mi | area_urban_acre | area_urban_dunam | area_urban_footnotes | area_urban_ha | area_urban_km2 | area_urban_sq_mi | area_water_acre | area_water_dunam | area_water_ha | area_water_km2 | area_water_percent | area_water_sq_mi | blank_emblem_alt | blank_emblem_link | blank_emblem_size | blank_emblem_type | blank_info | blank_info_sec1 | blank_info_sec2 | blank_name | blank_name_sec1 | blank_name_sec2 | blank1_info | blank1_info_sec1 | blank1_info_sec2 | blank1_name | blank1_name_sec1 | blank1_name_sec2 | blank2_info | blank2_info_sec1 | blank2_info_sec2 | blank2_name | blank2_name_sec1 | blank2_name_sec2 | blank3_info | blank3_info_sec1 | blank3_info_sec2 | blank3_name | blank3_name_sec1 | blank3_name_sec2 | blank4_info | blank4_info_sec1 | blank4_info_sec2 | blank4_name | blank4_name_sec1 | blank4_name_sec2 | blank5_info | blank5_info_sec1 | blank5_info_sec2 | blank5_name | blank5_name_sec1 | blank5_name_sec2 | blank6_info | blank6_info_sec1 | blank6_info_sec2 | blank6_name | blank6_name_sec1 | caption | blank6_name_sec2 | blank7_info | blank7_info_sec1 | blank7_info_sec2 | blank7_name | blank7_name_sec1 | blank7_name_sec2 | coor_pinpoint | coor_type | coordinates | coordinates_footnotes | demographics_type1 | demographics_type2 | demographics1_footnotes | demographics1_info1 | demographics1_info2 | demographics1_info3 | demographics1_info4 | demographics1_info5 | demographics1_info6 | demographics1_info7 | demographics1_title1 | demographics1_title2 | demographics1_title3 | demographics1_title4 | demographics1_title5 | demographics1_title6 | demographics1_title7 | demographics2_footnotes | demographics2_info1 | demographics2_info2 | demographics2_info3 | demographics2_info4 | demographics2_info5 | demographics2_info6 | demographics2_info7 | demographics2_title1 | demographics2_title2 | demographics2_title3 | demographics2_title4 | demographics2_title5 | demographics2_title6 | demographics2_title7 | dimensions_footnotes | dunam_link | elevation_footnotes | elevation_ft | elevation_m | elevation_max_footnotes | elevation_max_ft | elevation_max_m | elevation_max_point | elevation_max_rank | elevation_min_footnotes | elevation_min_ft | elevation_min_m | elevation_min_point | elevation_min_rank | elevation_point | embed | established_date | established_date1 | established_date2 | established_date3 | established_date4 | established_date5 | established_date6 | established_date7 | established_title | established_title1 | established_title2 | established_title3 | established_title4 | established_title5 | established_title6 | established_title7 | etymology | extinct_date | extinct_title | flag_alt | flag_border | flag_link | flag_size | footnotes| founder | geocode | governing_body | government_footnotes | government_type | grid_name | grid_position | image | image_alt | image_blank_emblem | image_caption | image_flag | image_map | image_map1 | image_seal | image_shield | image_skyline | image_size | imagesize | iso_code | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_name4 | leader_party | leader_title | leader_title1 | leader_title2 | leader_title3 | leader_title4 | length_km | length_mi | map_alt | map_alt1 | map_caption | map_caption1 | mapsize | mapsize1 | motto | name | named_for | native_name | native_name_lang | nickname | official_name | other_name | p1 | p10 | p11 | p12 | p13 | p14 | p15 | p16 | p17 | p18 | p19 | p2 | p20 | p21 | p22 | p23 | p24 | p25 | p26 | p27 | p28 | p29 | p3 | p30 | p31 | p32 | p33 | p34 | p35 | p36 | p37 | p38 | p39 | p4 | p40 | p41 | p42 | p43 | p44 | p45 | p46 | p47 | p48 | p49 | p5 | p50 | p6 | p7 | p8 | p9 | parts | parts_style | parts_type | pop_est_as_of | pop_est_footnotes | population | population_as_of | population_blank1 | population_blank1_footnotes | population_blank1_title | population_blank2 | population_blank2_footnotes | population_blank2_title | population_demonym | population_density_blank1_km2 | population_density_blank1_sq_mi | population_density_blank2_km2 | population_density_blank2_sq_mi | population_density_km2 | population_density_metro_km2 | population_density_metro_sq_mi | population_density_rank | population_density_rural_km2 | population_density_rural_sq_mi | population_density_sq_mi | population_density_urban_km2 | population_density_urban_sq_mi | population_est | population_footnotes | population_metro | population_metro_footnotes | population_note | population_rank | population_rural | population_rural_footnotes | population_total | population_urban | population_urban_footnotes | postal_code | postal_code_type | postal2_code | postal2_code_type | pushpin_image | pushpin_label | pushpin_label_position | pushpin_map | pushpin_map_alt | pushpin_map_caption | pushpin_map_caption_notsmall | pushpin_map_narrow | pushpin_mapsize | pushpin_outside | pushpin_overlay | pushpin_relief | registration_plate | registration_plate_type | seal_alt | seal_link | seal_size | seal_type | seat | seat_type | seat1 | seat1_type | settlement_type | shield_alt | shield_link | shield_size | short_description | subdivision_name | subdivision_name1 | subdivision_name2 | subdivision_name3 | subdivision_name4 | subdivision_name5 | subdivision_name6 | subdivision_type | subdivision_type1 | subdivision_type2 | subdivision_type3 | subdivision_type4 | subdivision_type5 | subdivision_type6 | timezone | timezone_link | timezone_DST | timezone1 | timezone1_DST | timezone2 | timezone2_DST | total_type | translit_lang1 | translit_lang1_info | translit_lang1_info1 | translit_lang1_info2 | translit_lang1_info3 | translit_lang1_info4 | translit_lang1_info5 | translit_lang1_info6 | translit_lang1_type | translit_lang1_type1 | translit_lang1_type2 | translit_lang1_type3 | translit_lang1_type4 | translit_lang1_type5 | translit_lang1_type6 | translit_lang2 | translit_lang2_info | translit_lang2_info1 | translit_lang2_info2 | translit_lang2_info3 | translit_lang2_info4 | translit_lang2_info5 | translit_lang2_info6 | translit_lang2_type | translit_lang2_type1 | translit_lang2_type2 | translit_lang2_type3 | translit_lang2_type4 | translit_lang2_type5 | translit_lang2_type6 | type | unit_pref | utc_offset | utc_offset_DST | utc_offset1 | utc_offset1_DST | utc_offset2 | utc_offset2_DST | website | width_km | width_mi
}}{{#if:{{{image|}}}|[[Category:Pages using infobox settlement with the image parameter|{{#if:{{{image_skyline|}}}|!}}{{PAGENAME}}]]}}{{#if:{{{coordinates_wikidata|}}}{{{wikidata|}}}
|[[Category:Pages using infobox settlement with the wikidata parameter]]
}}<noinclude>
{{Documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
2ce26f650c93944a840d46321669c882adab06f1
Template:Both
10
3
5
4
2024-06-03T23:42:25Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{SAFESUBST:<noinclude />#if:{{{2|}}}|1}}}}<noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Both}}
</noinclude>
11e3119581f17594e02b5ed766168163e719e2cc
Template:If empty
10
4
7
6
2024-06-03T23:42:26Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>{{Documentation}}</noinclude>
745940b7bdde8a1585c887ee4ee5ce81d98461a4
Template:Infobox
10
5
9
8
2024-06-03T23:42:26Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
{{En-WP attribution notice|Template:Infobox}}
</noinclude>
b181da29e3e571777dffc29307761f8560ea76e5
Template:Main other
10
6
11
10
2024-06-03T23:42:26Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}<noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c8e5526da7586aff37928206e183ceef44ed7829
Template:PAGENAMEBASE
10
7
13
12
2024-06-03T23:42:27Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{{{{|safesubst:}}}#Invoke:String|replace|{{{1|{{{{{|safesubst:}}}PAGENAME}}}}}|%s+%b()$||1|false}}<noinclude>
{{documentation}}
</noinclude>
f23a5d434cb5b0baac5e1f58e9ceef9118e6873f
Template:Template other
10
8
15
14
2024-06-03T23:42:27Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
| template
| other
}}
}}
| template = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
06fb13d264df967b5232141067eb7d2b67372d76
Template:Yesno
10
9
17
16
2024-06-03T23:42:27Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
|no
|n
|f
|false
|off
|0 = {{{no|<!-- null -->}}}
| = {{{blank|{{{no|<!-- null -->}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|t
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
629c2937bc5cf7cfe13cd2a598582af832782399
Module:Arguments
828
10
19
18
2024-06-03T23:42:27Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be
-- called from #invoke directly.
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the
-- options every time we call it.
local function tidyValDefault(key, val)
if type(val) == 'string' then
val = val:match('^%s*(.-)%s*$')
if val == '' then
return nil
else
return val
end
else
return val
end
end
local function tidyValTrimOnly(key, val)
if type(val) == 'string' then
return val:match('^%s*(.-)%s*$')
else
return val
end
end
local function tidyValRemoveBlanksOnly(key, val)
if type(val) == 'string' then
if val:find('%S') then
return val
else
return nil
end
else
return val
end
end
local function tidyValNoChange(key, val)
return val
end
local function matchesTitle(given, title)
local tp = type( given )
return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options)
checkType('getArgs', 1, frame, 'table', true)
checkType('getArgs', 2, options, 'table', true)
frame = frame or {}
options = options or {}
--[[
-- Set up argument translation.
--]]
options.translate = options.translate or {}
if getmetatable(options.translate) == nil then
setmetatable(options.translate, translate_mt)
end
if options.backtranslate == nil then
options.backtranslate = {}
for k,v in pairs(options.translate) do
options.backtranslate[v] = k
end
end
if options.backtranslate and getmetatable(options.backtranslate) == nil then
setmetatable(options.backtranslate, {
__index = function(t, k)
if options.translate[k] ~= k then
return nil
else
return k
end
end
})
end
--[[
-- Get the argument tables. If we were passed a valid frame object, get the
-- frame arguments (fargs) and the parent frame arguments (pargs), depending
-- on the options set and on the parent frame's availability. If we weren't
-- passed a valid frame object, we are being called from another Lua module
-- or from the debug console, so assume that we were passed a table of args
-- directly, and assign it to a new variable (luaArgs).
--]]
local fargs, pargs, luaArgs
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
if options.wrappers then
--[[
-- The wrappers option makes Module:Arguments look up arguments in
-- either the frame argument table or the parent argument table, but
-- not both. This means that users can use either the #invoke syntax
-- or a wrapper template without the loss of performance associated
-- with looking arguments up in both the frame and the parent frame.
-- Module:Arguments will look up arguments in the parent frame
-- if it finds the parent frame's title in options.wrapper;
-- otherwise it will look up arguments in the frame object passed
-- to getArgs.
--]]
local parent = frame:getParent()
if not parent then
fargs = frame.args
else
local title = parent:getTitle():gsub('/sandbox$', '')
local found = false
if matchesTitle(options.wrappers, title) then
found = true
elseif type(options.wrappers) == 'table' then
for _,v in pairs(options.wrappers) do
if matchesTitle(v, title) then
found = true
break
end
end
end
-- We test for false specifically here so that nil (the default) acts like true.
if found or options.frameOnly == false then
pargs = parent.args
end
if not found or options.parentOnly == false then
fargs = frame.args
end
end
else
-- options.wrapper isn't set, so check the other options.
if not options.parentOnly then
fargs = frame.args
end
if not options.frameOnly then
local parent = frame:getParent()
pargs = parent and parent.args or nil
end
end
if options.parentFirst then
fargs, pargs = pargs, fargs
end
else
luaArgs = frame
end
-- Set the order of precedence of the argument tables. If the variables are
-- nil, nothing will be added to the table, which is how we avoid clashes
-- between the frame/parent args and the Lua args.
local argTables = {fargs}
argTables[#argTables + 1] = pargs
argTables[#argTables + 1] = luaArgs
--[[
-- Generate the tidyVal function. If it has been specified by the user, we
-- use that; if not, we choose one of four functions depending on the
-- options chosen. This is so that we don't have to call the options table
-- every time the function is called.
--]]
local tidyVal = options.valueFunc
if tidyVal then
if type(tidyVal) ~= 'function' then
error(
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
elseif options.trim ~= false then
if options.removeBlanks ~= false then
tidyVal = tidyValDefault
else
tidyVal = tidyValTrimOnly
end
else
if options.removeBlanks ~= false then
tidyVal = tidyValRemoveBlanksOnly
else
tidyVal = tidyValNoChange
end
end
--[[
-- Set up the args, metaArgs and nilArgs tables. args will be the one
-- accessed from functions, and metaArgs will hold the actual arguments. Nil
-- arguments are memoized in nilArgs, and the metatable connects all of them
-- together.
--]]
local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
setmetatable(args, metatable)
local function mergeArgs(tables)
--[[
-- Accepts multiple tables as input and merges their keys and values
-- into one table. If a value is already present it is not overwritten;
-- tables listed earlier have precedence. We are also memoizing nil
-- values, which can be overwritten if they are 's' (soft).
--]]
for _, t in ipairs(tables) do
for key, val in pairs(t) do
if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
local tidiedVal = tidyVal(key, val)
if tidiedVal == nil then
nilArgs[key] = 's'
else
metaArgs[key] = tidiedVal
end
end
end
end
end
--[[
-- Define metatable behaviour. Arguments are memoized in the metaArgs table,
-- and are only fetched from the argument tables once. Fetching arguments
-- from the argument tables is the most resource-intensive step in this
-- module, so we try and avoid it where possible. For this reason, nil
-- arguments are also memoized, in the nilArgs table. Also, we keep a record
-- in the metatable of when pairs and ipairs have been called, so we do not
-- run pairs and ipairs on the argument tables more than once. We also do
-- not run ipairs on fargs and pargs if pairs has already been run, as all
-- the arguments will already have been copied over.
--]]
metatable.__index = function (t, key)
--[[
-- Fetches an argument when the args table is indexed. First we check
-- to see if the value is memoized, and if not we try and fetch it from
-- the argument tables. When we check memoization, we need to check
-- metaArgs before nilArgs, as both can be non-nil at the same time.
-- If the argument is not present in metaArgs, we also check whether
-- pairs has been run yet. If pairs has already been run, we return nil.
-- This is because all the arguments will have already been copied into
-- metaArgs by the mergeArgs function, meaning that any other arguments
-- must be nil.
--]]
if type(key) == 'string' then
key = options.translate[key]
end
local val = metaArgs[key]
if val ~= nil then
return val
elseif metatable.donePairs or nilArgs[key] then
return nil
end
for _, argTable in ipairs(argTables) do
local argTableVal = tidyVal(key, argTable[key])
if argTableVal ~= nil then
metaArgs[key] = argTableVal
return argTableVal
end
end
nilArgs[key] = 'h'
return nil
end
metatable.__newindex = function (t, key, val)
-- This function is called when a module tries to add a new value to the
-- args table, or tries to change an existing value.
if type(key) == 'string' then
key = options.translate[key]
end
if options.readOnly then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
--[[
-- If the argument is to be overwritten with nil, we need to erase
-- the value in metaArgs, so that __index, __pairs and __ipairs do
-- not use a previous existing value, if present; and we also need
-- to memoize the nil in nilArgs, so that the value isn't looked
-- up in the argument tables if it is accessed again.
--]]
metaArgs[key] = nil
nilArgs[key] = 'h'
else
metaArgs[key] = val
end
end
local function translatenext(invariant)
local k, v = next(invariant.t, invariant.k)
invariant.k = k
if k == nil then
return nil
elseif type(k) ~= 'string' or not options.backtranslate then
return k, v
else
local backtranslate = options.backtranslate[k]
if backtranslate == nil then
-- Skip this one. This is a tail call, so this won't cause stack overflow
return translatenext(invariant)
else
return backtranslate, v
end
end
end
metatable.__pairs = function ()
-- Called when pairs is run on the args table.
if not metatable.donePairs then
mergeArgs(argTables)
metatable.donePairs = true
end
return translatenext, { t = metaArgs }
end
local function inext(t, i)
-- This uses our __index metamethod
local v = t[i + 1]
if v ~= nil then
return i + 1, v
end
end
metatable.__ipairs = function (t)
-- Called when ipairs is run on the args table.
return inext, t, 0
end
return args
end
return arguments
3134ecce8429b810d445e29eae115e2ae4c36c53
Module:Check for unknown parameters
828
11
21
20
2024-06-03T23:42:29Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and s:match('%S')
end
local function clean(text)
-- Return text cleaned for display and truncated if too long.
-- Strip markers are replaced with dummy text representing the original wikitext.
local pos, truncated
local function truncate(text)
if truncated then
return ''
end
if mw.ustring.len(text) > 25 then
truncated = true
text = mw.ustring.sub(text, 1, 25) .. '...'
end
return mw.text.nowiki(text)
end
local parts = {}
for before, tag, remainder in text:gmatch('([^\127]*)\127[^\127]*%-(%l+)%-[^\127]*\127()') do
pos = remainder
table.insert(parts, truncate(before) .. '<' .. tag .. '>...</' .. tag .. '>')
end
table.insert(parts, truncate(text:sub(pos or 1)))
return table.concat(parts)
end
function p._check(args, pargs)
if type(args) ~= "table" or type(pargs) ~= "table" then
-- TODO: error handling
return
end
-- create the list of known args, regular expressions, and the return string
local knownargs = {}
local regexps = {}
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
-- loop over the parent args, and make sure they are on the list
local ignoreblank = isnotempty(args['ignoreblank'])
local showblankpos = isnotempty(args['showblankpositional'])
local values = {}
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
table.insert(values, clean(k))
end
elseif type(k) == 'number' and knownargs[tostring(k)] == nil then
local knownflag = false
for _, regexp in ipairs(regexps) do
if mw.ustring.match(tostring(k), regexp) then
knownflag = true
break
end
end
if not knownflag and ( showblankpos or isnotempty(v) ) then
table.insert(values, k .. ' = ' .. clean(v))
end
end
end
-- add results to the output tables
local res = {}
if #values > 0 then
local unknown_text = args['unknown'] or 'Found _VALUE_, '
if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then
local preview_text = args['preview']
if isnotempty(preview_text) then
preview_text = require('Module:If preview')._warning({preview_text})
elseif preview == nil then
preview_text = unknown_text
end
unknown_text = preview_text
end
for _, v in pairs(values) do
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
if v == '' then v = ' ' end
-- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
end
end
return table.concat(res)
end
function p.check(frame)
local args = frame.args
local pargs = frame:getParent().args
return p._check(args, pargs)
end
return p
93db6d115d4328d2a5148bb42959105e367b663e
Module:If empty
828
12
23
22
2024-06-03T23:42:29Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
-- For backwards compatibility reasons, the first 8 parameters can be unset instead of being blank,
-- even though there's really no legitimate use case for this. At some point, this will be removed.
local lowestNil = math.huge
for i = 8,1,-1 do
if args[i] == nil then
args[i] = ''
lowestNil = i
end
end
for k,v in ipairs(args) do
if v ~= '' then
if lowestNil < k then
-- If any uses of this template depend on the behavior above, add them to a tracking category.
-- This is a rather fragile, convoluted, hacky way to do it, but it ensures that this module's output won't be modified
-- by it.
frame:extensionTag('ref', '[[Category:Instances of Template:If_empty missing arguments]]', {group = 'TrackingCategory'})
frame:extensionTag('references', '', {group = 'TrackingCategory'})
end
return v
end
end
end
return p
39b83f8d043283ec767774d927e2f6f3fb3078b4
Module:Infobox
828
13
25
24
2024-06-03T23:42:30Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local function fixChildBoxes(sval, tt)
local function notempty( s ) return s and s:match( '%S' ) end
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- [[Special:Diff/849054481]]
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
else
return sval
end
end
-- Cleans empty tables
local function cleanInfobox()
root = tostring(root)
if has_rows == false then
root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
end
end
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
root
:tag('tr')
:addClass(rowArgs.rowclass)
:cssText(rowArgs.rowstyle)
:tag('th')
:attr('colspan', '2')
:addClass('infobox-header')
:addClass(rowArgs.class)
:addClass(args.headerclass)
-- @deprecated next; target .infobox-<name> .infobox-header
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
if rowArgs.data then
root:wikitext(
'[[Category:Pages which use infobox templates with ignored data cells]]'
)
end
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:cssText(rowArgs.rowstyle)
if rowArgs.label then
row
:tag('th')
:attr('scope', 'row')
:addClass('infobox-label')
-- @deprecated next; target .infobox-<name> .infobox-label
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local dataCell = row:tag('td')
dataCell
:attr('colspan', not rowArgs.label and '2' or nil)
:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
:addClass(rowArgs.class)
-- @deprecated next; target .infobox-<name> .infobox(-full)-data
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
else
table.insert(empty_row_categories, rowArgs.data or '')
end
end
local function renderTitle()
if not args.title then return end
has_rows = true
root
:tag('caption')
:addClass('infobox-title')
:addClass(args.titleclass)
-- @deprecated next; target .infobox-<name> .infobox-title
:cssText(args.titlestyle)
:wikitext(args.title)
end
local function renderAboveRow()
if not args.above then return end
has_rows = true
root
:tag('tr')
:tag('th')
:attr('colspan', '2')
:addClass('infobox-above')
:addClass(args.aboveclass)
-- @deprecated next; target .infobox-<name> .infobox-above
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
local function renderBelowRow()
if not args.below then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-below')
:addClass(args.belowclass)
-- @deprecated next; target .infobox-<name> .infobox-below
:cssText(args.belowstyle)
:wikitext(fixChildBoxes(args.below,'td'))
end
local function addSubheaderRow(subheaderArgs)
if subheaderArgs.data and
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-subheader')
:addClass(subheaderArgs.class)
:cssText(subheaderArgs.datastyle)
:cssText(subheaderArgs.rowcellstyle)
:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
else
table.insert(empty_row_categories, subheaderArgs.data or '')
end
end
local function renderSubheaders()
if args.subheader then
args.subheader1 = args.subheader
end
if args.subheaderrowclass then
args.subheaderrowclass1 = args.subheaderrowclass
end
local subheadernums = getArgNums('subheader')
for k, num in ipairs(subheadernums) do
addSubheaderRow({
data = args['subheader' .. tostring(num)],
-- @deprecated next; target .infobox-<name> .infobox-subheader
datastyle = args.subheaderstyle,
rowcellstyle = args['subheaderstyle' .. tostring(num)],
class = args.subheaderclass,
rowclass = args['subheaderrowclass' .. tostring(num)]
})
end
end
local function addImageRow(imageArgs)
if imageArgs.data and
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
local dataCell = row:tag('td')
dataCell
:attr('colspan', '2')
:addClass('infobox-image')
:addClass(imageArgs.class)
:cssText(imageArgs.datastyle)
:wikitext(fixChildBoxes(imageArgs.data, 'td'))
else
table.insert(empty_row_categories, imageArgs.data or '')
end
end
local function renderImages()
if args.image then
args.image1 = args.image
end
if args.caption then
args.caption1 = args.caption
end
local imagenums = getArgNums('image')
for k, num in ipairs(imagenums) do
local caption = args['caption' .. tostring(num)]
local data = mw.html.create():wikitext(args['image' .. tostring(num)])
if caption then
data
:tag('div')
:addClass('infobox-caption')
-- @deprecated next; target .infobox-<name> .infobox-caption
:cssText(args.captionstyle)
:wikitext(caption)
end
addImageRow({
data = tostring(data),
-- @deprecated next; target .infobox-<name> .infobox-image
datastyle = args.imagestyle,
class = args.imageclass,
rowclass = args['imagerowclass' .. tostring(num)]
})
end
end
-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
if not args.autoheaders then return end
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local lastheader
for k, num in ipairs(rownums) do
if args['header' .. tostring(num)] then
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
lastheader = num
elseif args['data' .. tostring(num)] and
args['data' .. tostring(num)]:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
local data = args['data' .. tostring(num)]
if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
lastheader = nil
end
end
end
if lastheader then
args['header' .. tostring(lastheader)] = nil
end
end
-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
for k, num in ipairs(rownums) do
addRow({
header = args['header' .. tostring(num)],
label = args['label' .. tostring(num)],
data = args['data' .. tostring(num)],
datastyle = args.datastyle,
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
-- @deprecated next; target .infobox-<name> rowclass
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)]
})
end
end
local function renderNavBar()
if not args.name then return end
has_rows = true
root
:tag('tr')
:tag('td')
:attr('colspan', '2')
:addClass('infobox-navbar')
:wikitext(require('Module:Navbar')._navbar{
args.name,
mini = 1,
})
end
local function renderItalicTitle()
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
for _, s in ipairs(empty_row_categories) do
root:wikitext(s)
end
end
-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
if args.decat == 'yes' then return end
if args.child == 'yes' then
if args.title then
root:wikitext(
'[[Category:Pages which use embedded infobox templates with the title parameter]]'
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
end
end
--[=[
Loads the templatestyles for the infobox.
TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
-- See function description
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
}
local templatestyles = ''
if args['templatestyles'] then templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
}
end
local child_templatestyles = ''
if args['child templatestyles'] then child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
end
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
end
return table.concat({
base_templatestyles, -- see function description
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()
renderImages()
preprocessRows()
renderRows()
renderBelowRow()
renderNavBar()
renderItalicTitle()
renderEmptyRowCategories()
renderTrackingCategories()
cleanInfobox()
end
-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
if args.child ~= 'yes' then
root = mw.html.create('table')
root
:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
:addClass(args.bodyclass)
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
renderTitle()
renderAboveRow()
else
root = mw.html.create()
root
:wikitext(args.title)
end
structure_infobox_common()
return loadTemplateStyles() .. root
end
-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
if origArgs[argName] and origArgs[argName] ~= '' then
args[argName] = origArgs[argName]
end
end
-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
if type(prefixTable) ~= 'table' then
error("Non-table value detected for the prefix table", 2)
end
if type(step) ~= 'number' then
error("Invalid step value detected", 2)
end
-- Get arguments without a number suffix, and check for bad input.
for i,v in ipairs(prefixTable) do
if type(v) ~= 'table' or type(v.prefix) ~= "string" or
(v.depend and type(v.depend) ~= 'table') then
error('Invalid input detected to preprocessArgs prefix table', 2)
end
preprocessSingleArg(v.prefix)
-- Only parse the depend parameter if the prefix parameter is present
-- and not blank.
if args[v.prefix] and v.depend then
for j, dependValue in ipairs(v.depend) do
if type(dependValue) ~= 'string' then
error('Invalid "depend" parameter value detected in preprocessArgs')
end
preprocessSingleArg(dependValue)
end
end
end
-- Get arguments with number suffixes.
local a = 1 -- Counter variable.
local moreArgumentsExist = true
while moreArgumentsExist == true do
moreArgumentsExist = false
for i = a, a + step - 1 do
for j,v in ipairs(prefixTable) do
local prefixArgName = v.prefix .. tostring(i)
if origArgs[prefixArgName] then
-- Do another loop if any arguments are found, even blank ones.
moreArgumentsExist = true
preprocessSingleArg(prefixArgName)
end
-- Process the depend table if the prefix argument is present
-- and not blank, or we are processing "prefix1" and "prefix" is
-- present and not blank, and if the depend table is present.
if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
for j,dependValue in ipairs(v.depend) do
local dependArgName = dependValue .. tostring(i)
preprocessSingleArg(dependArgName)
end
end
end
end
a = a + step
end
end
-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()
preprocessSingleArg('autoheaders')
preprocessSingleArg('child')
preprocessSingleArg('bodyclass')
preprocessSingleArg('subbox')
preprocessSingleArg('bodystyle')
preprocessSingleArg('title')
preprocessSingleArg('titleclass')
preprocessSingleArg('titlestyle')
preprocessSingleArg('above')
preprocessSingleArg('aboveclass')
preprocessSingleArg('abovestyle')
preprocessArgs({
{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
}, 10)
preprocessSingleArg('subheaderstyle')
preprocessSingleArg('subheaderclass')
preprocessArgs({
{prefix = 'image', depend = {'caption', 'imagerowclass'}}
}, 10)
preprocessSingleArg('captionstyle')
preprocessSingleArg('imagestyle')
preprocessSingleArg('imageclass')
preprocessArgs({
{prefix = 'header'},
{prefix = 'data', depend = {'label'}},
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'}
}, 50)
preprocessSingleArg('headerclass')
preprocessSingleArg('headerstyle')
preprocessSingleArg('labelstyle')
preprocessSingleArg('datastyle')
preprocessSingleArg('below')
preprocessSingleArg('belowclass')
preprocessSingleArg('belowstyle')
preprocessSingleArg('name')
-- different behaviour for italics if blank or absent
args['italic title'] = origArgs['italic title']
preprocessSingleArg('decat')
preprocessSingleArg('templatestyles')
preprocessSingleArg('child templatestyles')
preprocessSingleArg('grandchild templatestyles')
end
-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
else
origArgs = frame
end
parseDataParameters()
return _infobox()
end
-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
origArgs = {}
for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
parseDataParameters()
return _infobox()
end
return p
c38bb7c8249049bbfd594fa42a9aca6b5b9b8ded
Module:Infobox/styles.css
828
14
27
26
2024-06-03T23:42:30Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
4e60b3cfbf50d1fd637f4a5af11a460a6569e988
Module:InfoboxImage
828
15
29
28
2024-06-03T23:42:31Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- page - page to display for multipage images (DjVu)
-- size - size to display the image
-- maxsize - maximum size for image
-- sizedefault - default size to display the image if size param is blank
-- alt - alt text for image
-- title - title text for image
-- border - set to yes if border
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- link - page to visit when clicking on image
-- Outputs:
-- Formatted image.
-- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg",
"Blue - Replace this image male.svg",
"Female no free image yet.png",
"Flag of None (square).svg",
"Flag of None.svg",
"Flag of.svg",
"Green - Replace this image female.svg",
"Green - Replace this image male.svg",
"Image is needed female.svg",
"Image is needed male.svg",
"Location map of None.svg",
"Male no free image yet.png",
"Missing flag.png",
"No flag.svg",
"No free portrait.svg",
"No portrait (female).svg",
"No portrait (male).svg",
"Red - Replace this image female.svg",
"Red - Replace this image male.svg",
"Replace this image female (blue).svg",
"Replace this image female.svg",
"Replace this image male (blue).svg",
"Replace this image male.svg",
"Silver - Replace this image female.svg",
"Silver - Replace this image male.svg",
"Replace this image.svg",
"Cricket no pic.png",
"CarersLogo.gif",
"Diagram Needed.svg",
"Example.jpg",
"Image placeholder.png",
"No male portrait.svg",
"Nocover-upload.png",
"NoDVDcover copy.png",
"Noribbon.svg",
"No portrait-BFD-test.svg",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
"Sin bandera.svg",
"Sin escudo.svg",
"Replace this image - temple.png",
"Replace this image butterfly.png",
"Replace this image.svg",
"Replace this image1.svg",
"Resolution angle.png",
"Image-No portrait-text-BFD-test.svg",
"Insert image here.svg",
"No image available.png",
"NO IMAGE YET square.png",
"NO IMAGE YET.png",
"No Photo Available.svg",
"No Screenshot.svg",
"No-image-available.jpg",
"Null.png",
"PictureNeeded.gif",
"Place holder.jpg",
"Unbenannt.JPG",
"UploadACopyrightFreeImage.svg",
"UploadAnImage.gif",
"UploadAnImage.svg",
"UploadAnImageShort.svg",
"CarersLogo.gif",
"Diagram Needed.svg",
"No male portrait.svg",
"NoDVDcover copy.png",
"Placeholder barnstar ribbon.png",
"Project Trains no image.png",
"Image-request.png",
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, "_", " ");
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == "[[" then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- capitalise first letter
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do
if image == j then
return true
end
end
return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"];
if image == "" or image == nil then
return "";
end
if image == " " then
return image;
end
if frame.args["suppressplaceholder"] ~= "no" then
if i.IsPlaceholder(image) == true then
return "";
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
return "";
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
return "";
end
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
elseif mw.title.getCurrentTitle().namespace == 0 then
return image .. "[[Category:Pages using deprecated image syntax]]";
else
return image;
end
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
return image;
elseif mw.ustring.sub(image,1,1) == "<" then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = "";
local page = frame.args["page"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center= frame.args["center"];
-- remove prefix if exists
local allNames = mw.site.namespaces[6].aliases
allNames[#allNames + 1] = mw.site.namespaces[6].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= "" and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == "" or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= "" and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
if sizenumber>maxsizenumber and maxsizenumber>0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) > 0 then
size = size .. "px";
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) > 0 then
sizedefault = sizedefault .. "px";
end
result = "[[File:" .. image;
if page ~= "" and page ~= nil then
result = result .. "|page=" .. page;
end
if size ~= "" and size ~= nil then
result = result .. "|" .. size;
elseif sizedefault ~= "" and sizedefault ~= nil then
result = result .. "|" .. sizedefault;
else
result = result .. "|frameless";
end
if center == "yes" then
result = result .. "|center"
end
if alt ~= "" and alt ~= nil then
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
end
if upright == "yes" then
result = result .. "|upright";
elseif upright ~= "" then
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;
elseif alt ~= "" and alt ~= nil then
result = result .. "|" .. alt;
end
result = result .. "]]";
return result;
end
end
return i;
c6018d106ec773313bcbb1e6e5e9af23ebc87680
Module:Plain text
828
16
31
30
2024-06-03T23:42:31Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
local p = {}
function p.main(frame)
local text = frame.args[1]
return p._main(text)
end
function p._main(text)
if not text then return end
text = mw.text.killMarkers(text)
:gsub('<span class="nowrap">(.+)</span>', '%1') --remove nowrap while keeping text inside
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<.->.-<.->', '') --strip out tags
:gsub('%[%[%s*[Ff]ile%s*:.-%]%]', '') --strip out files
:gsub('%[%[%s*[Ii]mage%s*:.-%]%]', '') --strip out use of image:
:gsub('%[%[%s*[Cc]ategory%s*:.-%]%]', '') --strip out categories
:gsub('%[%[[^%]]-|', '') --strip out piped link text
:gsub('[%[%]]', '') --then strip out remaining [ and ]
:gsub("'''''", "") --strip out bold italic markup
:gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes
return text
end
return p
d4669a2e95551ca7393fd4337669aa6038c951b3
Module:String
828
17
33
32
2024-06-03T23:42:32Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} )
local s = new_args['s'] or ''
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The first index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } )
local s = new_args['s'] or ''
local i = tonumber( new_args['i'] ) or 1
local j = tonumber( new_args['j'] ) or -1
local len = mw.ustring.len( s )
-- Convert negatives for range checking
if i < 0 then
i = len + i + 1
end
if j < 0 then
j = len + j + 1
end
if i > len or j > len or i < 1 or j < 1 then
return str._error( 'String subset index out of range' )
end
if j < i then
return str._error( 'String subset indices out of order' )
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
_match
This function returns a substring from the source string that matches a
specified pattern. It is exported for use in other modules
Usage:
strmatch = require("Module:String")._match
sresult = strmatch( s, pattern, start, match, plain, nomatch )
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This sub-routine is exported for use in other modules
function str._match( s, pattern, start, match_index, plain_flag, nomatch )
if s == '' then
return str._error( 'Target string is empty' )
end
if pattern == '' then
return str._error( 'Pattern string is empty' )
end
start = tonumber(start) or 1
if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' )
end
if match_index == 0 then
return str._error( 'Match index is out of range' )
end
if plain_flag then
pattern = str._escapePattern( pattern )
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start > 1 then
s = mw.ustring.sub( s, start )
end
local iterator = mw.ustring.gmatch(s, pattern)
if match_index > 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1
if match_index == 0 then
result = w
break
end
end
else
-- Reverse search
local result_table = {}
local count = 1
for w in iterator do
result_table[count] = w
count = count + 1
end
result = result_table[ count + match_index ]
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' )
else
return nomatch
end
else
return result
end
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|match|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
-- This is the entry point for #invoke:String|match
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} )
local s = new_args['s'] or ''
local start = tonumber( new_args['start'] ) or 1
local plain_flag = str._getBoolean( new_args['plain'] or false )
local pattern = new_args['pattern'] or ''
local match_index = math.floor( tonumber(new_args['match']) or 1 )
local nomatch = new_args['nomatch']
return str._match( s, pattern, start, match_index, plain_flag, nomatch )
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} )
local target_str = new_args['target'] or ''
local pos = tonumber( new_args['pos'] ) or 0
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
return str._error( 'String index out of range' )
end
return mw.ustring.sub( target_str, pos, pos )
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based,
and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a
value of "1", which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} )
local source_str = new_args['source'] or ''
local target_str = new_args['target'] or ''
if target_str == '' then
return 1
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found
within "source". Indices are 1-based. If "target" is not found, then this
function returns 0. If either "source" or "target" are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['target'] or ''
local start_pos = tonumber(new_args['start']) or 1
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return 0
end
plain = str._getBoolean( plain )
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } )
local source_str = new_args['source'] or ''
local pattern = new_args['pattern'] or ''
local replace = new_args['replace'] or ''
local count = tonumber( new_args['count'] )
local plain = new_args['plain'] or true
if source_str == '' or pattern == '' then
return source_str
end
plain = str._getBoolean( plain )
if plain then
pattern = str._escapePattern( pattern )
replace = mw.ustring.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences.
end
local result
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count )
else
result = mw.ustring.gsub( source_str, pattern, replace )
end
return result
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
escapePattern
This function escapes special characters from a Lua string pattern. See [1]
for details on how patterns work.
[1] https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
Usage:
{{#invoke:String|escapePattern|pattern_string}}
Parameters
pattern_string: The pattern string to escape.
]]
function str.escapePattern( frame )
local pattern_str = frame.args[1]
if not pattern_str then
return str._error( 'No pattern string specified' )
end
local result = str._escapePattern( pattern_str )
return result
end
--[[
count
This function counts the number of occurrences of one string in another.
]]
function str.count(frame)
local args = str._getParameters(frame.args, {'source', 'pattern', 'plain'})
local source = args.source or ''
local pattern = args.pattern or ''
local plain = str._getBoolean(args.plain or true)
if plain then
pattern = str._escapePattern(pattern)
end
local _, count = mw.ustring.gsub(source, pattern, '')
return count
end
--[[
endswith
This function determines whether a string ends with another string.
]]
function str.endswith(frame)
local args = str._getParameters(frame.args, {'source', 'pattern'})
local source = args.source or ''
local pattern = args.pattern or ''
if pattern == '' then
-- All strings end with the empty string.
return "yes"
end
if mw.ustring.sub(source, -mw.ustring.len(pattern), -1) == pattern then
return "yes"
else
return ""
end
end
--[[
join
Join all non empty arguments together; the first argument is the separator.
Usage:
{{#invoke:String|join|sep|one|two|three}}
]]
function str.join(frame)
local args = {}
local sep
for _, v in ipairs( frame.args ) do
if sep then
if v ~= '' then
table.insert(args, v)
end
else
sep = v
end
end
return table.concat( args, sep or '' )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {}
local index = 1
local value
for _, arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index]
index = index + 1
end
new_args[arg] = value
end
return new_args
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame()
local error_category = frame.args.error_category or 'Errors reported by Module String'
local ignore_errors = frame.args.ignore_errors or false
local no_category = frame.args.no_category or false
if str._getBoolean(ignore_errors) then
return ''
end
local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str
end
return error_str
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower()
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false
else
boolean_value = true
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str
else
error( 'No boolean value found' )
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" )
end
return str
2ad0905c56ef4955950b75a8f00974fe82aed5e4
Module:Message box
828
18
35
34
2024-06-03T23:42:32Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
require('strict')
local getArgs
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(...)
-- Get the title object, passing the function through pcall
-- in case we are over the expensive function count limit.
local success, title = pcall(mw.title.new, ...)
if success then
return title
end
end
local function union(t1, t2)
-- Returns the union of two arrays.
local vals = {}
for i, v in ipairs(t1) do
vals[v] = true
end
for i, v in ipairs(t2) do
vals[v] = true
end
local ret = {}
for k in pairs(vals) do
table.insert(ret, k)
end
table.sort(ret)
return ret
end
local function getArgNums(args, prefix)
local nums = {}
for k, v in pairs(args) do
local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
if num then
table.insert(nums, tonumber(num))
end
end
table.sort(nums)
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local MessageBox = {}
MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg)
args = args or {}
local obj = {}
-- Set the title object and the namespace.
obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type.
obj.cfg = cfg[boxType]
if not obj.cfg then
local ns = obj.title.namespace
-- boxType is "mbox" or invalid input
if args.demospace and args.demospace ~= '' then
-- implement demospace parameter of mbox
local demospace = string.lower(args.demospace)
if DEMOSPACES[demospace] then
-- use template from DEMOSPACES
obj.cfg = cfg[DEMOSPACES[demospace]]
elseif string.find( demospace, 'talk' ) then
-- demo as a talk page
obj.cfg = cfg.tmbox
else
-- default to ombox
obj.cfg = cfg.ombox
end
elseif ns == 0 then
obj.cfg = cfg.ambox -- main namespace
elseif ns == 6 then
obj.cfg = cfg.imbox -- file namespace
elseif ns == 14 then
obj.cfg = cfg.cmbox -- category namespace
else
local nsTable = mw.site.namespaces[ns]
if nsTable and nsTable.isTalk then
obj.cfg = cfg.tmbox -- any talk namespace
else
obj.cfg = cfg.ombox -- other namespaces or invalid input
end
end
end
-- Set the arguments, and remove all blank arguments except for the ones
-- listed in cfg.allowBlankParams.
do
local newArgs = {}
for k, v in pairs(args) do
if v ~= '' then
newArgs[k] = v
end
end
for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
newArgs[param] = args[param]
end
obj.args = newArgs
end
-- Define internal data structure.
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
return setmetatable(obj, MessageBox)
end
function MessageBox:addCat(ns, cat, sort)
if not cat then
return nil
end
if sort then
cat = string.format('[[Category:%s|%s]]', cat, sort)
else
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
end
function MessageBox:addClass(class)
if not class then
return nil
end
table.insert(self.classes, class)
end
function MessageBox:setParameters()
local args = self.args
local cfg = self.cfg
-- Get type data.
self.type = args.type
local typeData = cfg.types[self.type]
self.invalidTypeError = cfg.showInvalidTypeError
and self.type
and not typeData
typeData = typeData or cfg.types[cfg.default]
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box.
self.isSmall = cfg.allowSmall and (
cfg.smallParam and args.small == cfg.smallParam
or not cfg.smallParam and yesno(args.small)
)
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
end
for _, class in ipairs(cfg.classes or {}) do
self:addClass(class)
end
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
self:addClass(self.typeClass)
self:addClass(args.class)
self.style = args.style
self.attrs = args.attrs
-- Set text style.
self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only
-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
-- and cfg.templateCategoryRequireName are set.
self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
if self.useCollapsibleTextFields
or cfg.templateCategory
and cfg.templateCategoryRequireName
then
if self.name then
local templateName = mw.ustring.match(
self.name,
'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
) or self.name
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
end
self.isTemplatePage = self.templateTitle
and mw.title.equals(self.title, self.templateTitle)
end
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
if self.useCollapsibleTextFields then
-- Get the self.issue value.
if self.isSmall and args.smalltext then
self.issue = args.smalltext
else
local sect
if args.sect == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. args.sect
end
local issue = args.issue
issue = type(issue) == 'string' and issue ~= '' and issue or nil
local text = args.text
text = type(text) == 'string' and text or nil
local issues = {}
table.insert(issues, sect)
table.insert(issues, issue)
table.insert(issues, text)
self.issue = table.concat(issues, ' ')
end
-- Get the self.talk value.
local talk = args.talk
-- Show talk links on the template page or template subpages if the talk
-- parameter is blank.
if talk == ''
and self.templateTitle
and (
mw.title.equals(self.templateTitle, self.title)
or self.title:isSubpageOf(self.templateTitle)
)
then
talk = '#'
elseif talk == '' then
talk = nil
end
if talk then
-- If the talk value is a talk page, make a link to that page. Else
-- assume that it's a section heading, and make a link to the talk
-- page of the current page with that section heading.
local talkTitle = getTitleObject(talk)
local talkArgIsTalkPage = true
if not talkTitle or not talkTitle.isTalkPage then
talkArgIsTalkPage = false
talkTitle = getTitleObject(
self.title.text,
mw.site.namespaces[self.title.namespace].talk.id
)
end
if talkTitle and talkTitle.exists then
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
talkText = 'Relevant discussion may be found on'
if talkArgIsTalkPage then
talkText = string.format(
'%s [[%s|%s]].',
talkText,
talk,
talkTitle.prefixedText
)
else
talkText = string.format(
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
end
-- Get other values.
self.fix = args.fix ~= '' and args.fix or nil
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('F Y')
end
if date then
self.date = string.format(" <span class='date-container'><i>(<span class='date'>%s</span>)</i></span>", date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s%s|alt=]]', self.typeImage
or 'Information icon4.svg', imageSize, self.typeImageNeedsLink and "" or "|link=" )
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
-- set templatestyles
self.base_templatestyles = cfg.templatestyles
self.templatestyles = args.templatestyles
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count > 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums > 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return require('Module:Category handler')._main{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
local frame = mw.getCurrentFrame()
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.base_templatestyles },
})
-- Add support for a single custom templatestyles sheet. Undocumented as
-- need should be limited and many templates using mbox are substed; we
-- don't want to spread templatestyles sheets around to arbitrary places
if self.templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles',
args = { src = self.templatestyles },
})
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style="width: 52px;", which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: "No image. Cell with some width
-- or padding necessary for text cell to have 100% width."
row:tag('td')
:addClass('mbox-empty-cell')
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(" (%s)", self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):addClass('mbox-image-div')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:addClass('mbox-invalid-type')
:wikitext(string.format(
'This message box is using an invalid "type=%s" parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)
f2fb84f7b817d2d88747f57c40902a0d8be8158a
Module:Message box/configuration
828
19
37
36
2024-06-03T23:42:32Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '<small>[[Help:Maintenance template removal|Learn how and when to remove this template message]]</small>',
templatestyles = 'Module:Message box/ambox.css'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true,
templatestyles = 'Module:Message box/cmbox.css'
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false,
templatestyles = 'Module:Message box/fmbox.css'
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox-license.svg'
},
["license-related"] = {
class = 'imbox-license',
image = 'Imbox-license.svg'
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg',
imageNeedsLink = true
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes',
templatestyles = 'Module:Message box/imbox.css'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true,
templatestyles = 'Module:Message box/ombox.css'
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Semi-protection-shackle-keyhole.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
templateCategory = 'Talk message boxes',
templatestyles = 'Module:Message box/tmbox.css'
}
}
ccb6bdf2868087b6833d203307f2f6a92b3b0a01
Module:No globals
828
20
39
38
2024-06-03T23:42:33Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)
8ce3969f7d53b08bd00dabe4cc9780bc6afd412a
Module:Yesno
828
21
41
40
2024-06-03T23:42:33Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or val == 'off'
or tonumber(val) == 0
then
return false
else
return default
end
end
f767643e7d12126d020d88d662a3dd057817b9dc
Template:Infobox settlement/densdisp
10
22
43
42
2024-06-03T23:42:33Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if:
{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#switch:auto
|{{{/km2}}}|{{{/sqmi}}}={{#iferror:{{#expr:-{{formatnum:{{{pop}}}|R}}}}
||{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}
+{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}
+0
>0
|1}}
}}
}}
|1
}}
|1
}}
|{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:100*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{dunam|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:1000*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}/2.589988110336}}}}}}}}
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}/0.004046856422}}}}}}}}
}}}}}}}}
|{{rnd
|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}
|{{max/2
|{{precision|{{formatnum:{{{/sqmi}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/sqmi}}}|R}}/2.589988110336}}}}
}}
}}
}}
|{{{/km2}}}
}}
|metu=km<sup>2</sup>
|impv={{#iferror:{{#expr:-{{formatnum:{{{/sqmi}}}|R}}}}
|{{#iferror:{{#expr:-{{formatnum:{{{/km2}}}|R}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{sqmi|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{sqmi}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{acre|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:640*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{acre}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{km2|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2.589988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{km2}}}|R}}}}}}}}}}
|{{#ifexpr:{{#iferror:{{#expr:{{formatnum:{{{ha|}}}|R}}}}}}+0>0
|{{rnd|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:258.9988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{ha}}}|R}}}}}}}}}}
|{{rnd|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}<!--
-->|{{#expr:1-{{Order of magnitude|{{#expr:2589.988110336*{{formatnum:{{{pop}}}|R}}/{{formatnum:{{{dunam}}}|R}}}}}}}}}}
}}}}}}}}
|{{rnd
|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}
|{{max/2
|{{#expr:{{precision|{{formatnum:{{{/km2}}}|R}}}}-1}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{/km2}}}|R}}*2.589988110336}}}}
}}
}}
}}
|{{{/sqmi}}}
}}
|impu=sq mi
|s=/
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
55905884d3fa7eed2ee5abe53f9d247ac45d5d8e
Module:TableTools
828
23
45
44
2024-06-03T23:42:34Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
------------------------------------------------------------------------------------
-- TableTools --
-- --
-- This module includes a number of functions for dealing with Lua tables. --
-- It is a meta-module, meant to be called from other Lua modules, and should not --
-- be called directly from #invoke. --
------------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local p = {}
-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
function p.isPositiveInteger(v)
return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false if
-- not. Although it doesn't operate on tables, it is included here as it is useful
-- for determining whether a value can be a valid table key. Lua will generate an
-- error if a NaN is used as a table key.
------------------------------------------------------------------------------------
function p.isNan(v)
return type(v) == 'number' and v ~= v
end
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
function p.shallowClone(t)
checkType('shallowClone', 1, t, 'table')
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
function p.removeDuplicates(arr)
checkType('removeDuplicates', 1, arr, 'table')
local isNan = p.isNan
local ret, exists = {}, {}
for _, v in ipairs(arr) do
if isNan(v) then
-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
ret[#ret + 1] = v
else
if not exists[v] then
ret[#ret + 1] = v
exists[v] = true
end
end
end
return ret
end
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
function p.numKeys(t)
checkType('numKeys', 1, t, 'table')
local isPositiveInteger = p.isPositiveInteger
local nums = {}
for k in pairs(t) do
if isPositiveInteger(k) then
nums[#nums + 1] = k
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return
-- {1, 3, 6}.
------------------------------------------------------------------------------------
function p.affixNums(t, prefix, suffix)
checkType('affixNums', 1, t, 'table')
checkType('affixNums', 2, prefix, 'string', true)
checkType('affixNums', 3, suffix, 'string', true)
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
end
prefix = prefix or ''
suffix = suffix or ''
prefix = cleanPattern(prefix)
suffix = cleanPattern(suffix)
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, pattern)
if num then
nums[#nums + 1] = tonumber(num)
end
end
end
table.sort(nums)
return nums
end
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table
-- of subtables in the format
-- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}.
-- Keys that don't end with an integer are stored in a subtable named "other". The
-- compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
function p.numData(t, compress)
checkType('numData', 1, t, 'table')
checkType('numData', 2, compress, 'boolean', true)
local ret = {}
for k, v in pairs(t) do
local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
if num then
num = tonumber(num)
local subtable = ret[num] or {}
if prefix == '' then
-- Positional parameters match the blank string; put them at the start of the subtable instead.
prefix = 1
end
subtable[prefix] = v
ret[num] = subtable
else
local subtable = ret.other or {}
subtable[k] = v
ret.other = subtable
end
end
if compress then
local other = ret.other
ret = p.compressSparseArray(ret)
ret.other = other
end
return ret
end
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
function p.compressSparseArray(t)
checkType('compressSparseArray', 1, t, 'table')
local ret = {}
local nums = p.numKeys(t)
for _, num in ipairs(nums) do
ret[#ret + 1] = t[num]
end
return ret
end
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
function p.sparseIpairs(t)
checkType('sparseIpairs', 1, t, 'table')
local nums = p.numKeys(t)
local i = 0
local lim = #nums
return function ()
i = i + 1
if i <= lim then
local key = nums[i]
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
function p.size(t)
checkType('size', 1, t, 'table')
local i = 0
for _ in pairs(t) do
i = i + 1
end
return i
end
local function defaultKeySort(item1, item2)
-- "number" < "string", so numbers will be sorted before strings.
local type1, type2 = type(item1), type(item2)
if type1 ~= type2 then
return type1 < type2
elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
return tostring(item1) < tostring(item2)
else
return item1 < item2
end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array of the keys in a table, sorted using either a default
-- comparison function or a custom keySort function.
------------------------------------------------------------------------------------
function p.keysToList(t, keySort, checked)
if not checked then
checkType('keysToList', 1, t, 'table')
checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'})
end
local arr = {}
local index = 1
for k in pairs(t) do
arr[index] = k
index = index + 1
end
if keySort ~= false then
keySort = type(keySort) == 'function' and keySort or defaultKeySort
table.sort(arr, keySort)
end
return arr
end
------------------------------------------------------------------------------------
-- sortedPairs
--
-- Iterates through a table, with the keys sorted using the keysToList function.
-- If there are only numerical keys, sparseIpairs is probably more efficient.
------------------------------------------------------------------------------------
function p.sortedPairs(t, keySort)
checkType('sortedPairs', 1, t, 'table')
checkType('sortedPairs', 2, keySort, 'function', true)
local arr = p.keysToList(t, keySort, true)
local i = 0
return function ()
i = i + 1
local key = arr[i]
if key ~= nil then
return key, t[key]
else
return nil, nil
end
end
end
------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
if type(v) ~= 'table' then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
if not pcall(pairs, v) then
return false
end
local i = 0
for _ in pairs(v) do
i = i + 1
if v[i] == nil then
return false
end
end
return true
end
------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
checkType("invert", 1, arr, "table")
local isNan = p.isNan
local map = {}
for i, v in ipairs(arr) do
if not isNan(v) then
map[v] = i
end
end
return map
end
------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
checkType("listToSet", 1, arr, "table")
local isNan = p.isNan
local set = {}
for _, v in ipairs(arr) do
if not isNan(v) then
set[v] = true
end
end
return set
end
------------------------------------------------------------------------------------
-- deepCopy
--
-- Recursive deep copy function. Preserves identities of subtables.
------------------------------------------------------------------------------------
local function _deepCopy(orig, includeMetatable, already_seen)
-- Stores copies of tables indexed by the original table.
already_seen = already_seen or {}
local copy = already_seen[orig]
if copy ~= nil then
return copy
end
if type(orig) == 'table' then
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen)
end
already_seen[orig] = copy
if includeMetatable then
local mt = getmetatable(orig)
if mt ~= nil then
local mt_copy = _deepCopy(mt, includeMetatable, already_seen)
setmetatable(copy, mt_copy)
already_seen[mt] = mt_copy
end
end
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function p.deepCopy(orig, noMetatable, already_seen)
checkType("deepCopy", 3, already_seen, "table", true)
return _deepCopy(orig, not noMetatable, already_seen)
end
------------------------------------------------------------------------------------
-- sparseConcat
--
-- Concatenates all values in the table that are indexed by a number, in order.
-- sparseConcat{a, nil, c, d} => "acd"
-- sparseConcat{nil, b, c, d} => "bcd"
------------------------------------------------------------------------------------
function p.sparseConcat(t, sep, i, j)
local arr = {}
local arr_i = 0
for _, v in p.sparseIpairs(t) do
arr_i = arr_i + 1
arr[arr_i] = v
end
return table.concat(arr, sep, i, j)
end
------------------------------------------------------------------------------------
-- length
--
-- Finds the length of an array, or of a quasi-array with keys such as "data1",
-- "data2", etc., using an exponential search algorithm. It is similar to the
-- operator #, but may return a different value when there are gaps in the array
-- portion of the table. Intended to be used on data loaded with mw.loadData. For
-- other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of the number
-- of unnamed template parameters, so use this function for frame.args.
------------------------------------------------------------------------------------
function p.length(t, prefix)
-- requiring module inline so that [[Module:Exponential search]] which is
-- only needed by this one function doesn't get millions of transclusions
local expSearch = require("Module:Exponential search")
checkType('length', 1, t, 'table')
checkType('length', 2, prefix, 'string', true)
return expSearch(function (i)
local key
if prefix then
key = prefix .. tostring(i)
else
key = i
end
return t[key] ~= nil
end) or 0
end
------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
-- if valueToFind is nil, error?
for _, v in ipairs(arr) do
if v == valueToFind then
return true
end
end
return false
end
return p
085e7094ac84eb0132ee65822cf3f69cd8ba3d81
Template:Infobox settlement/columns
10
24
47
46
2024-06-03T23:42:34Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<table style="width:100%; background:none;">
<tr>{{#if:{{{0|}}}
|<!-- if 0
-->{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}
|<!-- if 0 and (1 or 2 or 3 or 4 or 5)
--><td><table style="width:100%; background:none;">
{{#if:{{{1|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{1|}}}</td></tr>
}}{{#if:{{{2|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{2|}}}</td></tr>
}}{{#if:{{{3|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{3|}}}</td></tr>
}}{{#if:{{{4|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{4|}}}</td></tr>
}}{{#if:{{{5|}}}
|<tr><td style="vertical-align:middle; text-align:center;">{{{5|}}}</td></tr>
}}</table></td>
}}<td style="vertical-align:top;text-align:center;">{{{0|}}}</td>
|<!-- if not 0
-->{{#ifexpr:({{#if:{{{1|}}}|1|0}}+{{#if:{{{2|}}}|1|0}}+{{#if:{{{3|}}}|1|0}}+{{#if:{{{4|}}}|1|0}}) > 2
|<!-- if more than two images
-->{{#if:{{{1|}}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{2|}}}||colspan=2}}>{{{1|}}}</td>
}}{{#if:{{{2|}}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{1|}}}||colspan=2}}>{{{2|}}}</td>
}}</tr><tr>{{#if:{{{3|}}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{4|}}}||colspan=2}}>{{{3|}}}</td>
}}{{#if:{{{4| }}}
|<td style="vertical-align:middle; text-align:center;" {{#if:{{{3|}}}||colspan=2}}>{{{4|}}}</td>
}}
|<!-- if two or fewer images
-->{{#if:{{{1|}}}
|<td style="vertical-align:middle; text-align:center;">{{{1|}}}</td>
}}{{#if:{{{2|}}}
|<td style="vertical-align:middle; text-align:center;">{{{2|}}}</td>
}}{{#if:{{{3|}}}
|<td style="vertical-align:middle; text-align:center;">{{{3|}}}</td>
}}{{#if:{{{4| }}}
|<td style="vertical-align:middle; text-align:center;">{{{4|}}}</td>
}}
}}
}}</tr></table><noinclude>
{{documentation}}
</noinclude>
aa35855300d9811f7770a1acf10c4ce658f84986
Template:Infobox settlement/link
10
25
49
48
2024-06-03T23:42:35Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#if:{{{link|}}}<!--
-->|[[{{{link}}}|{{{type}}}]]<!--
-->|{{#ifexist:{{{type}}} of {{PAGENAME}}<!--
-->|[[{{{type}}} of {{PAGENAME}}|{{{type|}}}]]<!--
-->|{{#if:{{{name|}}}<!--
-->|{{#ifexist:{{{type}}} of {{{name}}}<!--
-->|[[{{{type}}} of {{{name}}}|{{{type|}}}]]<!--
-->|{{{type}}}<!--
-->}}<!--
-->|{{{type}}}<!--
-->}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
7f1193f6be51d8bf296df176cd7c49b5d819202e
Module:List
828
26
51
50
2024-06-03T23:42:35Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local libUtil = require('libraryUtil')
local checkType = libUtil.checkType
local mTableTools = require('Module:TableTools')
local p = {}
local listTypes = {
['bulleted'] = true,
['unbulleted'] = true,
['horizontal'] = true,
['ordered'] = true,
['horizontal_ordered'] = true
}
function p.makeListData(listType, args)
-- Constructs a data table to be passed to p.renderList.
local data = {}
-- Classes and TemplateStyles
data.classes = {}
data.templatestyles = ''
if listType == 'horizontal' or listType == 'horizontal_ordered' then
table.insert(data.classes, 'hlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Hlist/styles.css' }
}
elseif listType == 'unbulleted' then
table.insert(data.classes, 'plainlist')
data.templatestyles = mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
}
end
table.insert(data.classes, args.class)
-- Main div style
data.style = args.style
-- Indent for horizontal lists
if listType == 'horizontal' or listType == 'horizontal_ordered' then
local indent = tonumber(args.indent)
indent = indent and indent * 1.6 or 0
if indent > 0 then
data.marginLeft = indent .. 'em'
end
end
-- List style types for ordered lists
-- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
-- type is either set by the "type" attribute or the "list-style-type" CSS
-- property.
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listStyleType = args.list_style_type or args['list-style-type']
data.type = args['type']
-- Detect invalid type attributes and attempt to convert them to
-- list-style-type CSS properties.
if data.type
and not data.listStyleType
and not tostring(data.type):find('^%s*[1AaIi]%s*$')
then
data.listStyleType = data.type
data.type = nil
end
end
-- List tag type
if listType == 'ordered' or listType == 'horizontal_ordered' then
data.listTag = 'ol'
else
data.listTag = 'ul'
end
-- Start number for ordered lists
data.start = args.start
if listType == 'horizontal_ordered' then
-- Apply fix to get start numbers working with horizontal ordered lists.
local startNum = tonumber(data.start)
if startNum then
data.counterReset = 'listitem ' .. tostring(startNum - 1)
end
end
-- List style
-- ul_style and ol_style are included for backwards compatibility. No
-- distinction is made for ordered or unordered lists.
data.listStyle = args.list_style
-- List items
-- li_style is included for backwards compatibility. item_style was included
-- to be easier to understand for non-coders.
data.itemStyle = args.item_style or args.li_style
data.items = {}
for _, num in ipairs(mTableTools.numKeys(args)) do
local item = {}
item.content = args[num]
item.style = args['item' .. tostring(num) .. '_style']
or args['item_style' .. tostring(num)]
item.value = args['item' .. tostring(num) .. '_value']
or args['item_value' .. tostring(num)]
table.insert(data.items, item)
end
return data
end
function p.renderList(data)
-- Renders the list HTML.
-- Return the blank string if there are no list items.
if type(data.items) ~= 'table' or #data.items < 1 then
return ''
end
-- Render the main div tag.
local root = mw.html.create('div')
for _, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{['margin-left'] = data.marginLeft}
if data.style then
root:cssText(data.style)
end
-- Render the list tag.
local list = root:tag(data.listTag or 'ul')
list
:attr{start = data.start, type = data.type}
:css{
['counter-reset'] = data.counterReset,
['list-style-type'] = data.listStyleType
}
if data.listStyle then
list:cssText(data.listStyle)
end
-- Render the list items
for _, t in ipairs(data.items or {}) do
local item = list:tag('li')
if data.itemStyle then
item:cssText(data.itemStyle)
end
if t.style then
item:cssText(t.style)
end
item
:attr{value = t.value}
:wikitext(t.content)
end
return data.templatestyles .. tostring(root)
end
function p.renderTrackingCategories(args)
local isDeprecated = false -- Tracks deprecated parameters.
for k, v in pairs(args) do
k = tostring(k)
if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
isDeprecated = true
break
end
end
local ret = ''
if isDeprecated then
ret = ret .. '[[Category:List templates with deprecated parameters]]'
end
return ret
end
function p.makeList(listType, args)
if not listType or not listTypes[listType] then
error(string.format(
"bad argument #1 to 'makeList' ('%s' is not a valid list type)",
tostring(listType)
), 2)
end
checkType('makeList', 2, args, 'table')
local data = p.makeListData(listType, args)
local list = p.renderList(data)
local trackingCategories = p.renderTrackingCategories(args)
return list .. trackingCategories
end
for listType in pairs(listTypes) do
p[listType] = function (frame)
local mArguments = require('Module:Arguments')
local origArgs = mArguments.getArgs(frame, {
valueFunc = function (key, value)
if not value or not mw.ustring.find(value, '%S') then return nil end
if mw.ustring.find(value, '^%s*[%*#;:]') then
return value
else
return value:match('^%s*(.-)%s*$')
end
return nil
end
})
-- Copy all the arguments to a new table, for faster indexing.
local args = {}
for k, v in pairs(origArgs) do
args[k] = v
end
return p.makeList(listType, args)
end
end
return p
7a4f36a6e9cd56370bdd8207d23694124821dc1a
Template:Documentation
10
27
53
52
2024-06-03T23:42:35Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
<!-- Add categories to the /doc subpage -->
</noinclude>
9e62b964e96c4e3d478edecbfcb3c0338ae8a276
Template:Para
10
28
55
54
2024-06-03T23:42:36Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<code class="nowrap" style="{{SAFESUBST:<noinclude />#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:<noinclude />#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:<noinclude />#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:<noinclude />#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:<noinclude />#if:{{{style|}}}|{{{style}}}}}">|{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}=}}{{{2|}}}</code><noinclude>
{{Documentation}}
<!--Categories and interwikis go near the bottom of the /doc subpage.-->
</noinclude>
96ef5dce1fb3a5c1b6648eac125a2496944a852e
Template:Category link with count
10
32
63
62
2024-06-03T23:42:39Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
[[:Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|Category:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}}}<!--
-->]] ({{PAGESINCATEGORY:{{#invoke:string|replace|1={{{1}}}|2=^:?[Cc]ategory:|3=|plain=false}}|{{{2|all}}}}})<noinclude>
{{Documentation}}
</noinclude>
f93f1540b8c157703bd6d24ae35c35bef745981d
Template:Cite GNIS
10
33
65
64
2024-06-03T23:42:39Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Cite gnis]]
2430ade6b59e4826ea72a59e01c3bf35f25af65c
Template:Cite gnis
10
34
67
66
2024-06-03T23:42:39Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#if: {{{1|{{{id|}}}}}}
| {{#if: {{{2|{{{title|{{{name|}}}}}}}}}
| {{cite web
| url = https://geonames.usgs.gov/apex/f?p=gnispq:{{#ifeq: {{{type|}}}|antarid
| 5:::NO::P5_ANTAR_ID:
| 3:::NO::P3_FID:
}}{{urlencode:{{{1|{{{id}}}}}}}}
| title = {{{2|{{{title|{{{name}}}}}}}}}
| access-date = {{{3|{{{access-date|{{{accessdate|}}}}}}}}}
| date = {{{4|{{{date|{{{entry-date|{{{entrydate|}}}}}}}}}}}}
| website = {{#ifeq:{{{links|}}}|off
| Geographic Names Information System
| [[Geographic Names Information System]]}}
| publisher = {{#ifeq:{{{links|}}}|off
| United States Geological Survey
| [[United States Geological Survey]]}}
| ref = {{{ref|}}}
}}
| {{citation error|no {{para|name}} specified|cite gnis|nocat={{{template doc demo|{{{template-doc-demo|}}}}}}}}
}}
| {{citation error|no {{para|id}} specified|cite gnis|nocat={{{template doc demo|{{{template-doc-demo|}}}}}}}}
}}<noinclude>
{{Documentation}}
<!--
PLEASE ADD CATEGORIES TO THE /doc SUBPAGE AND INTERWIKIS TO WIKIDATA
-->
</noinclude>
b02693793d560c0207367b0586788b657824aa04
Template:Cite web
10
35
69
68
2024-06-03T23:42:40Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:citation/CS1|citation
|CitationClass=web
}}</includeonly><noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Cite web}}
</noinclude>
3346631c4b8024c3a949b31545107af19adc1c27
Template:Clc
10
36
71
70
2024-06-03T23:42:40Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Category link with count]]
02280e2ab57b544236e11f913e3759c5781ca9d5
Template:Clear
10
37
73
72
2024-06-03T23:42:40Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div style="clear:{{{1|both}}};"></div><noinclude>
{{documentation}}
</noinclude>
38bab3e3d7fbd3d6800d46556e60bc6bac494d72
Template:Collapse bottom
10
38
75
74
2024-06-03T23:42:41Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
|}</div><noinclude>
{{Documentation|Template:Collapse top/doc}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
{{En-WP attribution notice|Template:Collapse bottom}}
</noinclude>
53b7e30fc0b9f5344fc33db4ab59f5392f62e066
Template:Collapse top
10
39
77
76
2024-06-03T23:42:41Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div style="margin-left:{{{indent|0}}}"><!-- NOTE: width renders incorrectly if added to main STYLE section -->
{| <!-- Template:Collapse top --> class="mw-collapsible {{{{{|safesubst:}}}#if:{{{expand|{{{collapse|}}}}}}||mw-collapsed}} {{{class|}}}" style="background: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|Silver}}}; margin: 0.2em auto auto; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|100%}}; clear: {{{clear|both}}}; padding: 1px;"
|-
! style="background: {{{bg|#{{main other|F0F2F5|CCFFCC}}}}}; font-size:87%; padding:0.2em 0.3em; text-align:{{{{{|safesubst:}}}#if:{{{left|}}}|left|center}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <span style="font-size:115%">{{{1|{{{title|{{{reason|{{{header|{{{heading|{{{result|Extended content}}}}}}}}}}}}}}}}}}</span>
{{{{{|safesubst:}}}#if:{{{warning|{{{2|}}}}}}
|{{{{{|safesubst:}}}!}}-
{{{{{|safesubst:}}}!}} style="text-align:center; font-style:italic;" {{{{{|safesubst:}}}!}} {{{2|The following is a closed debate. {{strongbad|Please do not modify it.}} }}} }}
|-
| style="border: solid {{{border2|1px Silver}}}; padding: {{{padding|0.6em}}}; background: {{{bg2|White}}};" {{{{{|safesubst:}}}!}}<noinclude>
{{lorem ipsum|3}}
{{Collapse bottom}}
{{Documentation}}
{{Collapse top/TemplateData}}
</noinclude>
934c00f78c565a81bd071ae325883eac671acc3a
Template:Collapsible list
10
40
79
78
2024-06-03T23:42:41Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:collapsible list|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
aff61df28bcc6c3457d6aa36ada4fffe68c409a9
Template:Coord
10
41
81
80
2024-06-03T23:42:42Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Coordinates|coord}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using coordinates template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Coord]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9| display | format | name | nosave | notes }}<noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Coord}}
</noinclude>
b7ab6e2054a4498d7858016fc1428b1c450b6e09
Template:Country abbreviation
10
42
83
82
2024-06-03T23:42:42Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{safesubst:#invoke:Country extract|main|{{{1|}}}|{{{2|}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
3045ff36600fb6e40b07a642240a09b7745a03b0
Template:Country data Michigan
10
43
85
84
2024-06-03T23:42:42Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Michigan
| flag alias = Flag of Michigan.svg
| flag alias-1836 = Flag of the United States (1836-1837).svg
| flag alias-1837 = Flag of the United States (1837-1845).svg
| flag alias-1845 = Flag of the United States (1845-1846).svg
| flag alias-1846 = Flag of the United States (1846-1847).svg
| flag alias-1847 = Flag of the United States (1847-1848).svg
| flag alias-1848 = Flag of the United States (1848-1851).svg
| flag alias-1851 = Flag of the United States (1851-1858).svg
| flag alias-1858 = Flag of the United States (1858-1859).svg
| flag alias-1859 = Flag of the United States (1859-1861).svg
| flag alias-1861 = Flag of the United States (1861-1863).svg
| flag alias-1863 = Flag of the United States (1863-1865).svg
| flag alias-1865 = Flag of the United States (1865-1867).svg
| flag alias-1867 = Flag of the United States (1867-1877).svg
| flag alias-1877 = Flag of the United States (1877-1890).svg
| flag alias-1890 = Flag of the United States (1890-1891).svg
| flag alias-1891 = Flag of the United States (1891-1896).svg
| flag alias-1896 = Flag of the United States (1896-1908).svg
| flag alias-1908 = Flag of the United States (1908-1912).svg
| flag alias-naval =Flag of the United States.svg
| link alias-army = Michigan Army National Guard
| link alias-air force = Michigan Air National Guard
| link alias-military = Michigan National Guard
| link alias-naval = Michigan Naval Militia
| link alias-navy = Michigan Naval Militia
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1836
| var2 = 1837
| var3 = 1845
| var4 = 1846
| var5 = 1847
| var6 = 1848
| var7 = 1851
| var8 = 1858
| var9 = 1859
| var10 = 1861
| var11 = 1863
| var12 = 1865
| var13 = 1867
| var14 = 1877
| var15 = 1890
| var16 = 1891
| var17 = 1896
| var18 = 1908
</noinclude>
}}
c62d38555019bd89598bf3768af16c88a0ae8f55
Template:Documentation subpage
10
44
87
86
2024-06-03T23:42:43Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><!--
-->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--
-->{{#ifeq:{{{doc-notice|show}}} |show
| {{Mbox
| type = notice
| style = margin-bottom:1.0em;
| image = [[File:Edit-copy green.svg|40px|alt=|link=]]
| text =
{{strong|This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]]}} for {{terminate sentence|{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}}}<br />It may contain usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
}}
}}<!--
-->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
-->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
| <includeonly><!--
-->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}<!--
--></includeonly>
}}<!--
(completing initial #ifeq: at start of template:)
--><includeonly>
| <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
}}<!--
--></includeonly><noinclude>{{Documentation}}</noinclude>
41ca90af0945442788a2dbd08c8c54a61a23c057
Template:FIPS
10
45
89
88
2024-06-03T23:42:43Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
[{{#if:{{{county|}}}{{{3|}}}
|https://factfinder.census.gov/bkmk/table/1.0/en/DEC/10_DP/DPDP1/0600000US{{{state|{{{1}}}}}}{{{county|{{{3}}}}}}{{{place|{{{2}}}}}}
|https://factfinder.census.gov/bkmk/table/1.0/en/DEC/10_DP/DPDP1/1600000US{{{state|{{{1}}}}}}{{{place|{{{2}}}}}}
}} {{{state|{{{1}}}}}}-{{{place|{{{2}}}}}}]<noinclude>
{{Documentation}}
</noinclude>
3d6f50bb4e286e395c7400c3d43bb89b055665e6
Template:Flag
10
46
91
90
2024-06-03T23:42:43Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{country data {{{1|}}}|flag/core|name={{{name|{{{1|}}}}}}|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude>{{documentation}}{{En-WP attribution notice|Template:Flag}}</noinclude>
a8b9f59a7a7b787931b414e617f8dc54670afc59
Template:Flag/core
10
47
93
92
2024-06-03T23:42:44Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{#if:{{{size|}}}|{{{size}}}|23x15px}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt=|link=]] {{#ifeq:{{{size}}}|23x16px| }}{{#ifeq:{{{alias}}}|Nepal| }}</span>[[{{{alias}}}|{{{name}}}]]<noinclude>{{documentation}}</noinclude>
c8210dc8b9b4298a5c5ed98d56ddb436db5e7688
Template:Flatlist/microformat
10
48
95
94
2024-06-03T23:42:44Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div class="hlist">{{{1}}}</div><noinclude>
{{documentation|content=A separate version of the flatlist template for use on the microformat documentation pages.}}
</noinclude>
f7b5a73d06bd6038b6f09a4b9317e4b8f77165be
Template:GNIS4
10
49
97
96
2024-06-03T23:42:44Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:GNIS 4]]
{{Rcat shell|{{R from template shortcut}}{{R from spacing}}}}
a79ef13aca2c01823ef938ddff5cd4e39cc695af
Template:GNIS 4
10
50
99
98
2024-06-03T23:42:45Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
[https://geonames.usgs.gov/apex/f?p=gnispq:{{#ifeq:{{{type}}}|antarid|5:::NO::P5_ANTAR_ID:|3:::NO::P3_FID:}}{{#if:1| {{{1| {{{id}}} }}} }} {{{1|{{{id}}}}}}]<noinclude>
{{Documentation}}
</noinclude>
ef2bc358d0a7a3de878ecf5e4ad318f252b9eaab
Template:Infobox settlement/areadisp
10
51
101
100
2024-06-03T23:42:45Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}|area}}{{#if:{{{mag|}}}|/mag}}
|metv={{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}|{{{ha}}}|{{{km2}}}}}
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3
|{{rnd<!-- convert dunams to hectares -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/10}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+1)
}}<!-- end rnd -->
|{{rnd<!-- convert dunams to square kilometres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/1E3}}
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
}}<!-- end rnd -->
}}<!-- end #ifexpr:...{{{dunam}}}...<1E3 -->
|{{#if:{{{acre|}}}
|{{rnd<!-- convert acres to hectares -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}
|{{max/2<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{acre}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*0.4046856422}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
|{{rnd<!-- convert square miles to square kilometres -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2.589988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #if:{{{acre|}}} -->
}}<!-- end #if:{{{dunam|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
|metu={{#if:{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#if:{{{dunam|}}}
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<1E3|X}}
|{{{acre|}}}
}}
}}
|ha
|km<sup>2</sup>
}}
|impv={{#if:{{{acre|}}}{{{sqmi|}}}
|{{#if:{{{acre|}}}|{{{acre}}}|{{{sqmi}}}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{ha|}}}
|{{rnd<!-- convert hectares to acres -->
|{{#expr:{{formatnum:{{{ha}}}|R}}/0.4046856422}}
|({{precision|{{formatnum:{{{ha}}}|R}}}})
}}<!-- end rnd -->
|{{rnd<!-- convert square kilometres to square miles -->
|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}
|{{max/2<!-- output at least one sig fig -->
|{{precision|{{formatnum:{{{km2}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km2}}}|R}}/2.589988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #if:{{{ha|}}} -->
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589
|{{rnd<!-- convert dunams to acres -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}})
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/4.046856422}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
|{{rnd<!-- convert dunams to square miles -->
|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{dunam}}}|R}}}}+3)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{dunam}}}|R}}/2589.988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #ifexpr:...{{{dunam}}}...<2589 -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}<!-- end #if:{{{acre|}}}{{{sqmi|}}} -->
|impu={{#if:{{{acre|}}}{{#if:{{{sqmi|}}}
|
|{{{ha|}}}{{#if:{{{km2|}}}
|
|{{#ifexpr:{{formatnum:{{{dunam}}}|R}}<2589|X}}
}}
}}
|acre
|sq mi
}}
|dunv={{#if:{{#ifeq:{{lc:{{{pref}}}}}|dunam|{{{dunam|}}}|no dunams}}
|{{{dunam}}}
|{{#if:{{{ha|}}}{{{km2|}}}
|{{#if:{{{km2|}}}
|{{rnd<!-- convert square kilometres to dunams -->
|{{#expr:{{formatnum:{{{km2}}}|R}}*1E3}}
|({{precision|{{formatnum:{{{km2}}}|R}}}}-3)
}}<!-- end rnd -->
|{{rnd<!-- convert hectares to dunams -->
|{{#expr:{{formatnum:{{{ha}}}|R}}*10}}
|({{precision|{{formatnum:{{{ha}}}|R}}}}-1)
}}<!-- end rnd -->
}}<!-- end #if:{{{km2|}}} -->
|{{#if:{{{sqmi|}}}
|{{rnd<!-- convert square miles to dunams -->
|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{sqmi}}}|R}}}}-4)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{sqmi}}}|R}}*2589.988110336}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
|{{rnd<!-- convert acres to dunams -->
|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}
|{{max/2<!-- output at least one sig fig -->
|({{precision|{{formatnum:{{{acre}}}|R}}}}-1)
|-{{Order of magnitude|{{#expr:{{formatnum:{{{acre}}}|R}}*4.046856422}}}}
}}<!-- end max2 -->
}}<!-- end rnd -->
}}<!-- end #if:{{{sqmi|}}} -->
}}<!-- end #if:{{{ha|}}}{{{km2|}}} -->
}}
|dunu={{#if:{{{link|}}}|[[dunam]]|dunam}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
095178e0174d43b6499f5a497f99abb7e1214f6c
Template:Infobox settlement/doc
10
52
103
102
2024-06-03T23:42:48Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
{{Intricate template}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters}}
{{Uses Wikidata|P625}}
This template is aliased or used as a sub-template for several infobox front-end templates. It should be used to produce an [[WP:Infobox|Infobox]] for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, et cetera—in fact, any subdivision below the level of a country, for which {{tl|Infobox country}} should be used. Parameters are described in the table below. For questions, see the [[Template talk:Infobox settlement|talk page]]. For a U.S. city guideline, see [[WP:USCITIES]].
==Usage==
* '''Important''': Please enter all numeric values in a raw, unformatted fashion. References are to be included in their respective section footnotes field. Numeric values that are not "raw" may create an "Expression error". Raw values will be automatically formatted by the template. If you find a raw value is not formatted in your usage of the template, please post a notice on the discussion page for this template.
* An expression error may also occur when any coordinate parameter has a value, but one or more coordinate parameters are blank or invalid.
Basic blank template, ready to cut and paste. See the next section for a copy of the template with all parameters and comments. See the table below that for a full description of each parameter.
===Using metric units===
<pre style="overflow:auto">
{{Infobox settlement
| name =
| native_name =
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| settlement_type =
| image_skyline =
| image_alt =
| image_caption =
| image_flag =
| flag_alt =
| image_seal =
| seal_alt =
| image_shield =
| shield_alt =
| etymology =
| nickname =
| motto =
| image_map =
| map_alt =
| map_caption =
| pushpin_map =
| pushpin_label_position =
| pushpin_map_alt =
| pushpin_map_caption =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint =
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name =
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 =
| subdivision_type3 =
| subdivision_name3 =
| established_title =
| established_date =
| founder =
| seat_type =
| seat =
| government_footnotes =
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name =
| leader_title1 =
| leader_name1 =
| leader_title2 =
| leader_name2 =
| leader_title3 =
| leader_name3 =
| leader_title4 =
| leader_name4 =
| legislature =
| upper_house =
| lower_house =
| unit_pref = Metric
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
| area_footnotes =
| area_urban_footnotes = <!-- <ref> </ref> -->
| area_rural_footnotes = <!-- <ref> </ref> -->
| area_metro_footnotes = <!-- <ref> </ref> -->
| area_magnitude = <!-- <ref> </ref> -->
| area_note =
| area_water_percent =
| area_rank =
| area_blank1_title =
| area_blank2_title =
<!-- square kilometers -->
| area_total_km2 =
| area_land_km2 =
| area_water_km2 =
| area_urban_km2 =
| area_rural_km2 =
| area_metro_km2 =
| area_blank1_km2 =
| area_blank2_km2 =
<!-- hectares -->
| area_total_ha =
| area_land_ha =
| area_water_ha =
| area_urban_ha =
| area_rural_ha =
| area_metro_ha =
| area_blank1_ha =
| area_blank2_ha =
| length_km =
| width_km =
| dimensions_footnotes =
| elevation_footnotes =
| elevation_m =
| population_as_of =
| population_footnotes =
| population_total =
| population_density_km2 = auto
| population_note =
| population_demonym =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| postal_code_type =
| postal_code =
| area_code_type =
| area_code =
| iso_code =
| website = <!-- {{URL|example.com}} -->
| footnotes =
}}
</pre>
===Using non-metric units===
<pre style="overflow:auto">
{{Infobox settlement
| name =
| native_name =
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| settlement_type =
| image_skyline =
| image_alt =
| image_caption =
| image_flag =
| flag_alt =
| image_seal =
| seal_alt =
| image_shield =
| shield_alt =
| etymology =
| nickname =
| motto =
| image_map =
| map_alt =
| map_caption =
| pushpin_map =
| pushpin_label_position =
| pushpin_map_alt =
| pushpin_map_caption =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint =
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name =
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 =
| subdivision_type3 =
| subdivision_name3 =
| established_title =
| established_date =
| founder =
| seat_type =
| seat =
| government_footnotes =
| leader_party =
| leader_title =
| leader_name =
| unit_pref = US<!-- or UK -->
<!-- ALL fields with measurements have automatic unit conversion -->
<!-- for references: use <ref> tags -->
| area_footnotes =
| area_urban_footnotes = <!-- <ref> </ref> -->
| area_rural_footnotes = <!-- <ref> </ref> -->
| area_metro_footnotes = <!-- <ref> </ref> -->
| area_magnitude = <!-- use only to set a special wikilink -->
| area_note =
| area_water_percent =
| area_rank =
| area_blank1_title =
| area_blank2_title =
<!-- square miles -->
| area_total_sq_mi =
| area_land_sq_mi =
| area_water_sq_mi =
| area_urban_sq_mi =
| area_rural_sq_mi =
| area_metro_sq_mi =
| area_blank1_sq_mi =
| area_blank2_sq_mi =
<!-- acres -->
| area_total_acre =
| area_land_acre =
| area_water_acre =
| area_urban_acre =
| area_rural_acre =
| area_metro_acre =
| area_blank1_acre =
| area_blank2_acre =
| length_mi =
| width_mi =
| dimensions_footnotes =
| elevation_footnotes =
| elevation_ft =
| population_as_of =
| population_footnotes =
| population_total =
| population_density_sq_mi= auto
| population_note =
| population_demonym =
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| postal_code_type =
| postal_code =
| area_code_type =
| area_code =
| iso_code =
| website = <!-- {{URL|example.com}} -->
| footnotes =
}}
</pre>
===Short version===
<pre style="overflow:auto">
{{Infobox settlement
| name =
| native_name =
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| settlement_type =
| image_skyline =
| image_alt =
| image_caption =
| etymology =
| nickname =
| coordinates = <!-- {{Coord}} -->
| population_total =
| subdivision_type = Country
| subdivision_name =
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 =
| website = <!-- {{URL|example.com}} -->
}}
</pre>
===Complete empty syntax, with comments===
This copy of the template lists all parameters except for some of the repeating numbered parameters which are noted in the comments. Comments here should be brief; see the table below for full descriptions of each parameter.
<pre style="overflow:auto;">
{{Infobox settlement
| name = <!-- at least one of the first two fields must be filled in -->
| official_name =
| native_name = <!-- if different from the English name -->
| native_name_lang = <!-- ISO 639-2 code e.g. "fr" for French. If more than one, use {{lang}} instead -->
| other_name =
| settlement_type = <!-- such as Town, Village, City, Borough etc. -->
<!-- transliteration(s) -->
| translit_lang1 =
| translit_lang1_type =
| translit_lang1_info =
| translit_lang1_type1 =
| translit_lang1_info1 =
| translit_lang1_type2 =
| translit_lang1_info2 = <!-- etc., up to translit_lang1_type6 / translit_lang1_info6 -->
| translit_lang2 =
| translit_lang2_type =
| translit_lang2_info =
| translit_lang2_type1 =
| translit_lang2_info1 =
| translit_lang2_type2 =
| translit_lang2_info2 = <!-- etc., up to translit_lang2_type6 / translit_lang2_info6 -->
<!-- images, nickname, motto -->
| image_skyline =
| imagesize =
| image_alt =
| image_caption =
| image_flag =
| flag_size =
| flag_alt =
| flag_border =
| flag_link =
| image_seal =
| seal_size =
| seal_alt =
| seal_link =
| seal_type =
| image_shield =
| shield_size =
| shield_alt =
| shield_link =
| image_blank_emblem =
| blank_emblem_type = <!-- defaults to Logo -->
| blank_emblem_size =
| blank_emblem_alt =
| blank_emblem_link =
| etymology =
| nickname =
| motto =
| anthem =
<!-- maps and coordinates -->
| image_map =
| mapsize =
| map_alt =
| map_caption =
| image_map1 =
| mapsize1 =
| map_alt1 =
| map_caption1 =
| pushpin_map = <!-- name of a location map as per Template:Location_map -->
| pushpin_label_position = <!-- position of the pushpin label: left, right, top, bottom, none -->
| pushpin_label = <!-- only necessary if "name" or "official_name" are too long -->
| pushpin_map_alt =
| pushpin_mapsize =
| pushpin_relief =
| pushpin_map_caption =
| coordinates = <!-- {{Coord}} -->
| coor_pinpoint = <!-- to specify exact location of coordinates (was coor_type) -->
| coordinates_footnotes = <!-- for references: use <ref> tags -->
| grid_name = <!-- name of a regional grid system -->
| grid_position = <!-- position on the regional grid system -->
<!-- location -->
| subdivision_type = Country
| subdivision_name = <!-- the name of the country -->
| subdivision_type1 =
| subdivision_name1 =
| subdivision_type2 =
| subdivision_name2 = <!-- etc., subdivision_type6 / subdivision_name6 -->
<!-- established -->
| established_title = <!-- Founded -->
| established_date =
| established_title1 = <!-- Incorporated (town) -->
| established_date1 =
| established_title2 = <!-- Incorporated (city) -->
| established_date2 =
| established_title3 =
| established_date3 =
| established_title4 =
| established_date4 =
| established_title5 =
| established_date5 =
| established_title6 =
| established_date6 =
| established_title7 =
| established_date7 =
| extinct_title =
| extinct_date =
| founder =
| named_for =
<!-- seat, smaller parts -->
| seat_type = <!-- defaults to: Seat -->
| seat =
| seat1_type = <!-- defaults to: Former seat -->
| seat1 =
| parts_type = <!-- defaults to: Boroughs -->
| parts_style = <!-- list, coll (collapsed list), para (paragraph format) -->
| parts = <!-- parts text, or header for parts list -->
| p1 =
| p2 = <!-- etc., up to p50: for separate parts to be listed-->
<!-- government type, leaders -->
| government_footnotes = <!-- for references: use <ref> tags -->
| government_type =
| governing_body =
| leader_party =
| leader_title =
| leader_name = <!-- add &nbsp; (no-break space) to disable automatic links -->
| leader_title1 =
| leader_name1 = <!-- etc., up to leader_title4 / leader_name4 -->
<!-- display settings -->
| total_type = <!-- to set a non-standard label for total area and population rows -->
| unit_pref = <!-- enter: Imperial, to display imperial before metric -->
<!-- area -->
| area_footnotes = <!-- for references: use <ref> tags -->
| area_magnitude = <!-- use only to set a special wikilink -->
| dunam_link = <!-- If dunams are used, this specifies which dunam to link. -->
| area_total_km2 = <!-- ALL fields with measurements have automatic unit conversion -->
| area_total_sq_mi = <!-- see table @ Template:Infobox settlement for details -->
| area_total_ha =
| area_total_acre =
| area_total_dunam = <!-- used in Middle East articles only -->
| area_land_km2 =
| area_land_sq_mi =
| area_land_ha =
| area_land_acre =
| area_land_dunam = <!-- used in Middle East articles only -->
| area_water_km2 =
| area_water_sq_mi =
| area_water_ha =
| area_water_acre =
| area_water_dunam = <!-- used in Middle East articles only -->
| area_water_percent =
| area_urban_footnotes = <!-- for references: use <ref> tags -->
| area_urban_km2 =
| area_urban_sq_mi =
| area_urban_ha =
| area_urban_acre =
| area_urban_dunam = <!-- used in Middle East articles only -->
| area_rural_footnotes = <!-- for references: use <ref> tags -->
| area_rural_km2 =
| area_rural_sq_mi =
| area_rural_ha =
| area_rural_acre =
| area_rural_dunam = <!-- used in Middle East articles only -->
| area_metro_footnotes = <!-- for references: use <ref> tags -->
| area_metro_km2 =
| area_metro_sq_mi =
| area_metro_ha =
| area_metro_acre =
| area_metro_dunam = <!-- used in Middle East articles only -->
| area_rank =
| area_blank1_title =
| area_blank1_km2 =
| area_blank1_sq_mi =
| area_blank1_ha =
| area_blank1_acre =
| area_blank1_dunam = <!-- used in Middle East articles only -->
| area_blank2_title =
| area_blank2_km2 =
| area_blank2_sq_mi =
| area_blank2_ha =
| area_blank2_acre =
| area_blank2_dunam = <!-- used in Middle East articles only -->
| area_note =
<!-- dimensions -->
| dimensions_footnotes = <!-- for references: use <ref> tags -->
| length_km =
| length_mi =
| width_km =
| width_mi =
<!-- elevation -->
| elevation_footnotes = <!-- for references: use <ref> tags -->
| elevation_m =
| elevation_ft =
| elevation_point = <!-- for denoting the measurement point -->
| elevation_max_footnotes = <!-- for references: use <ref> tags -->
| elevation_max_m =
| elevation_max_ft =
| elevation_max_point = <!-- for denoting the measurement point -->
| elevation_max_rank =
| elevation_min_footnotes = <!-- for references: use <ref> tags -->
| elevation_min_m =
| elevation_min_ft =
| elevation_min_point = <!-- for denoting the measurement point -->
| elevation_min_rank =
<!-- population -->
| population_as_of =
| population_footnotes = <!-- for references: use <ref> tags -->
| population_total =
| pop_est_as_of =
| pop_est_footnotes =
| population_est =
| population_rank =
| population_density_km2 = <!-- for automatic calculation of any density field, use: auto -->
| population_density_sq_mi=
| population_urban_footnotes =
| population_urban =
| population_density_urban_km2 =
| population_density_urban_sq_mi =
| population_rural_footnotes =
| population_rural =
| population_density_rural_km2 =
| population_density_rural_sq_mi =
| population_metro_footnotes =
| population_metro =
| population_density_metro_km2 =
| population_density_metro_sq_mi =
| population_density =
| population_density_rank =
| population_blank1_title =
| population_blank1 =
| population_density_blank1_km2 =
| population_density_blank1_sq_mi=
| population_blank2_title =
| population_blank2 =
| population_density_blank2_km2 =
| population_density_blank2_sq_mi=
| population_demonym = <!-- demonym, e.g. Liverpudlian for someone from Liverpool -->
| population_note =
<!-- demographics (section 1) -->
| demographics_type1 =
| demographics1_footnotes = <!-- for references: use <ref> tags -->
| demographics1_title1 =
| demographics1_info1 = <!-- etc., up to demographics1_title5 / demographics1_info5 -->
<!-- demographics (section 2) -->
| demographics_type2 =
| demographics2_footnotes = <!-- for references: use <ref> tags -->
| demographics2_title1 =
| demographics2_info1 = <!-- etc., up to demographics2_title5 / demographics2_info5 -->
<!-- time zone(s) -->
| timezone1 =
| utc_offset1 =
| timezone1_DST =
| utc_offset1_DST =
| timezone2 =
| utc_offset2 =
| timezone2_DST =
| utc_offset2_DST =
<!-- postal codes, area code -->
| postal_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal_code =
| postal2_code_type = <!-- enter ZIP Code, Postcode, Post code, Postal code... -->
| postal2_code =
| area_code_type = <!-- defaults to: Area code(s) -->
| area_code =
| geocode =
| iso_code =
| registration_plate_type =
| registration_plate =
<!-- blank fields (section 1) -->
| blank_name_sec1 =
| blank_info_sec1 =
| blank1_name_sec1 =
| blank1_info_sec1 =
| blank2_name_sec1 =
| blank2_info_sec1 = <!-- etc., up to blank7_name_sec1 / blank7_info_sec1 -->
<!-- blank fields (section 2) -->
| blank_name_sec2 =
| blank_info_sec2 =
| blank1_name_sec2 =
| blank1_info_sec2 =
| blank2_name_sec2 =
| blank2_info_sec2 = <!-- etc., up to blank7_name_sec2 / blank7_info_sec2 -->
<!-- website, footnotes -->
| website = <!-- {{URL|example.com}} -->
| footnotes =
}}
</pre>
==Parameter names and descriptions==
{| class="wikitable" style="background: white"
| colspan=3 style="background: orange; text-align: center;" |
===Name and transliteration===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
| '''name''' || optional || This is the usual name in English. If it's not specified, the infobox will use the '''official_name''' as a title unless this too is missing, in which case the page name will be used.
|- style="vertical-align:top;"
| '''official_name''' || optional || The official name in English if different from '''name'''
|- style="vertical-align:top;"
| '''native_name''' || optional || Name in the local language, if different from '''name''', and if not English. This will display under the name/official name
|- style="vertical-align:top;"
| '''native_name_lang''' || optional || Use [[List of ISO 639-2 codes|ISO 639-2 code]], e.g. "fr" for French. If there is more than one native name, in different languages, enter those names using {{tl|lang}}, instead.
|- style="vertical-align:top;"
| '''other_name''' || optional || For places with a former or more common name like Bombay or Saigon
|- style="vertical-align:top;"
| '''settlement_type''' || optional || Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names, provided that either '''name''' or '''official_name''' is filled in. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless '''total_type''' is set).
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Transliteration(s)
|- style="vertical-align:top;"
| '''translit_lang1''' || optional || Will place the "entry" before the word "transliteration(s)". Can be used to specify a particular language like in [[Dêlêg]] or one may just enter "Other", like in [[Gaza City|Gaza]]'s article.
|- style="vertical-align:top;"
| '''translit_lang1_type'''<br />'''translit_lang1_type1'''<br />to<br />'''translit_lang1_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang1_info'''<br />'''translit_lang1_info1'''<br />to<br />'''translit_lang1_info6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2''' || optional || Will place a second transliteration. See [[Dêlêg]]
|- style="vertical-align:top;"
| '''translit_lang2_type'''<br />'''translit_lang2_type1'''<br />to<br />'''translit_lang2_type6''' || optional ||
|- style="vertical-align:top;"
| '''translit_lang2_info'''<br />'''translit_lang2_info1'''<br />to<br />'''translit_lang2_info6''' || optional ||
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Images, nickname, motto===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Skyline image
|- style="vertical-align:top;"
| '''image_skyline''' || optional || Despite the name it can be any image that an editor wishes.
|- style="vertical-align:top;"
| '''imagesize''' || optional || Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, '''px''' must be specified; default size is 250px.
|- style="vertical-align:top;"
| '''image_alt''' || optional || [[Alt text]] for the image, used by visually impaired readers who cannot see the image. See [[WP:ALT]].
|- style="vertical-align:top;"
| '''image_caption''' || optional || Will place a caption under the image_skyline (if present)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Flag image
|- style="vertical-align:top;"
| '''image_flag''' || optional || Used for a flag.
|- style="vertical-align:top;"
| '''flag_size''' || optional || Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''flag_alt''' || optional || Alt text for the flag.
|- style="vertical-align:top;"
| '''flag_border''' || optional || Set to 'no' to remove the border from the flag
|- style="vertical-align:top;"
| '''flag_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seal image
|- style="vertical-align:top;"
| '''image_seal''' || optional || If the place has an official seal.
|- style="vertical-align:top;"
| '''seal_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''seal_alt''' || optional || Alt text for the seal.
|- style="vertical-align:top;"
| '''seal_link'''<br />'''seal_type''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Coat of arms image
|- style="vertical-align:top;"
| '''image_shield''' || optional || Can be used for a place with a coat of arms.
|- style="vertical-align:top;"
| '''shield_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''shield_alt''' || optional || Alt text for the shield.
|- style="vertical-align:top;"
| '''shield_link''' || optional || Can be used if a wiki article if known but is not automatically linked by the template. See [[Coquitlam, British Columbia]]'s infobox for an example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Logo or emblem image
|- style="vertical-align:top;"
| '''image_blank_emblem''' || optional || Can be used if a place has an official logo, crest, emblem, etc. Logo is the default type. See [[Kingston upon Hull]]'s infobox for an example.
|- style="vertical-align:top;"
| '''blank_emblem_type''' || optional || To specify what type of emblem "image_blank_emblem" is. The default is Logo.
|- style="vertical-align:top;"
| '''blank_emblem_size''' || optional || If used, '''px''' must be specified; default size is 100px.
|- style="vertical-align:top;"
| '''blank_emblem_alt''' || optional || Alt text for blank emblem.
|- style="vertical-align:top;"
| '''blank_emblem_link''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Nickname, motto
|- style="vertical-align:top;"
| '''etymology''' || optional || origin of name
|- style="vertical-align:top;"
| '''nickname''' || optional || well-known nickname(s)
|- style="vertical-align:top;"
| '''motto''' || optional || Will place the motto under the nicknames
|- style="vertical-align:top;"
| '''anthem''' || optional || Will place the anthem (song) under the nicknames
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Maps, coordinates===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Map images
|- style="vertical-align:top;"
| '''image_map''' || optional ||
|- style="vertical-align:top;"
| '''mapsize''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt''' || optional || Alt text for map.
|- style="vertical-align:top;"
| '''map_caption''' || optional ||
|- style="vertical-align:top;"
| '''image_map1''' || optional || A secondary map image. The field '''image_map''' must be filled in first. Example see: [[Bloomsburg, Pennsylvania]].
|- style="vertical-align:top;"
| '''mapsize1''' || optional || If used, '''px''' must be specified; default is 250px.
|- style="vertical-align:top;"
| '''map_alt1''' || optional || Alt text for secondary map.
|- style="vertical-align:top;"
| '''map_caption1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Pushpin map(s), coordinates
|- style="vertical-align:top;"
| '''pushpin_map''' || optional || The name of a location map as per [[Template:Location map]] (e.g. ''Indonesia'' or ''Russia''). The coordinate fields (from {{para|coordinates}}) position a pushpin coordinate marker and label on the map '''automatically'''. Example: [[Padang, Indonesia]]. To show multiple pushpin maps, provide a list of maps separated by #, e.g., ''California#USA''
|- style="vertical-align:top;"
| '''pushpin_label_position''' || optional || The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.
|- style="vertical-align:top;"
| '''pushpin_map_alt''' || optional || Alt text for pushpin map.
|- style="vertical-align:top;"
| '''pushpin_mapsize''' || optional || Must be entered as only a number—'''do not use px'''. The default value is 250.
|- style="vertical-align:top;"
| '''pushpin_map_caption''' || optional || Fill out if a different caption from ''map_caption'' is desired.
|- style="vertical-align:top;"
| '''pushpin_relief''' || optional || Set this to <code>y</code> or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).
|- style="vertical-align:top;"
| '''pushpin_overlay''' || optional || Can be used to specify an image to be superimposed on the regular pushpin map.
|- style="vertical-align:top;"
| '''coordinates''' || optional || Latitude and longitude. Use {{tl|Coord}}. See the documentation for {{tl|Coord}} for more details on usage.
|- style="vertical-align:top;"
| '''coor_pinpoint''' || optional || If needed, to specify more exactly where (or what) coordinates are given (e.g. ''Town Hall'') or a specific place in a larger area (e.g. a city in a county). Example: [[Masovian Voivodeship]]
|- style="vertical-align:top;"
| '''coordinates_footnotes''' || optional || Reference(s) for coordinates, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''grid_name'''<br />'''grid_position''' || optional || Name of a regional grid system and position on the regional grid
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Location, established, seat, subdivisions, government, leaders===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Location
|- style="vertical-align:top;"
| '''subdivision_type''' || optional || almost always <code><nowiki>Country</nowiki></code>
|- style="vertical-align:top;"
| '''subdivision_name''' || optional || Depends on the subdivision_type—use the name in text form, sample: <code>United States</code> or <code><nowiki>United States</nowiki></code>, flag icons or flag templates can be used in this field.
|- style="vertical-align:top;"
| '''subdivision_type1'''<br />to<br />'''subdivision_type6''' || optional || Can be State/Province, region, county.
|- style="vertical-align:top;"
| '''subdivision_name1'''<br />to<br />'''subdivision_name6''' || optional || Use the name in text form, sample: <code>Florida</code> or <code><nowiki>[[Florida]]</nowiki></code>. Flag icons or flag templates can be used in this field per [[WP:MOSFLAG]].
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Established
|- style="vertical-align:top;"
| '''established_title''' || optional || Example: Founded
|- style="vertical-align:top;"
| '''established_date''' || optional ||
|- style="vertical-align:top;"
| '''established_title1''' || optional || Example: Incorporated (town) <br/>[Note that "established_title1" is distinct from "established_title"; you can think of "established_title" as behaving like "established_title0".]
|- style="vertical-align:top;"
| '''established_date1''' || optional || [See note for "established_title1".]
|- style="vertical-align:top;"
| '''established_title2''' || optional || Example: Incorporated (city)
|- style="vertical-align:top;"
| '''established_date2''' || optional ||
|- style="vertical-align:top;"
| '''established_title3''' || optional ||
|- style="vertical-align:top;"
| '''established_date3''' || optional ||
|- style="vertical-align:top;"
| '''established_title4''' || optional ||
|- style="vertical-align:top;"
| '''established_date4''' || optional ||
|- style="vertical-align:top;"
| '''established_title5''' || optional ||
|- style="vertical-align:top;"
| '''established_date5''' || optional ||
|- style="vertical-align:top;"
| '''established_title6''' || optional ||
|- style="vertical-align:top;"
| '''established_date6''' || optional ||
|- style="vertical-align:top;"
| '''established_title7''' || optional ||
|- style="vertical-align:top;"
| '''established_date7''' || optional ||
|- style="vertical-align:top;"
| '''extinct_title''' || optional || For when a settlement ceases to exist
|- style="vertical-align:top;"
| '''extinct_date''' || optional ||
|- style="vertical-align:top;"
| '''founder''' || optional || Who the settlement was founded by
|- style="vertical-align:top;"
| '''named_for''' || optional || The source of the name of the settlement (a person, a place, et cetera)
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Seat of government
|- style="vertical-align:top;"
| '''seat_type''' || optional || The label for the seat of government (defaults to ''Seat'').
|- style="vertical-align:top;"
| '''seat''' || optional || The seat of government.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Smaller parts (e.g. boroughs of a city)
|- style="vertical-align:top;"
| '''parts_type''' || optional || The label for the smaller subdivisions (defaults to ''Boroughs'').
|- style="vertical-align:top;"
| '''parts_style''' || optional || Set to ''list'' to display as a collapsible list, ''coll'' as a collapsed list, or ''para'' to use paragraph style. Default is ''list'' for up to 5 items, otherwise ''coll''.
|- style="vertical-align:top;"
| '''parts''' || optional || Text or header of the list of smaller subdivisions.
|- style="vertical-align:top;"
| '''p1'''<br />'''p2'''<br />to<br />'''p50''' || optional || The smaller subdivisions to be listed. Example: [[Warsaw]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Government type, leaders
|- style="vertical-align:top;"
| '''government_footnotes''' || optional || Reference(s) for government, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''government_type''' || optional || Example: [[Mayor-council government]]
|- style="vertical-align:top;"
| '''governing_body''' || optional || Name of the place's governing body
|- style="vertical-align:top;"
| '''leader_party''' || optional || Political party of the place's leader
|- style="vertical-align:top;"
| '''leader_title''' || optional || First title of the place's leader, e.g. Mayor
|- style="vertical-align:top;"
| '''leader_name''' || optional || Name of the place's leader
|- style="vertical-align:top;"
| '''leader_title1'''<br />to<br />'''leader_title4''' || optional ||
|- style="vertical-align:top;"
| '''leader_name1'''<br />to<br />'''leader_name4''' || optional || For long lists use {{tl|Collapsible list}}. See [[Halifax Regional Municipality|Halifax]] for an example.
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Geographic information===
|- style="vertical-align:top;"
| colspan=3 | These fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they should enter both values in their respective fields.
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Display settings
|- style="vertical-align:top;"
| '''total_type''' || optional || Specifies what "total" area and population figure refer to, e.g. ''Greater London''. This overrides other labels for total population/area. To make the total area and population display on the same line as the words "Area" and "Population", with no "Total" or similar label, set the value of this parameter to ''' '''.
|- style="vertical-align:top;"
| '''unit_pref''' || optional || To change the unit order to ''imperial (metric)'', enter '''imperial'''. The default display style is ''metric (imperial)''. However, the template will swap the order automatically if the '''subdivision_name''' equals some variation of the USA or the UK.<br />For the middle east, a unit preference of [[dunam]] can be entered (only affects total area). <br /> All values must be entered in a '''raw format: no commas, spaces, or unit symbols'''. The template will format them automatically.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Area
|- style="vertical-align:top;"
| '''area_footnotes''' || optional || Reference(s) for area, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''area_magnitude''' || optional || Setting this to any non-empty value will create a link to the appropriate order of magnitude of area page (e.g. [[1 E+6 m²]]).
|- style="vertical-align:top;"
| '''dunam_link''' || optional || If dunams are used, the default is to link the word ''dunams'' in the total area section. This can be changed by setting <code>dunam_link</code> to another measure (e.g. <code>dunam_link=water</code>). Linking can also be turned off by setting the parameter to something else (e.g. <code>dunam_link=none</code> or <code>dunam_link=off</code>).
|- style="vertical-align:top;"
| '''area_total_km2''' || optional || Total area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_total_ha''' || optional || Total area in hectares—symbol: ha. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.
|- style="vertical-align:top;"
| '''area_total_sq_mi''' || optional || Total area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.
|- style="vertical-align:top;"
| '''area_total_acre''' || optional || Total area in acres. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display hectares if area_total_ha is empty.
|- style="vertical-align:top;"
| '''area_total_dunam''' || optional || Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: [[Gaza City|Gaza]] and [[Ramallah]]
|- style="vertical-align:top;"
| '''area_land_km2''' || optional || Land area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_land_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_land_sq_mi''' || optional || Land area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_land_km2 is empty.
|- style="vertical-align:top;"
| '''area_land_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_land_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_land_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_km2''' || optional || Water area in square kilometers—symbol: km<sup>2</sup>. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square miles if area_water_sq_mi is empty.
|- style="vertical-align:top;"
| '''area_water_sq_mi''' || optional || Water area in square miles—symbol: sq mi. Value must be entered in '''raw format''', no commas or spaces. Auto-converted to display square kilometers if area_water_km2 is empty.
|- style="vertical-align:top;"
| '''area_water_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_water_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_water_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_water_percent''' || optional || percent of water without the "%"
|- style="vertical-align:top;"
| '''area_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_urban_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_urban_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_urban_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
|- style="vertical-align:top;"
| '''area_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_rural_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_rural_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_rural_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_metro_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_metro_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_metro_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_rank''' || optional || The settlement's area, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''area_blank1_title''' || optional || Example see London
|- style="vertical-align:top;"
| '''area_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank1_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank1_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank1_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''area_blank2_ha''' || optional || similar to <code>area_total_ha</code>
|- style="vertical-align:top;"
| '''area_blank2_dunam''' || optional || similar to <code>area_total_dunam</code>
|- style="vertical-align:top;"
| '''area_blank2_acre''' || optional || similar to <code>area_total_acre</code>
|- style="vertical-align:top;"
| '''area_note''' || optional || A place for additional information such as the name of the source.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Dimensions
|- style="vertical-align:top;"
| '''dimensions_footnotes''' || optional || Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''length_km''' || optional || Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''length_mi''' || optional || Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.
|- style="vertical-align:top;"
| '''width_km''' || optional || Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.
|- style="vertical-align:top;"
| '''width_mi''' || optional || Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Elevation
|- style="vertical-align:top;"
| '''elevation_footnotes''' || optional || Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''elevation_m''' || optional || Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_ft''' || optional || Raw number, entered in feet. Will automatically convert to display the average elevation in meters if '''elevation_m''' field is empty. However, if a range in elevation (e.g. 50–500 ft ) is desired, use the "max" and "min" fields below
|- style="vertical-align:top;"
| '''elevation_max_footnotes'''<br />'''elevation_min_footnotes''' || optional || Same as above, but for the "max" and "min" elevations. See [[Leeds]].
|- style="vertical-align:top;"
| '''elevation_max_m'''<br />'''elevation_max_ft'''<br />'''elevation_max_rank'''<br />'''elevation_min_m'''<br />'''elevation_min_ft'''<br />'''elevation_min_rank''' || optional || Used to give highest & lowest elevations and rank, instead of just a single value. Example: [[Halifax Regional Municipality]].
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Population, demographics===
|- style="vertical-align:top;"
| colspan=3 | The density fields have '''dual automatic unit conversion''' meaning that if only metric values are entered, the imperial values will be automatically converted and vice versa. If an editor wishes to over-ride the automatic conversion, e.g. if the source gives both metric and imperial or if a range of values is needed, they can enter both values in their respective fields. '''To calculate density with respect to the total area automatically, type ''auto'' in place of any density value.'''
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Population
|- style="vertical-align:top;"
| '''population_total''' || optional || Actual population (see below for estimates) preferably consisting of digits only (without any commas)
|- style="vertical-align:top;"
| '''population_as_of''' || optional || The year for the population total (usually a census year)
|- style="vertical-align:top;"
| '''population_footnotes''' || optional || Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_est''' || optional || Population estimate.
|- style="vertical-align:top;"
| '''pop_est_as_of''' || optional || The year or month & year of the population estimate
|- style="vertical-align:top;"
| '''pop_est_footnotes''' || optional || Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_urban''' || optional ||
|- style="vertical-align:top;"
| '''population_urban_footnotes''' || optional || Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_urban_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_urban_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rural''' || optional ||
|- style="vertical-align:top;"
| '''population_rural_footnotes''' || optional || Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_rural_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_rural_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_metro''' || optional ||
|- style="vertical-align:top;"
| '''population_metro_footnotes''' || optional || Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags
|- style="vertical-align:top;"
| '''population_density_metro_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_metro_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_rank''' || optional || The settlement's population, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_density_rank''' || optional || The settlement's population density, as ranked within its parent sub-division
|- style="vertical-align:top;"
| '''population_blank1_title''' || optional || Can be used for estimates. Example: [[Windsor, Ontario]]
|- style="vertical-align:top;"
| '''population_blank1''' || optional || The population value for blank1_title
|- style="vertical-align:top;"
| '''population_density_blank1_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank1_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2_title''' || optional ||
|- style="vertical-align:top;"
| '''population_blank2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_km2''' || optional ||
|- style="vertical-align:top;"
| '''population_density_blank2_sq_mi''' || optional ||
|- style="vertical-align:top;"
| '''population_demonym''' || optional || A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example, a citizen in [[Liverpool]] is known as a [[Liverpudlian]].
|- style="vertical-align:top;"
| '''population_note''' || optional || A place for additional information such as the name of the source. See [[Windsor, Ontario]] for example.
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 1)
|- style="vertical-align:top;"
| '''demographics_type1''' || optional || Section Header. For example: Ethnicity
|- style="vertical-align:top;"
| '''demographics1_footnotes''' || optional || Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics1_title1'''<br />to<br />'''demographics1_title5''' || optional || Titles related to demographics_type1. For example: White, Black, Hispanic...
|- style="vertical-align:top;"
| '''demographics1_info1'''<br />to<br />'''demographics1_info5''' || optional || Information related to the "titles". For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Demographics (section 2)
|- style="vertical-align:top;"
| '''demographics_type2''' || optional || A second section header. For example: Languages
|- style="vertical-align:top;"
| '''demographics2_footnotes''' || optional || Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}
|- style="vertical-align:top;"
| '''demographics2_title1'''<br />to<br />'''demographics2_title5''' || optional || Titles related to '''demographics_type2'''. For example: English, French, Arabic...
|- style="vertical-align:top;"
| '''demographics2_info1'''<br />to<br />'''demographics2_info5''' || optional || Information related to the "titles" for type2. For example: 50%, 25%, 10%...
|- style="vertical-align:top;"
| colspan=3 style="background: orange; text-align: center;" |
===Other information===
|- style="background: whitesmoke;"
! Parameter name !! Usage !! Description
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Time zone(s)
|- style="vertical-align:top;"
| '''timezone1''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1''' || optional ||
|- style="vertical-align:top;"
| '''timezone1_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset1_DST''' || optional ||
|- style="vertical-align:top;"
| '''timezone2''' || optional || A second timezone field for larger areas such as a Province.
|- style="vertical-align:top;"
| '''utc_offset2''' || optional ||
|- style="vertical-align:top;"
| '''timezone2_DST''' || optional ||
|- style="vertical-align:top;"
| '''utc_offset2_DST''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Postal code(s) & area code
|- style="vertical-align:top;"
| '''postal_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal_code''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code_type''' || optional ||
|- style="vertical-align:top;"
| '''postal2_code''' || optional ||
|- style="vertical-align:top;"
| '''area_code_type''' || optional || If left blank/not used template will default to "[[Telephone numbering plan|Area code(s)]]"
|- style="vertical-align:top;"
| '''area_code''' || optional ||
|- style="vertical-align:top;"
| '''geocode''' || optional || See [[Geocode]]
|- style="vertical-align:top;"
| '''iso_code''' || optional || See [[ISO 3166]]
|- style="vertical-align:top;"
| '''registration_plate_type''' || optional || If left blank/not used template will default to "[[Vehicle registration plate|Vehicle registration]]"
|- style="vertical-align:top;"
| '''registration_plate''' || optional || See [[Vehicle registration plate]]
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 1)
|- style="vertical-align:top;"
| '''blank_name_sec1''' || optional || Fields used to display other information. The name is displayed in bold on the left side of the infobox.
|- style="vertical-align:top;"
| '''blank_info_sec1''' || optional || The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]
|- style="vertical-align:top;"
| '''blank1_name_sec1'''<br />to<br />'''blank7_name_sec1''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec1'''<br />to<br />'''blank7_info_sec1''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Blank fields (section 2)
|- style="vertical-align:top;"
| '''blank_name_sec2''' || optional || For a second section of blank fields
|- style="vertical-align:top;"
| '''blank_info_sec2''' || optional || Example: [[Beijing]]
|- style="vertical-align:top;"
| '''blank1_name_sec2'''<br />to<br />'''blank7_name_sec2''' || optional || Up to 7 additional fields (8 total) can be displayed in this section
|- style="vertical-align:top;"
| '''blank1_info_sec2'''<br />to<br />'''blank7_info_sec2''' || optional ||
|- style="vertical-align:top;"
! colspan=3 style="background: #DDDDDD;" | Website, footnotes
|- style="vertical-align:top;"
| '''website''' || optional || External link to official website, Use {{Tl|URL}}, thus: <nowiki>{{URL|example.com}}</nowiki>
|- style="vertical-align:top;"
| '''footnotes''' || optional || Text to be displayed at the bottom of the infobox
|- style="vertical-align:top;"
| '''short_description''' || optional || [[WP:SHORTDESC|specify custom short description]]; if not specified, one will be automatically generated, e.g. "Place in Israel".
|}
<!-- End of parameter name/description table -->
==Examples==
;Example 1:
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (''City in a Garden''), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | accessdate = August 1, 2012}}</ref>
| area_magnitude = 1 E+8
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | accessdate = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |accessdate = April 12, 2011}}</ref>
| population_as_of = [[2010 United States Census|2010]]
| population_total = 2,695,598
| pop_est_as_of = 2011
| population_est = 2,707,120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_code = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|423587}}, {{GNIS4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite GNIS|428803|City of Chicago|April 12, 2011}}</ref>
}}
<source lang="xml" style="overflow:auto; white-space: pre-wrap;">
<!-- NOTE: This differs from the actual Chicago infobox in order to provide examples. -->
{{Infobox settlement
| name = Chicago
| settlement_type = [[City (Illinois)|City]]
| image_skyline = Chicago montage.jpg
| imagesize = 275px <!--default is 250px-->
| image_caption = Clockwise from top: [[Downtown Chicago]], the [[Chicago Theatre]], the [[Chicago 'L']], [[Navy Pier]], [[Millennium Park]], the [[Field Museum]], and the [[Willis Tower|Willis (formerly Sears) Tower]]
| image_flag = Flag of Chicago, Illinois.svg
| image_seal = Seal of Chicago, Illinois.svg
| etymology = {{lang-mia|shikaakwa}} ("wild onion" or "wild garlic")
| nickname = [[Origin of Chicago's "Windy City" nickname|The Windy City]], The Second City, Chi-Town, Chi-City, Hog Butcher for the World, City of the Big Shoulders, The City That Works, and others found at [[List of nicknames for Chicago]]
| motto = {{lang-la|Urbs in Horto}} (''City in a Garden''), Make Big Plans (Make No Small Plans), I Will
| image_map = US-IL-Chicago.png
| map_caption = Location in the [[Chicago metropolitan area]] and Illinois
| pushpin_map = USA
| pushpin_map_caption = Location in the United States
| coordinates = {{coord|41|50|15|N|87|40|55|W}}
| coordinates_footnotes = <ref name="USCB Gazetteer 2010"/>
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = [[Illinois]]
| subdivision_type2 = [[List of counties in Illinois|Counties]]
| subdivision_name2 = [[Cook County, Illinois|Cook]], [[DuPage County, Illinois|DuPage]]
| established_title = Settled
| established_date = 1770s
| established_title2 = [[Municipal corporation|Incorporated]]
| established_date2 = March 4, 1837
| founder =
| named_for = {{lang-mia|shikaakwa}}<br /> ("Wild onion")
| government_type = [[Mayor–council government|Mayor–council]]
| leader_title = [[Mayor of Chicago|Mayor]]
| leader_name = [[Rahm Emanuel]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[City council|Council]]
| leader_name1 = [[Chicago City Council]]
| unit_pref = Imperial
| area_footnotes = <ref name="USCB Gazetteer 2010">{{cite web | url = https://www.census.gov/geo/www/gazetteer/files/Gaz_places_national.txt | title = 2010 United States Census Gazetteer for Places: January 1, 2010 | format = text | work = 2010 United States Census | publisher = [[United States Census Bureau]] | date = April 2010 | accessdate = August 1, 2012}}</ref>
| area_magnitude = 1 E+8
| area_total_sq_mi = 234.114
| area_land_sq_mi = 227.635
| area_water_sq_mi = 6.479
| area_water_percent = 3
| area_urban_sq_mi = 2123
| area_metro_sq_mi = 10874
| elevation_footnotes = <ref name="GNIS"/>
| elevation_ft = 594
| elevation_m = 181
| population_as_of = [[2010 United States Census|2010]]
| population_footnotes = <ref name="USCB PopEstCities 2011">{{cite web | url = https://www.census.gov/popest/data/cities/totals/2011/tables/SUB-EST2011-01.csv | title = Annual Estimates of the Resident Population for Incorporated Places Over 50,000, Ranked by July 1, 2011 Population | format = [[comma-separated values|CSV]] | work = 2011 Population Estimates | publisher = [[United States Census Bureau]], Population Division | date = June 2012 | accessdate = August 1, 2012}}</ref><ref name="USCB Metro 2010">{{cite web | url=https://www.census.gov/prod/cen2010/briefs/c2010br-01.pdf | title = Population Change for the Ten Most Populous and Fastest Growing Metropolitan Statiscal Areas: 2000 to 2010 | date = March 2011 | publisher = [[U.S. Census Bureau]] | page = 6 |accessdate = April 12, 2011}}</ref>
| population_total = 2,695,598
| pop_est_as_of = 2011
| population_est = 2,707,120
| population_rank = [[List of United States cities by population|3rd US]]
| population_density_sq_mi = 11,892.4<!-- 2011 population_est / area_land_sq_mi -->
| population_urban = 8711000
| population_density_urban_sq_mi = auto
| population_metro = 9461105
| population_density_metro_sq_mi = auto
| population_demonym = Chicagoan
| timezone = [[Central Standard Time|CST]]
| utc_offset = −06:00
| timezone_DST = [[Central Daylight Time|CDT]]
| utc_offset_DST = −05:00
| area_code_type = [[North American Numbering Plan|Area codes]]
| area_code = [[Area code 312|312]], [[Area code 773|773]], [[Area code 872|872]]
| blank_name = [[Federal Information Processing Standards|FIPS]] code
| blank_info = {{FIPS|17|14000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|423587}}, {{GNIS4|428803}}
| website = {{URL|www.cityofchicago.org}}
| footnotes = <ref name="GNIS">{{Cite GNIS|428803|City of Chicago|April 12, 2011}}</ref>
}}
</source>
;References
{{reflist|close=1}}
{{clear}}
----
;Example 2:
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| official_name = City of Detroit
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit.svg
| image_seal = Seal of Detroit (B&W).svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[Contiguous United States|contiguous United States of America]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = United States
| subdivision_type1 = State
| subdivision_name1 = {{flag|Michigan}}
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor-council government|Mayor-Council]]
| leader_title = [[List of mayors of Detroit, Michigan|Mayor]]
| leader_name = [[Dave Bing]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_magnitude =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_as_of = 2011
| population_footnotes =
| population_total = 706,585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3,863,924
| population_metro = 4,285,832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5,207,434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_note =
| population_demonym = Detroiter
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|1617959}}, {{GNIS4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
<source lang="html" style="overflow:auto; white-space: pre-wrap;">
{{Infobox settlement
| name = Detroit
| settlement_type = [[City (Michigan)|City]]
| official_name = City of Detroit
| image_skyline = Detroit Montage.jpg
| imagesize = 290px
| image_caption = Images from top to bottom, left to right: [[Downtown Detroit]] skyline, [[Spirit of Detroit]], [[Greektown Historic District|Greektown]], [[Ambassador Bridge]], [[Michigan Soldiers' and Sailors' Monument]], [[Fox Theatre (Detroit)|Fox Theatre]], and [[Comerica Park]].
| image_flag = Flag of Detroit, Michigan.svg
| image_seal = Seal of Detroit, Michigan.svg
| etymology = {{lang-fr|détroit}} ([[strait]])
| nickname = The Motor City, Motown, Renaissance City, The D, Hockeytown, The Automotive Capital of the World, Rock City, The 313
| motto = ''Speramus Meliora; Resurget Cineribus''<br /><small>([[Latin]]: We Hope For Better Things; It Shall Rise From the Ashes)</small>
| image_map = Wayne County Michigan Incorporated and Unincorporated areas Detroit highlighted.svg
| mapsize = 250x200px
| map_caption = Location within [[Wayne County, Michigan]] and the state of [[Michigan]]
| pushpin_map = USA
| pushpin_map_caption = Location within the [[Contiguous United States|contiguous United States of America]]
| coordinates = {{coord|42|19|53|N|83|2|45|W}}
| coordinates_footnotes =
| subdivision_type = Country
| subdivision_name = {{flagu|United States of America}}
| subdivision_type1 = State
| subdivision_name1 = {{flag|Michigan}}
| subdivision_type2 = [[List of counties in Michigan|County]]
| subdivision_name2 = [[Wayne County, Michigan|Wayne]]
| established_title = Founded
| established_date = 1701
| established_title2 = Incorporated
| established_date2 = 1806
| government_footnotes = <!-- for references: use<ref> tags -->
| government_type = [[Mayor-council government|Mayor-Council]]
| leader_title = [[List of mayors of Detroit, Michigan|Mayor]]
| leader_name = [[Dave Bing]]
| leader_party = [[Democratic Party (United States)|D]]
| leader_title1 = [[Detroit City Council|City Council]]
| leader_name1 = {{collapsible list|bullets=yes
| title = Members
| 1 = [[Charles Pugh]] – Council President
| 2 = [[Gary Brown (Detroit politician)|Gary Brown]] – Council President Pro-Tem
| 3 = [[JoAnn Watson]]
| 4 = [[Kenneth Cockrel, Jr.]]
| 5 = [[Saunteel Jenkins]]
| 6 = [[Andre Spivey]]
| 7 = [[James Tate (Detroit politician)|James Tate]]
| 8 = [[Brenda Jones (Detroit politician)|Brenda Jones]]
| 9 = [[Kwame Kenyatta]]
}}
| unit_pref = Imperial
| area_footnotes =
| area_magnitude =
| area_total_sq_mi = 142.87
| area_total_km2 = 370.03
| area_land_sq_mi = 138.75
| area_land_km2 = 359.36
| area_water_sq_mi = 4.12
| area_water_km2 = 10.67
| area_urban_sq_mi = 1295
| area_metro_sq_mi = 3913
| elevation_footnotes =
| elevation_ft = 600
| population_as_of = 2011
| population_footnotes =
| population_total = 706,585
| population_rank = [[List of United States cities by population|18th in U.S.]]
| population_urban = 3,863,924
| population_metro = 4,285,832 (US: [[List of United States metropolitan statistical areas|13th]])
| population_blank1_title = [[Combined statistical area|CSA]]
| population_blank1 = 5,207,434 (US: [[List of United States combined statistical areas|11th]])
| population_density_sq_mi= {{#expr:713777/138.8 round 0}}
| population_demonym = Detroiter
| population_note =
| timezone = [[Eastern Time Zone (North America)|EST]]
| utc_offset = −5
| timezone_DST = [[Eastern Daylight Time|EDT]]
| utc_offset_DST = −4
| postal_code_type =
| postal_code =
| area_code = [[Area code 313|313]]
| blank_name = [[Federal Information Processing Standards|FIPS code]]
| blank_info = {{FIPS|26|22000}}
| blank1_name = [[Geographic Names Information System|GNIS]] feature ID
| blank1_info = {{GNIS4|1617959}}, {{GNIS4|1626181}}
| website = [http://www.detroitmi.gov/ DetroitMI.gov]
| footnotes =
}}
</source>
{{clear}}
==Redirects and calls==
At least {{PAGESINCATEGORY:Templates calling Infobox settlement}} other [[:Category:Templates calling Infobox settlement|templates call this one]] and [{{fullurl:Special:WhatLinksHere/Template:Infobox_settlement|namespace=10&hidetrans=1&hidelinks=1}} many templates redirect here].
==Supporting templates==
The following is a list of sub-templates used by Infobox settlement. See the [{{fullurl:Special:PrefixIndex|prefix=Infobox+settlement%2F&namespace=10&hideredirects=1}} current list of all sub-templates] for documentation, sandboxes, testcases, etc.
# {{tl|Infobox settlement/areadisp}}
# {{tl|Infobox settlement/densdisp}}
# {{tl|Infobox settlement/dunam}}
# {{tl|Infobox settlement/dunam/mag}}
# {{tl|Infobox settlement/impus}}
# {{tl|Infobox settlement/impus/mag}}
# {{tl|Infobox settlement/lengthdisp}}
# {{tl|Infobox settlement/link}}
# {{tl|Infobox settlement/metric}}
# {{tl|Infobox settlement/metric/mag}}
# {{tl|Infobox settlement/pref}}
==Microformat==
{{UF-hcard-geo}}
{{collapse top|TemplateData}}
{{TemplateData header}}
<templatedata>
{
"description": "an Infobox for human settlements (cities, towns, villages, communities) as well as other administrative districts, counties, provinces, etcetera",
"params": {
"name": {
"label": "name",
"description": "This is the usual name in English. If it's not specified, the infobox will use the 'official_name' as a title unless this too is missing, in which case the page name will be used.",
"type": "string",
"required": false
},
"official_name": {
"label": "official_name",
"description": "The official name in English if different from 'name'",
"type": "string",
"required": false
},
"native_name": {
"label": "native_name",
"description": "This will display under the name/official name",
"type": "string",
"required": false
},
"native_name_lang": {
"label": "native_name_lang",
"description": "Use ISO 639-2 code, e.g. 'fr' for French. If there is more than one native name, in different languages, enter those names using {{lang}}, instead.",
"type": "string",
"required": false
},
"other_name": {
"label": "other_name",
"description": "For places with a former or more common name like Bombay or Saigon",
"type": "string",
"required": false
},
"settlement_type": {
"label": "settlement_type",
"description": "Any type can be entered, such as City, Town, Village, Hamlet, Municipality, Reservation, etc. If set, will be displayed under the names, provided that either 'name' or 'official_name' is filled in. Might also be used as a label for total population/area (defaulting to ''City''), if needed to distinguish from ''Urban'', ''Rural'' or ''Metro'' (if urban, rural or metro figures are not present, the label is ''Total'' unless 'total_type' is set).",
"type": "string",
"required": false
},
"translit_lang1": {
"label": "translit_lang1",
"description": "Will place the entry before the word 'transliteration(s)'. Can be used to specify a particular language like in Dêlêg or one may just enter 'Other', like in Gaza's article.",
"type": "string",
"required": false
},
"translit_lang1_type": {
"label": "translit_lang1_type",
"description": "Parameters translit_lang2_type1, ... translit_lang2_type6 are also available but not documented here",
"type": "string",
"required": false
},
"translit_lang1_info": {
"label": "translit_lang1_info",
"description": "Parameters translit_lang2_info1, ... translit_lang2_info6 are also available but not documented here",
"type": "string",
"required": false
},
"translit_lang2": {
"label": "translit_lang2",
"description": "Will place a second transliteration. See Dêlêg",
"type": "string",
"required": false
},
"image_skyline": {
"label": "image_skyline",
"description": "Despite the name it can be any image that an editor wishes.",
"type": "wiki-file-name",
"required": false
},
"imagesize": {
"label": "imagesize",
"description": "Can be used to tweak the size of the image_skyline up or down. This can be helpful if an editor wants to make the infobox wider. If used, 'px' must be specified; default size is 250px.",
"type": "string",
"required": false
},
"image_alt": {
"label": "image_alt",
"description": "Alt text for the image, used by visually impaired readers who cannot see the image.",
"type": "string",
"required": false
},
"image_caption": {
"label": "image_caption",
"description": "Will place a caption under the image_skyline (if present)",
"type": "string",
"required": false
},
"image_flag": {
"label": "image_flag",
"description": "Used for a flag.",
"type": "string",
"required": false
},
"flag_size": {
"label": "flag_size",
"description": "Can be used to tweak the size of the image_flag up or down from 100px as desired. If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"flag_alt": {
"label": "flag_alt",
"description": "Alt text for the flag.",
"type": "string",
"required": false
},
"flag_border": {
"label": "flag_border",
"description": "Set to no to remove the border from the flag",
"type": "string",
"required": false
},
"flag_link": {
"label": "flag_link",
"type": "string",
"required": false
},
"image_seal": {
"label": "image_seal",
"description": "If the place has an official seal.",
"type": "string",
"required": false
},
"seal_size": {
"label": "seal_size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"seal_alt": {
"label": "seal_alt",
"description": "Alt text for the seal.",
"type": "string",
"required": false
},
"seal_link": {
"label": "seal_link",
"type": "string",
"required": false
},
"image_shield": {
"label": "image_shield",
"description": "Can be used for a place with a coat of arms.",
"type": "string",
"required": false
},
"shield_size": {
"label": "shield_size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"shield_alt": {
"label": "shield_alt",
"description": "Alt text for the shield.",
"type": "string",
"required": false
},
"shield_link": {
"label": "shield_link",
"description": "Can be used if a wiki article if known but is not automatically linked by the template. See Coquitlam, British Columbia's infobox for an example.",
"type": "string",
"required": false
},
"image_blank_emblem": {
"label": "image_blank_emblem",
"description": "Can be used if a place has an official logo, crest, emblem, etc. Logo is the default type. See Kingston upon Hull's infobox for an example.",
"type": "string",
"required": false
},
"blank_emblem_type": {
"label": "blank_emblem_type",
"description": "To specify what type of emblem 'image_blank_emblem' is. The default is Logo.",
"type": "string",
"required": false
},
"blank_emblem_size": {
"label": "blank_emblem_size",
"description": "If used, 'px' must be specified; default size is 100px.",
"type": "string",
"required": false
},
"blank_emblem_alt": {
"label": "blank_emblem_alt",
"description": "Alt text for blank emblem.",
"type": "string",
"required": false
},
"blank_emblem_link": {
"label": "blank_emblem_link",
"type": "string",
"required": false
},
"nickname": {
"label": "nickname",
"description": "well-known nickname(s)",
"type": "string",
"required": false
},
"motto": {
"label": "motto",
"description": "Will place the motto under the nicknames",
"type": "string",
"required": false
},
"anthem": {
"label": "anthem",
"description": "Will place the anthem (song) under the nicknames",
"type": "string",
"required": false
},
"image_map": {
"label": "image_map",
"type": "string",
"required": false
},
"mapsize": {
"label": "mapsize",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"required": false
},
"map_alt": {
"label": "map_alt",
"description": "Alt text for map.",
"type": "string",
"required": false
},
"map_caption": {
"label": "map_caption",
"type": "string",
"required": false
},
"image_map1": {
"label": "image_map1",
"description": "A secondary map image. The field 'image_map' must be filled in first. Example see: Bloomsburg, Pennsylvania.",
"type": "string",
"required": false
},
"mapsize1": {
"label": "mapsize1",
"description": "If used, 'px' must be specified; default is 250px.",
"type": "string",
"required": false
},
"map_alt1": {
"label": "map_alt1",
"description": "Alt text for secondary map.",
"type": "string",
"required": false
},
"map_caption1": {
"label": "map_caption1",
"type": "string",
"required": false
},
"pushpin_map": {
"label": "pushpin_map",
"description": "The name of a location map (e.g. 'Indonesia' or 'Russia'). The coordinates information (from the coordinates parameter) position a pushpin coordinate marker and label on the map 'automatically'. Example see: Padang, Indonesia",
"type": "string",
"required": false
},
"pushpin_label_position": {
"label": "pushpin_label_position",
"description": "The position of the label on the pushpin map relative to the pushpin coordinate marker. Valid options are {left, right, top, bottom, none}. If this field is not specified, the default value is ''right''.",
"type": "string",
"required": false
},
"pushpin_map_alt": {
"label": "pushpin_map_alt",
"description": "Alt text for pushpin map.",
"type": "string",
"required": false
},
"pushpin_mapsize": {
"label": "pushpin_mapsize",
"description": "Must be entered as only a number—do not use px. The default value is 250.",
"type": "number",
"required": false
},
"pushpin_map_caption": {
"label": "pushpin_map_caption",
"description": "Fill out if a different caption from ''map_caption'' is desired.",
"type": "string",
"required": false
},
"pushpin_relief": {
"label": "pushpin_relief",
"description": "Set this to 'y' or any non-blank value to use an alternative relief map provided by the selected location map (if a relief map is available).",
"type": "string",
"required": false
},
"pushpin_overlay": {
"label": "pushpin_overlay",
"description": "Can be used to specify an image to be superimposed on the regular pushpin map.",
"type": "string",
"required": false
},
"coordinates": {
"label": "Coordinates",
"description": "Latitude and longitude. Use {{Coord}}. See the documentation for {{Coord}} for more details on usage.",
"type": "wiki-template-name",
"required": false,
"example": "{{coord|41|50|15|N|87|40|55|W}}"
},
"coor_pinpoint": {
"label": "coor_pinpoint",
"description": "If needed, to specify more exactly where (or what) coordinates are given (e.g. 'Town Hall') or a specific place in a larger area (e.g. a city in a county). Example: Masovian Voivodeship",
"type": "string",
"required": false
},
"coordinates_footnotes": {
"label": "coordinates_footnotes",
"description": "Reference(s) for coordinates, placed within <ref> </ref> tags, possibly using the citing format at {{Cite web}}",
"type": "string",
"required": false
},
"subdivision_type": {
"label": "subdivision_type",
"description": "almost always 'Country'",
"type": "string",
"required": false
},
"subdivision_name": {
"label": "subdivision_name",
"description": "Depends on the subdivision_type—use the name in text form, sample: 'United States' or 'United States', flag icons or flag templates can be used in this field.",
"type": "string",
"required": false
},
"subdivision_type1": {
"label": "subdivision_type1",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type2": {
"label": "subdivision_type2",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type3": {
"label": "subdivision_type3",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type4": {
"label": "subdivision_type4",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type5": {
"label": "subdivision_type5",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_type6": {
"label": "subdivision_type6",
"description": "Additional subdivisions Can be State/Province, region, county.",
"type": "string",
"required": false
},
"subdivision_name1": {
"label": "subdivision_name1",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG.",
"type": "string",
"required": false
},
"subdivision_name2": {
"label": "subdivision_name2",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name3": {
"label": "subdivision_name3",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name4": {
"label": "subdivision_name4",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name5": {
"label": "subdivision_name5",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"subdivision_name6": {
"label": "subdivision_name6",
"description": "Use the name in text form, sample: 'Florida' or '[[Florida]]'. Flag icons or flag templates can be used in this field per WP:MOSFLAG..",
"type": "string",
"required": false
},
"established_title": {
"label": "established_title",
"description": "Example: First settled",
"type": "string",
"required": false
},
"established_date": {
"label": "established_date",
"type": "string",
"required": false
},
"established_title1": {
"label": "established_title1",
"description": "Example: Incorporated (town)",
"type": "string",
"required": false
},
"established_date1": {
"label": "established_date1",
"type": "string",
"required": false
},
"established_title2": {
"label": "established_title2",
"description": "Example: Incorporated (city)",
"type": "string",
"required": false
},
"established_date2": {
"label": "established_date2",
"type": "string",
"required": false
},
"established_title3": {
"label": "established_title3",
"type": "string",
"required": false
},
"established_date3": {
"label": "established_date3",
"type": "string",
"required": false
},
"extinct_title": {
"label": "extinct_title",
"description": "For when a settlement ceases to exist",
"type": "string",
"required": false
},
"extinct_date": {
"label": "extinct_date",
"type": "string",
"required": false
},
"founder": {
"label": "founder",
"description": "Who the settlement was founded by",
"type": "string",
"required": false
},
"named_for": {
"label": "named_for",
"description": "The source of the name of the settlement (a person, a place, et cetera)",
"type": "string",
"required": false
},
"seat_type": {
"label": "seat_type",
"description": "The label for the seat of government (defaults to 'Seat').",
"type": "string",
"required": false
},
"seat": {
"label": "seat",
"description": "The seat of government.",
"type": "string",
"required": false
},
"parts_type": {
"label": "parts_type",
"description": "The label for the smaller subdivisions (defaults to 'Boroughs').",
"type": "string",
"required": false
},
"parts_style": {
"label": "parts_style",
"description": "Set to 'list' to display as a collapsible list, 'coll' as a collapsed list, or 'para' to use paragraph style. Default is 'list' for up to 5 items, otherwise 'coll'.",
"type": "string",
"required": false
},
"parts": {
"label": "parts",
"description": "Text or header of the list of smaller subdivisions.",
"type": "string",
"required": false
},
"p1": {
"label": "p1",
"description": "The smaller subdivisions to be listed. Parameters 'p1' to 'p50' can also be used.",
"type": "string",
"required": false
},
"government_footnotes": {
"label": "government_footnotes",
"description": "References for government, placed within <ref> </ref> tags, possibly using the citing format at {{Cite web}}",
"type": "string",
"required": false
},
"government_type": {
"label": "government_type",
"description": "Example: '[[Mayor-council government]]'",
"type": "string",
"required": false
},
"governing_body": {
"label": "governing_body",
"description": "Name of the place's governing body",
"type": "string",
"required": false
},
"leader_party": {
"label": "leader_party",
"description": "Political party of the place's leader",
"type": "string",
"required": false
},
"leader_title": {
"label": "leader_title",
"description": "First title of the place's leader, e.g. Mayor",
"type": "string",
"required": false
},
"leader_name": {
"label": "leader_name",
"description": "Name of the place's leader",
"type": "string",
"required": false
},
"leader_title1": {
"label": "leader_title1",
"description": "First title of the place's leader, e.g. Mayor",
"type": "string",
"required": false
},
"leader_name1": {
"label": "leader_name1",
"description": "Additional names for leaders. Parameters 'leader_name1' .. 'leader_name4' are available. For long lists use {{Collapsible list}}.",
"type": "string",
"required": false
},
"total_type": {
"label": "total_type",
"description": "Specifies what total area and population figure refer to, e.g. 'Greater London'. This overrides other labels for total population/area. To make the total area and population display on the same line as the words Area and Population, with no Total or similar label, set the value of this parameter to ' '.",
"type": "string",
"required": false
},
"unit_pref": {
"label": "unit_pref",
"description": "To change the unit order to 'imperial (metric)', enter 'imperial'. The default display style is 'metric (imperial)'. However, the template will swap the order automatically if the 'subdivision_name' equals some variation of the USA or the UK. For the middle east, a unit preference of dunam can be entered (only affects total area). All values must be entered in a raw format: no commas, spaces, or unit symbols. The template will format them automatically.",
"type": "string",
"required": false
},
"area_footnotes": {
"label": "area_footnotes",
"description": "Reference(s) for area, placed within <ref> </ref> tags, possibly using the citing format at {Cite web}",
"type": "string",
"required": false
},
"area_magnitude": {
"label": "area_magnitude",
"description": "Setting this to any non-empty value will create a link to the appropriate order of magnitude of area page (e.g. [[1 E+6 m²]]).",
"type": "string",
"required": false
},
"dunam_link": {
"label": "dunam_link",
"description": "If dunams are used, the default is to link the word 'dunams' in the total area section. This can be changed by setting 'dunam_link' to another measure (e.g. 'dunam_link=water'). Linking can also be turned off by setting the parameter to something else (e.g. 'dunam_link=none' or 'dunam_link=off').",
"type": "string",
"required": false
},
"area_total_km2": {
"label": "area_total_km2",
"description": "Total area in square kilometers—symbol: km². Value must be entered in raw format, no commas or spaces. Auto-converted to display square miles if area_total_sq_mi is empty.",
"type": "string",
"required": false
},
"area_total_ha": {
"label": "area_total_ha",
"description": "Total area in hectares—symbol: ha. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display acres if area_total_acre is empty.",
"type": "string",
"required": false
},
"area_total_sq_mi": {
"label": "area_total_sq_mi",
"description": "Total area in square miles—symbol: sq mi. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers if area_total_km2 is empty.",
"type": "string",
"required": false
},
"area_total_acre": {
"label": "area_total_acre",
"description": "Total area in acres. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display hectares if 'area_total_ha' is empty.",
"type": "number",
"required": false
},
"area_total_dunam": {
"label": "area_total_dunam",
"description": "Total area in dunams, which is wiki-linked. Used in middle eastern places like Israel, Gaza, and the West Bank. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers or hectares and square miles or acreds if area_total_km2, area_total_ha, area_total_sq_mi, and area_total_acre are empty. Examples: Gaza and Ramallah",
"type": "number",
"required": false
},
"area_land_km2": {
"label": "area_land_km2",
"description": "Land area in square kilometers—symbol: km^2. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square miles if 'area_land_sq_mi' is empty.",
"type": "number",
"required": false
},
"area_land_sq_mi": {
"label": "area_land_sq_mi",
"description": "Land area in square miles—symbol: sq mi. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers if 'area_land_km2' is empty.",
"type": "number",
"required": false
},
"area_land_ha": {
"label": "area_land_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_land_dunam": {
"label": "area_land_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_land_acre": {
"label": "area_land_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_water_km2": {
"label": "area_water_km2",
"description": "Water area in square kilometers symbol: km^2. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square miles if 'area_water_sq_mi' is empty.",
"type": "number",
"required": false
},
"area_water_sq_mi": {
"label": "area_water_sq_mi",
"description": "Water area in square miles symbol: sq mi. Value must be entered in 'raw format', no commas or spaces. Auto-converted to display square kilometers if 'area_water_km2' is empty.",
"type": "number",
"required": false
},
"area_water_ha": {
"label": "area_water_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_water_dunam": {
"label": "area_water_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_water_acre": {
"label": "area_water_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_water_percent": {
"label": "area_water_percent",
"description": "percent of water without the %.",
"type": "number",
"required": false
},
"area_urban_km2": {
"label": "area_urban_km2",
"type": "number",
"required": false
},
"area_urban_sq_mi": {
"label": "area_urban_sq_mi",
"type": "number",
"required": false
},
"area_urban_ha": {
"label": "area_urban_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_urban_dunam": {
"label": "area_urban_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_urban_acre": {
"label": "area_urban_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_rural_km2": {
"label": "area_rural_km2",
"type": "number",
"required": false
},
"area_rural_sq_mi": {
"label": "area_rural_sq_mi",
"type": "number",
"required": false
},
"area_rural_ha": {
"label": "area_rural_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_rural_dunam": {
"label": "area_rural_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_rural_acre": {
"label": "area_rural_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_metro_km2": {
"label": "area_metro_km2",
"type": "number",
"required": false
},
"area_metro_sq_mi": {
"label": "area_metro_sq_mi",
"type": "number",
"required": false
},
"area_metro_ha": {
"label": "area_metro_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_metro_dunam": {
"label": "area_metro_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_metro_acre": {
"label": "area_metro_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_rank": {
"label": "area_rank",
"description": "The settlement's area, as ranked within its parent sub-division",
"type": "string",
"required": false
},
"area_blank1_title": {
"label": "area_blank1_title",
"description": "Example see London",
"type": "string",
"required": false
},
"area_blank1_km2": {
"label": "area_blank1_km2",
"type": "number",
"required": false
},
"area_blank1_sq_mi": {
"label": "area_blank1_sq_mi",
"type": "number",
"required": false
},
"area_blank1_ha": {
"label": "area_blank1_ha",
"description": "similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_blank1_dunam": {
"label": "area_blank1_dunam",
"description": " similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_blank1_acre": {
"label": "area_blank1_acre",
"description": " similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_blank2_title": {
"label": "area_blank2_title",
"type": "string",
"required": false
},
"area_blank2_km2": {
"label": "area_blank2_km2",
"type": "number",
"required": false
},
"area_blank2_sq_mi": {
"label": "area_blank2_sq_mi",
"type": "number",
"required": false
},
"area_blank2_ha": {
"label": "area_blank2_ha",
"description": "Similar to 'area_total_ha'",
"type": "number",
"required": false
},
"area_blank2_dunam": {
"label": "area_blank2_dunam",
"description": "Similar to 'area_total_dunam'",
"type": "number",
"required": false
},
"area_blank2_acre": {
"label": "area_blank2_acre",
"description": "Similar to 'area_total_acre'",
"type": "number",
"required": false
},
"area_note": {
"label": "area_note",
"description": "A place for additional information such as the name of the source.",
"type": "string",
"required": false
},
"dimensions_footnotes": {
"label": "dimensions_footnotes",
"description": "Reference(s) for dimensions, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"length_km": {
"label": "length_km",
"description": "Raw number entered in kilometers. Will automatically convert to display length in miles if length_mi is empty.",
"type": "string",
"required": false
},
"length_mi": {
"label": "length_mi",
"description": "Raw number entered in miles. Will automatically convert to display length in kilometers if length_km is empty.",
"type": "string",
"required": false
},
"width_km": {
"label": "width_km",
"description": "Raw number entered in kilometers. Will automatically convert to display width in miles if length_mi is empty.",
"type": "number",
"required": false
},
"width_mi": {
"label": "width_mi",
"description": "Raw number entered in miles. Will automatically convert to display width in kilometers if length_km is empty.",
"type": "number",
"required": false
},
"elevation_footnotes": {
"label": "elevation_footnotes",
"description": "Reference(s) for elevation, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"elevation_m": {
"label": "elevation_m",
"description": "Raw number entered in meters. Will automatically convert to display elevation in feet if elevation_ft is empty. However, if a range in elevation (i.e. 5–50 m ) is desired, use the 'max' and 'min' fields below",
"type": "number",
"required": false
},
"elevation_ft": {
"label": "elevation_ft",
"description": "Raw number, entered in feet. Will automatically convert to display the average elevation in meters if 'elevation_m' field is empty. However, if a range in elevation (i.e. 50–500 ft ) is desired, use the 'max' and 'min' fields below",
"type": "number",
"required": false
},
"elevation_min_m": {
"label": "elevation_min_m",
"type": "number",
"required": false
},
"elevation_min_ft": {
"label": "elevation_min_ft",
"type": "number",
"required": false
},
"elevation_max_footnotes": {
"label": "elevation_max_footnotes",
"type": "string",
"required": false
},
"elevation_min_footnotes": {
"label": "elevation_min_footnotes",
"type": "string",
"required": false
},
"population_total": {
"label": "population_total",
"description": "Actual population (see below for estimates) preferably consisting of digits only (without any commas)",
"type": "string",
"required": false
},
"population_as_of": {
"label": "population_as_of",
"description": "The year for the population total (usually a census year)",
"type": "string",
"required": false
},
"population_footnotes": {
"label": "population_footnotes",
"description": "Reference(s) for population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_km2": {
"label": "population_density_km2",
"type": "number",
"required": false
},
"population_density_sq_mi": {
"label": "population_density_sq_mi",
"type": "number",
"required": false
},
"population_est": {
"label": "population_est",
"description": "Population estimate.",
"type": "number",
"required": false
},
"pop_est_as_of": {
"label": "pop_est_as_of",
"description": "The year or month & year of the population estimate",
"type": "string",
"required": false
},
"pop_est_footnotes": {
"label": "pop_est_footnotes",
"description": "Reference(s) for population estimate, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_urban": {
"label": "population_urban",
"type": "string",
"required": false
},
"population_urban_footnotes": {
"label": "population_urban_footnotes",
"description": "Reference(s) for urban population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_urban_km2": {
"label": "population_density_urban_km2",
"type": "number",
"required": false
},
"population_density_urban_sq_mi": {
"label": "population_density_urban_sq_mi",
"type": "number",
"required": false
},
"population_rural": {
"label": "population_rural",
"type": "string",
"required": false
},
"population_rural_footnotes": {
"label": "population_rural_footnotes",
"description": "Reference(s) for rural population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_rural_km2": {
"label": "population_density_rural_km2",
"type": "number",
"required": false
},
"population_density_rural_sq_mi": {
"label": "population_density_rural_sq_mi",
"type": "number",
"required": false
},
"population_metro": {
"label": "population_metro",
"type": "string",
"required": false
},
"population_metro_footnotes": {
"label": "population_metro_footnotes",
"description": "Reference(s) for metro population, placed within <nowiki><ref> </ref></nowiki> tags",
"type": "string",
"required": false
},
"population_density_metro_km2": {
"label": "population_density_metro_km2",
"type": "number",
"required": false
},
"population_density_metro_sq_mi": {
"label": "population_density_metro_sq_mi",
"type": "number",
"required": false
},
"population_rank": {
"label": "population_rank",
"description": "The settlement's population, as ranked within its parent sub-division",
"type": "string",
"required": false
},
"population_density_rank": {
"label": "population_density_rank",
"description": "The settlement's population density, as ranked within its parent sub-division",
"type": "string",
"required": false
},
"population_blank1_title": {
"label": "population_blank1_title",
"description": "Can be used for estimates. Example: Windsor, Ontario",
"type": "string",
"required": false
},
"population_blank1": {
"label": "population_blank1",
"description": "The population value for blank1_title",
"type": "string",
"required": false
},
"population_density_blank1_km2": {
"label": "population_density_blank1_km2",
"type": "string",
"required": false
},
"population_density_blank1_sq_mi": {
"label": "population_density_blank1_sq_mi",
"type": "string",
"required": false
},
"population_blank2_title": {
"label": "population_blank2_title",
"type": "string",
"required": false
},
"population_blank2": {
"label": "population_blank2",
"type": "string",
"required": false
},
"population_density_blank2_km2": {
"label": "population_density_blank2_km2",
"type": "string",
"required": false
},
"population_density_blank2_sq_mi": {
"label": "population_density_blank2_sq_mi",
"type": "string",
"required": false
},
"population_demonym": {
"label": "population_demonym",
"description": "A demonym or gentilic is a word that denotes the members of a people or the inhabitants of a place. For example a citizen in Liverpool is known as a Liverpudlian.",
"type": "string",
"required": false
},
"population_note": {
"label": "population_note",
"description": "A place for additional information such as the name of the source. See Windsor, Ontario for example.",
"type": "string",
"required": false
},
"demographics_type1": {
"label": "demographics_type1",
"description": "Section Header. For example: Ethnicity",
"type": "string",
"required": false
},
"demographics1_footnotes": {
"label": "demographics1_footnotes",
"description": "Reference(s) for demographics section 1, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"demographics1_title1": {
"label": "demographics1_title1",
"description": "Titles related to demographics_type1. For example: White, Black, Hispanic... Additional rows 'demographics1_title1' to 'demographics1_title5' are also available",
"type": "string",
"required": false
},
"demographics1_info5": {
"label": "demographics1_info5",
"description": "Information related to the titles. For example: 50%, 25%, 10%... Additional rows 'demographics1_info1' to 'demographics1_info5' are also available",
"type": "string",
"required": false
},
"demographics_type2": {
"label": "demographics_type2",
"description": "A second section header. For example: Languages",
"type": "string",
"required": false
},
"demographics2_footnotes": {
"label": "demographics2_footnotes",
"description": "Reference(s) for demographics section 2, placed within <nowiki><ref> </ref></nowiki> tags, possibly using the citing format at {{tl|Cite web}}",
"type": "string",
"required": false
},
"demographics2_title1": {
"label": "demographics2_title1",
"description": "Titles related to demographics_type1. For example: English, French, Arabic... Additional rows 'demographics2_title2' to 'demographics1_title5' are also available",
"type": "string",
"required": false
},
"demographics2_info1": {
"label": "demographics2_info1",
"description": "Information related to the titles. For example: 50%, 25%, 10%... Additional rows 'demographics2_info2' to 'demographics2_info5' are also available",
"type": "string",
"required": false
},
"timezone1": {
"label": "timezone1",
"type": "string",
"required": false
},
"utc_offset1": {
"label": "utc_offset1",
"type": "string",
"required": false
},
"timezone1_DST": {
"label": "timezone1_DST",
"type": "string",
"required": false
},
"utc_offset1_DST": {
"label": "utc_offset1_DST",
"type": "string",
"required": false
},
"timezone2": {
"label": "timezone2",
"description": "A second timezone field for larger areas such as a Province.",
"type": "string",
"required": false
},
"utc_offset2": {
"label": "utc_offset2",
"type": "string",
"required": false
},
"timezone2_DST": {
"label": "timezone2_DST",
"type": "string",
"required": false
},
"utc_offset2_DST": {
"label": "utc_offset2_DST",
"type": "string",
"required": false
},
"postal_code_type": {
"label": "postal_code_type",
"description": "Label used for postal code info, e.g. 'ZIP Code'. Defaults to 'Postal code'.",
"type": "string",
"required": false
},
"postal_code": {
"label": "postal_code",
"description": "Postal code/zip code",
"type": "string",
"required": false
},
"postal2_code_type": {
"label": "postal2_code_type",
"type": "string",
"required": false
},
"postal2_code": {
"label": "postal2_code",
"type": "string",
"required": false
},
"area_code": {
"label": "area_code",
"description": "Telephone area code.",
"type": "string",
"required": false
},
"area_code_type": {
"label": "area_code_type",
"description": "If left blank/not used template will default to 'Area code(s)'",
"type": "string",
"required": false
},
"geocode": {
"label": "geocode",
"description": "See Geocode",
"type": "string",
"required": false
},
"iso_code": {
"label": "iso_code",
"description": "See ISO 3166",
"type": "string",
"required": false
},
"registration_plate": {
"label": "registration_plate",
"description": "See Vehicle registration plate",
"type": "string",
"required": false
},
"blank_name_sec1": {
"label": "blank_name_sec1",
"description": "Fields used to display other information. The name is displayed in bold on the left side of the infobox.",
"type": "string",
"required": false
},
"blank_info_sec1": {
"label": "blank_info_sec1",
"description": "The information associated with the ''blank_name'' heading. The info is displayed on right side of infobox, in the same row as the name. For an example, see: [[Warsaw]]",
"type": "string",
"required": false
},
"blank1_name_sec1": {
"label": "blank1_name_sec1",
"description": "Up to 7 additional fields 'blank1_name_sec1' ... 'blank7_name_sec1' can be specified",
"type": "string",
"required": false
},
"blank1_info_sec1": {
"label": "blank1_info_sec1",
"description": "Up to 7 additional fields 'blank1_info_sec1' ... 'blank7_info_sec1' can be specified",
"type": "string",
"required": false
},
"blank_name_sec2": {
"label": "blank_name_sec2",
"description": "For a second section of blank fields",
"type": "string",
"required": false
},
"blank_info_sec2": {
"label": "blank_info_sec2",
"description": "Example: Beijing",
"type": "string",
"required": false
},
"blank1_name_sec2": {
"label": "blank1_name_sec2",
"description": "Up to 7 additional fields 'blank1_name_sec2' ... 'blank7_name_sec2' can be specified",
"type": "string",
"required": false
},
"blank1_info_sec2": {
"label": "blank1_info_sec2",
"description": "Up to 7 additional fields 'blank1_info_sec2' ... 'blank7_info_sec2' can be specified",
"type": "string",
"required": false
},
"website": {
"label": "website",
"description": "External link to official website, Use the {{URL}} template, thus: {{URL|example.com}}",
"type": "string",
"required": false
},
"footnotes": {
"label": "footnotes",
"description": "Text to be displayed at the bottom of the infobox.",
"type": "string",
"required": false
}
},
"format": "{{_\n| _______________________________ = _\n}}\n",
"paramOrder": [
"name",
"official_name",
"native_name",
"native_name_lang",
"other_name",
"settlement_type",
"translit_lang1",
"translit_lang1_type",
"translit_lang1_info",
"translit_lang2",
"image_skyline",
"imagesize",
"image_alt",
"image_caption",
"image_flag",
"flag_size",
"flag_alt",
"flag_border",
"flag_link",
"image_seal",
"seal_size",
"seal_alt",
"seal_link",
"image_shield",
"shield_size",
"shield_alt",
"shield_link",
"image_blank_emblem",
"blank_emblem_type",
"blank_emblem_size",
"blank_emblem_alt",
"blank_emblem_link",
"nickname",
"motto",
"anthem",
"image_map",
"mapsize",
"map_alt",
"map_caption",
"image_map1",
"mapsize1",
"map_alt1",
"map_caption1",
"pushpin_map",
"pushpin_label_position",
"pushpin_map_alt",
"pushpin_mapsize",
"pushpin_map_caption",
"pushpin_relief",
"pushpin_overlay",
"coordinates",
"coor_pinpoint",
"coordinates_footnotes",
"subdivision_type",
"subdivision_name",
"subdivision_type1",
"subdivision_type2",
"subdivision_type3",
"subdivision_type4",
"subdivision_type5",
"subdivision_type6",
"subdivision_name1",
"subdivision_name2",
"subdivision_name3",
"subdivision_name4",
"subdivision_name5",
"subdivision_name6",
"established_title",
"established_date",
"established_title1",
"established_date1",
"established_title2",
"established_date2",
"established_title3",
"established_date3",
"extinct_title",
"extinct_date",
"founder",
"named_for",
"seat_type",
"seat",
"parts_type",
"parts_style",
"parts",
"p1",
"government_footnotes",
"government_type",
"governing_body",
"leader_party",
"leader_title",
"leader_name",
"leader_title1",
"leader_name1",
"total_type",
"unit_pref",
"area_footnotes",
"area_magnitude",
"dunam_link",
"area_total_km2",
"area_total_ha",
"area_total_sq_mi",
"area_total_acre",
"area_total_dunam",
"area_land_km2",
"area_land_sq_mi",
"area_land_ha",
"area_land_dunam",
"area_land_acre",
"area_water_km2",
"area_water_sq_mi",
"area_water_ha",
"area_water_dunam",
"area_water_acre",
"area_water_percent",
"area_urban_km2",
"area_urban_sq_mi",
"area_urban_ha",
"area_urban_dunam",
"area_urban_acre",
"area_rural_km2",
"area_rural_sq_mi",
"area_rural_ha",
"area_rural_dunam",
"area_rural_acre",
"area_metro_km2",
"area_metro_sq_mi",
"area_metro_ha",
"area_metro_dunam",
"area_metro_acre",
"area_rank",
"area_blank1_title",
"area_blank1_km2",
"area_blank1_sq_mi",
"area_blank1_ha",
"area_blank1_dunam",
"area_blank1_acre",
"area_blank2_title",
"area_blank2_km2",
"area_blank2_sq_mi",
"area_blank2_ha",
"area_blank2_dunam",
"area_blank2_acre",
"area_note",
"dimensions_footnotes",
"length_km",
"length_mi",
"width_km",
"width_mi",
"elevation_footnotes",
"elevation_m",
"elevation_ft",
"elevation_min_m",
"elevation_min_ft",
"elevation_max_footnotes",
"elevation_min_footnotes",
"population_total",
"population_as_of",
"population_footnotes",
"population_density_km2",
"population_density_sq_mi",
"population_est",
"pop_est_as_of",
"pop_est_footnotes",
"population_urban",
"population_urban_footnotes",
"population_density_urban_km2",
"population_density_urban_sq_mi",
"population_rural",
"population_rural_footnotes",
"population_density_rural_km2",
"population_density_rural_sq_mi",
"population_metro",
"population_metro_footnotes",
"population_density_metro_km2",
"population_density_metro_sq_mi",
"population_rank",
"population_density_rank",
"population_blank1_title",
"population_blank1",
"population_density_blank1_km2",
"population_density_blank1_sq_mi",
"population_blank2_title",
"population_blank2",
"population_density_blank2_km2",
"population_density_blank2_sq_mi",
"population_demonym",
"population_note",
"demographics_type1",
"demographics1_footnotes",
"demographics1_title1",
"demographics1_info5",
"demographics_type2",
"demographics2_footnotes",
"demographics2_title1",
"demographics2_info1",
"timezone1",
"utc_offset1",
"timezone1_DST",
"utc_offset1_DST",
"timezone2",
"utc_offset2",
"timezone2_DST",
"utc_offset2_DST",
"postal_code_type",
"postal_code",
"postal2_code_type",
"postal2_code",
"area_code",
"area_code_type",
"geocode",
"iso_code",
"registration_plate",
"blank_name_sec1",
"blank_info_sec1",
"blank1_name_sec1",
"blank1_info_sec1",
"blank_name_sec2",
"blank_info_sec2",
"blank1_name_sec2",
"blank1_info_sec2",
"website",
"footnotes"
]
}
</templatedata>
{{collapse bottom}}
== Tracking categories ==
* {{clc|Settlement articles requiring maintenance}}
* {{clc|Infobox settlement uses with imprecise region codes}}
* {{clc|Pages using infobox settlement with a dot map}}
* {{clc|Pages using infobox settlement with the image parameter}}
* {{clc|Pages using infobox settlement with unknown parameters}}
* {{clc|Pages using infobox settlement with the wikidata parameter}}
* {{clc|Infobox settlement pages with bad settlement type}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:City infobox templates|Settlement]]
[[Category:Geography infobox templates|Settlement]]
[[Category:Infobox templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
51d307c3b4975e22a2f278ae87075c1fba0aad51
Template:Infobox settlement/impus
10
53
105
104
2024-06-03T23:42:49Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{formatnum:{{{impv}}}{{{s| }}}{{{impu|ft}}}{{#ifeq:{{{impv|0}}}|1||{{#ifeq:{{{s}}}|/||{{#ifeq:{{{impu}}}|acre|s}}}}}} ({{{metv}}}{{{s| }}}{{{metu|m}}})}}</includeonly><noinclude>
{{documentation}}
</noinclude>
dda38e109b88a534c8c1e05229f03ba2025505bb
Template:Infobox settlement/impus/mag
10
54
107
106
2024-06-03T23:42:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{formatnum:[[1 E+{{order of magnitude|({{{metv|1}}}E{{#ifeq:{{{metu}}}|ha|4|6}})}}_m²|{{{impv}}}{{{s| }}}{{{impu|ft}}}{{#ifeq:{{{impv|0}}}|1||{{#ifeq:{{{s}}}|/||{{#ifeq:{{{impu}}}|acre|s}}}}}}]] ({{{metv}}}{{{s| }}}{{{metu|m}}})}}</includeonly><noinclude>
{{documentation}}
</noinclude>
8da7df52cbe6d9ab4d42df8f735aa5f59ce0620a
Template:Infobox settlement/lengthdisp
10
55
109
108
2024-06-03T23:42:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{infobox settlement/{{infobox settlement/pref|{{{pref}}}|{{{name}}}}}
|metv={{#if:{{{km|}}}{{{m|}}}
|{{{km|}}}{{{m|}}}
|{{#if:{{{mi|}}}
|{{rnd
|{{#expr:{{formatnum:{{{mi}}}|R}}*1.609344}}
|{{precision|{{formatnum:{{{mi}}}|R}}}}
}}
|{{rnd
|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}
|{{max/2
|{{precision|{{formatnum:{{{ft}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{ft}}}|R}}*0.3048}}}}
}}
}}
}}
}}
|metu={{#if:{{{km|}}}{{{mi|}}}|k}}m
|impv={{#if:{{{mi|}}}{{{ft|}}}
|{{{mi|}}}{{{ft|}}}
|{{#if:{{{km|}}}
|{{rnd
|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}
|{{max/2
|{{precision|{{formatnum:{{{km}}}|R}}}}
|-{{Order of magnitude|{{#expr:{{formatnum:{{{km}}}|R}}/1.609344}}}}
}}
}}
|{{rnd
|{{#expr:{{formatnum:{{{m}}}|R}}/0.3048}}
|{{precision|{{formatnum:{{{m}}}|R}}}}
}}
}}
}}
|impu={{#if:{{{km|}}}{{{mi|}}}|mi|ft}}
}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
ead48cdb9b6be6cff9f0957b80c5b3bc81f5cba4
Template:Infobox settlement/pref
10
56
111
110
2024-06-03T23:42:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#switch:{{ucfirst:{{{1}}}}}
|Imperial
|English
|UK|US|U.S.
|US Customary|U.S. Customary
|Standard = impus
|{{#switch:{{{2}}}
|[[United Kingdom]]|United Kingdom
|[[United States]]|United States
|[[United States of America]]|United States of America
|[[United States|United States of America]]
|[[Image:Flag of the United States.svg|20px]] [[United States]] = impus
|{{#ifeq:{{{3}}}_{{lc:{{{1}}}}}|area_dunam|dunam|metric}}
}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
7f7165e08b34afaaf9f84a31965beb8f3e8a21b8
Template:Intricate template
10
57
113
112
2024-06-03T23:42:51Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ombox
| type = style
| image = [[Image:Ambox warning yellow.svg|40x40px|alt=|link=]]
| text =
'''This {{{namespace|template}}} employs intricate features of template syntax.'''
<div style="padding-bottom:2px;">You are encouraged to familiarise yourself with its setup and [[m:Help:Parser function|parser functions]] before editing the template. If your edit causes unexpected problems, please [[Help:Reverting#Undo|undo]] it quickly, as this template may appear on a large number of pages.<br/>
You can conduct experiments, and should test all major changes, in either <span class="nowraplinks">[[{{#ifexist:{{FULLPAGENAME}}/Sandbox|/Sandbox|{{#ifexist:{{FULLPAGENAME}}/test sandbox|/test sandbox|{{#ifexist:{{FULLPAGENAME}}/Test sandbox|/Test sandbox|{{#ifexist:{{FULLPAGENAME}}/test|/test|{{#ifexist:{{FULLPAGENAME}}/Test|/Test|/sandbox}}}}}}}}}}|this template's sandbox]]</span>, the [[Template:Template sandbox|general template sandbox]], or your user space before changing anything here.</div>
}}<includeonly>{{#ifeq: {{PAGENAME}} | {{BASEPAGENAME}} | [[Category:Intricate templates]] }}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
591b77da2109625af171ef6249f7550e7728f835
Template:Lang-fr
10
58
115
114
2024-06-03T23:42:51Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=fr
}}</includeonly><noinclude>
{{documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates]]
{{En-WP attribution notice|Template:Lang-fr}}
</noinclude>
14cf10941463c55598f55c6b732b59970e7b9be1
Template:Lang-la
10
59
117
116
2024-06-03T23:42:51Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=la
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Italic multilingual support templates|Lang-la]]
</noinclude>
857a9546fa526081f76dedb413402ec3abe57e3f
Template:Lang-mia
10
60
119
118
2024-06-03T23:42:52Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:lang|lang_xx_italic
|code=mia
}}</includeonly><noinclude>
{{Documentation|Template:Lang-x/doc}}
[[Category:Native American multilingual support templates]]
</noinclude>
62c4605b15908cf267b9bdcd26e7ef179a9d2f35
Template:Location map
10
61
121
120
2024-06-03T23:42:52Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Location map|main}}</includeonly><noinclude>{{documentation}}</noinclude>
732416b8068d2dc3549db5aa5ffa786beb502886
Template:Lua
10
62
123
122
2024-06-03T23:42:52Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{Lua|Module:Lua banner}}
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
dba3962144dacd289dbc34f50fbe0a7bf6d7f2f7
Template:Max
10
63
125
124
2024-06-03T23:42:53Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|max}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
f052e3a9b5b08740be624045e49f31d86e09f0ad
Template:Max/2
10
64
127
126
2024-06-03T23:42:53Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#redirect [[Template:Max]]
20f0291b77f878e1754f580aab1804aca4fe429f
Template:Module other
10
65
129
128
2024-06-03T23:42:53Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
| {{#ifeq:{{NAMESPACE}}|{{ns:Module}}
| module
| other
}}
}}
| module = {{{1|}}}
| other
| #default = {{{2|}}}
}}<!--End switch--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
{{En-WP attribution notice|Template:Module other}}
</noinclude>
ceeac5e173d56465ffa326b9da4297ae8e8332ed
Template:Ombox
10
66
131
130
2024-06-03T23:42:54Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Message box|ombox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
0e54065432d540737b9e56c4e3a8e7f74d4534ea
Template:Order of magnitude
10
67
133
132
2024-06-03T23:42:54Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{{{{|safesubst:}}}#ifexpr:{{{1|0}}}=0
|{{{{{|safesubst:}}}#ifexpr:abs{{{1|0}}}1=1
|0
|{{{{{|safesubst:}}}#expr:floor((ln(abs{{{1}}}1)/ln10)+1)}}
}}
|{{#expr:floor((ln(abs({{{1|0}}}) )/ln 10)+1E((abs{{{1|0}}}>1E100 or abs{{{1|0}}}<1E-100)-14))}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
cdfaf15a862b5c629573701fb54acfb4ebf6e9d5
Template:Polparty
10
68
135
134
2024-06-03T23:42:54Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch: {{ucfirst:{{{1}}}}}
| AT | Austria | [[Austria]] = {{#switch: {{uc:{{{2}}}}}
| SPÖ = [[Social Democratic Party of Austria|SPÖ]]
| ÖVP = [[Austrian People's Party|ÖVP]]
| FPÖ = [[Freedom Party of Austria|FPÖ]]
| BZÖ = [[Alliance for the Future of Austria|BZÖ]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| AU | Australia | [[Australia]] = {{#switch: {{uc:{{{2}}}}}
| ALP = [[Australian Labor Party|ALP]]
| CLP = [[Country Liberal Party|CLP]]
| LP = [[Liberal Party of Australia|Lib.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrats | Dem = [[Australian Democrats|Dem.]]
| Greens | Green = [[Australian Greens|Greens]]
| Labor | Lab = [[Australian Labor Party|ALP]]
| Liberal | Lib = [[Liberal Party of Australia|Lib.]]
| National | Nat = [[National Party of Australia|Nat.]]
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| CA | Canada | [[Canada]] = {{#switch: {{uc:{{{2}}}}}
| BQ = [[Bloc Québécois|BQ]]
| CPC = [[Conservative Party of Canada|CPC]]
| LPC = [[Liberal Party of Canada|LPC]]
| NDP = [[New Democratic Party|NDP]]
| GPC = [[Green Party of Canada|Green]]
| FPNP = [[First Peoples National Party of Canada|FPNP]]
| CHP = [[Christian Heritage Party of Canada|CHP]]
| WBP = [[Western Block Party|WBP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| CZ | Czechia | [[Czechia]] | [[Czech Republic]] | Czech Republic = {{#switch: {{uc:{{{2}}}}}
| ODS = [[Civic Democratic Party|ODS]]
| CSSD = [[Czech Social Democratic Party|ČSSD]]
| KSCM = [[Communist Party of Bohemia and Moravia|KSČM]]
| KDU-CSL = [[Christian and Democratic Union – Czechoslovak People's Party|KDU-ČSL]]
| SZ = [[Green Party (Czech Republic)|Greens]]
| US-DEU = [[Freedom Union–Democratic Union|US-DEU]]
| LIRA = [[Liberal Reform Party|LIRA]]
| SNK = [[SNK European Democrats|SNK ED]]
| NEZDEM = [[Independent Democrats (Czech Republic)|Ind. Dem.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| DE | Germany | [[Germany]] = {{#switch: {{uc:{{{2}}}}}
| CDU = [[Christian Democratic Union (Germany)|CDU]]
| CSU = [[Christian Social Union of Bavaria|CSU]]
| SPD = [[Social Democratic Party of Germany|SPD]]
| FDP = [[Free Democratic Party (Germany)|FDP]]
| PDS = [[The Left (Germany)|Left]]
| FW |FWG = [[Freie Wähler|FW]]
| DDP = [[German Democratic Party|DDP]]
| NS | NSDAP = [[Nazi Party|NSDAP]]
| ODP | ÖDP = [[Ecological Democratic Party|ÖDP]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Left | Linke | The Left = [[The Left (Germany)|Left]]
| Green | Greens | Grün | Grüne | Bündnis 90/Die Grünen = [[Alliance '90/The Greens|Greens]]
| Freie Wähler | Freie wähler = [[Freie Wähler|FW]]
| Centre | Zentrum = [[Centre Party (Germany)|Centre]]
| Nazi = [[Nazi Party|NSDAP]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| NL | Netherlands | [[Netherlands]] | The Netherlands | [[The Netherlands]] | Holland | NL = {{#switch: {{uc:{{{2}}}}}
| CDA = [[Christian Democratic Appeal|CDA]]
| CU = [[ChristianUnion|CU]]
| D66 = [[Democrats 66|D66]]
| GL = [[GreenLeft|GL]]
| PVV = [[Party for Freedom|PVV]]
| SGP = [[Reformed Political Party|SGP]]
| SP = [[Socialist Party (Netherlands)|SP]]
| VVD = [[People's Party for Freedom and Democracy|VVD]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Groen = [[GreenLeft|GL]]
| PvdA | Pvda = [[Labour Party (Netherlands)|PvdA]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| CH | Switzerland | [[Switzerland]] = {{#switch: {{uc:{{{2}}}}}
| FDP | PRD | RAD | FDP/PRD = [[Free Democratic Party of Switzerland|FDP/PRD]]
| PLR = [[Free Democratic Party of Switzerland|FDP/PRD/PLR]]
| PLC = [[Free Democratic Party of Switzerland|FDP/PRD/PLC]]
| SPS | PSS | SP | PS | SP/PS | SPS/PSS | SOC = [[Social Democratic Party of Switzerland|SPS/PSS]]
| SVP | UDC | SVP/UDC = [[Swiss People's Party|SVP/UDC]]
| PPS = [[Swiss People's Party|SVP/UDC/PPS]]
| CVP | PDC | CVP/PDC = [[Christian Democratic People's Party of Switzerland|CVP/PDC]]
| PPD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PPD]]
| PCD = [[Christian Democratic People's Party of Switzerland|CVP/PDC/PCD]]
| GPS | PES = [[Green Party of Switzerland|GPS/PES]]
| GLP = [[Green Liberal Party of Switzerland|GLP]]
| PLS | LPS | LIB = [[Liberal Party of Switzerland|LPS/PLS]]
| EVP | PEV = [[Evangelical People's Party of Switzerland|EVP/PEV]]
| Ticino League | Lega = [[Ticino League]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green = [[Green Party of Switzerland|GPS]]
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = [[List of political parties in Switzerland|{{{2}}}]] }}
}}
| US | United States | [[United States]] | USA | [[USA]] = {{#switch: {{uc:{{{2}}}}}
| D = [[Democratic Party (United States)|D]]
| R = [[Republican Party (United States)|R]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Democrat = [[Democratic Party (United States)|D]]
| Republican = [[Republican Party (United States)|R]]
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| ZA | South Africa | [[South Africa]] = {{#switch: {{uc:{{{2}}}}}
| ANC | African National Congress = [[African National Congress|ANC]]
| DA | Democratic Alliance = [[Democratic Alliance (South Africa)|DA]]
| IFP | Inkatha Freedom Party = [[Inkatha Freedom Party|IFP]]
| NFP | National Freedom Party = [[National Freedom Party|NFP]]
| COPE | Congress of the People = [[Congress of the People (South African political party)|COPE]]
| FF+ | Freedom Front Plus = [[Freedom Front Plus]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Green | Greens | Grün | Grüne = [[The Greens – The Green Alternative|Green]]
| Independent | Ind | Neutral | Parteilos | [[Parteilos]] | [[parteilos]] = [[Independent (politician)|Ind.]]
| #default = {{{2}}} }}
}}
| Independent | [[Independent]] | Ind | Ind. | Neutral = [[Independent (politician)|Ind.]]
| #default = {{#switch: {{ucfirst: {{{2}}} }}
| Independent | Ind | Neutral = [[Independent (politician)|Ind.]]
| #default = {{{2|{{{1|}}}}}} }}
}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
8c1c0927009300f0af978af00757aa82a1c90103
Template:Precision
10
69
137
136
2024-06-03T23:42:55Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Math|precision|{{{1|0}}}|check_fraction=true}}</includeonly><noinclude>
{{documentation}}
</noinclude>
944a0e5e6c5ace1e2a418c7969c645313b30395a
Template:Reflist
10
70
139
138
2024-06-03T23:42:55Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div class="reflist <!--
-->{{#if: {{{1|}}} {{{colwidth|}}}
| columns references-column-width
}}" style="<!--
-->{{#if: {{{1|}}}
| {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }}
| {{column-width|1={{{1}}}}}
| {{#switch:{{{1|}}}|1=|2={{column-width|1=30em}}|#default={{column-width|1=25em}}}} }}
| {{#if: {{{colwidth|}}}
| {{column-width|1={{{colwidth}}}}} }} }} list-style-type: <!--
-->{{{liststyle|{{#switch: {{{group|}}}
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = {{{group}}}
| #default = decimal}}}}};">
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}</div>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using reflist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Reflist]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | colwidth | group | liststyle | refs }}<noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Reflist}}
</noinclude>
29e8d6771e0595df828d3e17eaf9f10eedc93e6b
Template:Remove first word
10
71
141
140
2024-06-03T23:42:56Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude>
df7a9e692f68be1581be06af5f51eaed5483b4c8
Template:Rnd
10
72
143
142
2024-06-03T23:42:56Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#iferror:{{#expr:{{{2|0}}}}} |
[[Category:Pages with bad rounding precision]]{{hid|Bad rounding here}}<!--
-->{{#invoke:Math|precision_format| {{{1}}} | 1-{{order of magnitude|{{{1}}}}} }}|
{{#invoke:Math|precision_format| {{{1}}} | {{{2|0}}}}}}}</includeonly><noinclude>
{{documentation}}
</noinclude>
eeffdb0228ab9358f619fbdd6639bbcc43095edf
Template:Sandbox other
10
73
145
144
2024-06-03T23:42:56Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#if:{{#ifeq:{{#invoke:String|sublength|s={{SUBPAGENAME}}|i=0|len=7}}|sandbox|1}}{{#ifeq:{{SUBPAGENAME}}|doc|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}<!--
--><noinclude>{{documentation}}</noinclude>
91e4ae891d6b791615152c1fbc971414961ba872
Template:Side box
10
74
147
146
2024-06-03T23:42:56Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Side box|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Side box}}
</noinclude>
12769bea87e40d845a35eaaa6e7be586354bffa3
Template:Sister project
10
75
149
148
2024-06-03T23:42:57Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Side box
| metadata=no
| position = {{{position|}}}
| image =
{{#switch: {{{image|}}}
| none = <!-- "image=none", do nothing -->
| = <!-- No image fed, select an image -->
[[File:{{#switch: {{lc: {{{project|}}} }}
| commons = Commons-logo.svg
| meta|metawiki|m = Wikimedia Community Logo.svg
| wikibooks|wbk|wb|b = Wikibooks-logo-en-noslogan.svg
| wikidata|data = Wikidata-logo.svg
| wikiquote|quote|wqt|q = Wikiquote-logo.svg
| wikipedia|wp|w = Wikipedia-logo-v2.svg
| wikisource|source|ws|s = Wikisource-logo.svg
| wiktionary|wkt|wdy|d = Wiktionary-logo-en-v2.svg
| wikinews|news|wnw|n = Wikinews-logo.svg
| wikispecies|species = Wikispecies-logo.svg
| wikiversity|wvy|v = Wikiversity-logo.svg
| wikivoyage|voyage|voy = Wikivoyage-Logo-v3-icon.svg
| mediawiki|mw = Mediawiki.png
| outreachwiki|outreach = Wikimedia Outreach.png
| incubator = Incubator-notext.svg
| #default = Wikimedia-logo.svg
}}|40x40px|class=noviewer|alt=|link=
]]
| #default = {{{image|}}}
}}
| text = {{{text}}}
| below = {{{below|}}}
| imageright = {{{imageright|}}}
| class = plainlinks sistersitebox
}}<noinclude>{{Documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! -->{{En-WP attribution notice|Template:Sister project}}</noinclude>
1cebc91d76736248f563c18ef77654e9513d2a3e
Template:Str left
10
76
151
150
2024-06-03T23:42:57Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
2048b0d7b35e156528655b1d090e8b5ffab3f400
Template:TemplateData header
10
77
153
152
2024-06-03T23:42:58Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div class="templatedata-header">{{#if:{{{noheader|}}}|<!--
noheader:
-->{{Template parameter usage|{{{1|{{BASEPAGENAME}}}}}|based=y}}|<!--
+header:
-->This is the {{#if:{{{nolink|}}}|<!--
+header, nolink TD
-->TemplateData|<!--
+header, +link [[TD]]; DEFAULT:
-->[[Wikipedia:TemplateData|TemplateData]]}}<!--
e.o. #if:nolink; DEFAULT:
--> for this template used by [[mw:Extension:TemplateWizard|TemplateWizard]], [[Wikipedia:VisualEditor|VisualEditor]] and other tools. {{Template parameter usage|{{{1|{{BASEPAGENAME}}}}}|based=y}}<!--
e.o. #if:noheader
-->}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
</div><includeonly><!--
check parameters
-->{{#invoke:Check for unknown parameters|check
|unknown={{template other|1=[[Category:Pages using TemplateData header with unknown parameters|_VALUE_]]}}
|template=Template:TemplateData header
|1 |nolink |noheader
|preview=<div class="error" style="font-weight:normal">Unknown parameter '_VALUE_' in [[Template:TemplateData header]].</div>
}}<!--
-->{{template other|{{sandbox other||
[[Category:Templates using TemplateData]]
}}}}</includeonly><!--
--><noinclude>{{Documentation}}</noinclude>
748b89c815a11e78b365c5617460ea569f3f96cb
Template:Template link
10
78
155
154
2024-06-03T23:42:58Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
91be693cd63410db06fc933eddb412ba433564dc
Template:Template parameter usage
10
79
157
156
2024-06-03T23:42:58Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{{label|}}}
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|S|s}}ee a monthly parameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|this template}} in articles{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{#ifeq:{{yesno-no|{{{lc}}}}}|no|P|p}}arameter usage report] for {{#if:{{{1|}}}|[[Template:{{ROOTPAGENAME:{{{1|}}}}}]]|[[Template:{{ROOTPAGENAME}}]]}}{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}.
|#default=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{#if:{{{1|}}}|{{ROOTPAGENAME:{{{1|}}}}}|{{ROOTPAGENAME}}}}}} {{{label|}}}]{{#ifeq:{{yesno-no|{{{based}}}}}|yes| based on {{#if:{{{1|}}}|its|this}} TemplateData}}
}}<noinclude>
{{documentation}}
</noinclude>
83e574f5e031df639a2cdcef5b91d6b1094ae648
Template:Tl
10
80
159
158
2024-06-03T23:42:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
fb9a6b420e13178e581af6e7d64274cd30a79017
Template:UF-hcard-geo
10
81
161
160
2024-06-03T23:42:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard| hCard microformat]], which makes the place-name and location [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to an address book. Within the hCard is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[Geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
If the place or venue has an "established", "founded", "opened" or similar date, use {{tl|start date}} [[Wikipedia:WikiProject Microformats/dates|unless the date is before 1583 CE]].
If it has a URL, use {{tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist/microformat|
*adr
*agent
*category
*county-name
*extended-address
*fn
*label
*locality
*nickname
*note
*org
*region
*street-address
*uid
*url
*vcard
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist/microformat|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''
=== Precision ===
When giving coordinates, '''please use an [[Wikipedia:WikiProject Geographical coordinates#Precision|appropriate level of precision]]'''. Do '''not''' use {{tl|coord}}'s {{para|name}} parameter.<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |
[[Category:Templates with coordinates fields]]
[[Category:Templates generating hCards and Geo]]
}}</includeonly><noinclude>
[[Category:Microformat (uF) message templates]]
</noinclude>
==TemplateData==
{{TemplateData header}}
251bb76dc03ed2c0527a8506372cbe12f0e286a3
Template:URL
10
82
163
162
2024-06-03T23:42:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:URL|url|1={{{1|}}}|2={{{2|}}}}}</includeonly><noinclude>{{documentation}}</noinclude>
60d805865ce290072e475e5fc37e50fb47b7fd11
Template:Uses Wikidata
10
83
165
164
2024-06-03T23:43:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Sister project
| position = {{{position|}}}
| project = data
| text = This {{module other|module|template}} uses {{#if:{{{section|}}} | one or more [[Wikidata]] properties; see [[#{{{section}}}|§ {{{section}}}]] for details. | the [[Wikidata]] propert{{#if:{{{2|}}}|ies|y}}:
{{#invoke:Uses Wikidata|usesProperty}}
}}}}{{#switch:{{SUBPAGENAME}}
|sandbox |testcases |doc= <!--no category-->
|#default={{#ifeq:{{PAGENAME}} |Uses Wikidata ||{{module other |[[Category:Modules using data from Wikidata]] |{{template other |[[Category:Templates using data from Wikidata]]}} }} }}
}}<!--
--><noinclude>{{documentation}}</noinclude>
4b6f6f2ef4c6d4b84fa8aab733189b440b156a3f
Template:Yesno-no
10
84
167
166
2024-06-03T23:43:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
{{Documentation|Template:Yesno/doc}}
<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
</noinclude>
1ad7b7800da1b867ead8f6ff8cef76e6201b3b56
Module:Citation/CS1
828
85
169
168
2024-06-03T23:43:00Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local dates, year_date_check, reformat_dates, date_hyphen_to_dash, -- functions in Module:Citation/CS1/Date_validation
date_name_xlate
local is_set, in_array, substitute, error_comment, set_error, select_one, -- functions in Module:Citation/CS1/Utilities
add_maint_cat, wrap_style, safe_for_italics, is_wikilink, make_wikilink,
strip_apostrophe_markup;
local z ={}; -- tables in Module:Citation/CS1/Utilities
local extract_ids, extract_id_access_levels, build_id_list, is_embargoed; -- functions in Module:Citation/CS1/Identifiers
local make_coins_title, get_coins_pages, COinS; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
delare variables here that have page-wide scope that are not brought in from other modules; thatare created here
and used here
]]
local added_deprecated_cat; -- boolean flag so that the category is added only once
local added_prop_cats = {}; -- list of property categories that have been added to z.properties_cats
local added_vanc_errs; -- boolean flag so we only emit one Vancouver error / category
local Frame; -- holds the module's frame table
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.properties_cats using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local function add_prop_cat (key, arguments)
if not added_prop_cats [key] then
added_prop_cats [key] = true; -- note that we've added this category
key = key:gsub ('(foreign_lang_source_?2?)%a%a%a?[%a%-]*', '%1'); -- strip lang code from keyname
table.insert( z.properties_cats, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a boolean declared in page scope variables above
]]
local function add_vanc_error (source)
if not added_vanc_errs then
added_vanc_errs = true; -- note that we've added this category
table.insert( z.message_tail, { set_error( 'vancouver', {source}, true ) } );
end
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a uri scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of tlds: https://www.iana.org/domains/root/db
rfc952 (modified by rfc 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the tld. tld
is two or more alpha characters. Any preceding '//' (from splitting a url with a scheme) will be stripped
here. Perhaps not necessary but retained incase it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ascii characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the tld) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and tld or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at wikisource
return false;
end
local patterns = { -- patterns that look like urls
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and cctld (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and tld
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a url is a url
end
end
for _, d in ipairs ({'cash', 'company', 'today', 'org'}) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a url appear to be a valid url; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when url is protocol relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a url into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following tld) (if any) and any path(/), query(?) or fragment(#).
If protocol relative url, return nil scheme and domain else return nil for both scheme and domain.
When not protocol relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol relative url
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link= etc for properly formatted content: no wikilinks, no urls
Link parameters are to hold the title of a wikipedia article so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki urls and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid url (the
|<param>-link= parameter is ok); else false when value appears to be a valid url (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from url;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid url
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wikilinked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
end
end
if is_set (orig) then
table.insert( z.message_tail, { set_error( 'bad_paramlink', orig)}); -- url or wikilink in |title= with |title-link=;
end
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the url into scheme and domain
portions, or for protocol relative (//example.com) urls, just the domain. Use is_url() to validate the two
portions of the url. If both are valid, or for protocol relative if domain is valid, return true, else false.
Because it is different from a standard url, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper url
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from url;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid url
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a url. The test will also find external wikilinks
that use protocol relative urls. Also finds bare urls.
The frontier pattern prevents a match on interwiki links which are similar to scheme:path urls. The tests that
find bracketed urls are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol relative ext wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare url with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol relative bare url: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a url
end
return is_url (scheme, domain); -- return true if value appears to be a valid url
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list)
local error_message = '';
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a url add an error message
if is_set(error_message) then -- once we've added the first portion of the error message ...
error_message=error_message .. ", "; -- ... add a comma space separator
end
error_message=error_message .. "|" .. k .. "="; -- add the failed parameter
end
end
if is_set (error_message) then -- done looping, if there is an error message, display it
table.insert( z.message_tail, { set_error( 'param_has_ext_link', {error_message}, true ) } );
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
table.insert( z.message_tail, { set_error( 'wikilink_in_url', {}, true ) } );
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link( URL, label, source, access)
local error_str = "";
local domain;
local path;
local base_url;
if not is_set( label ) then
label = URL;
if is_set( source ) then
error_str = set_error( 'bare_url_missing_title', { wrap_style ('parameter', source) }, false, " " );
else
error( cfg.messages["bare_url_no_origin"] );
end
end
if not check_url( URL ) then
error_str = set_error( 'bad_url', {wrap_style ('parameter', source)}, false, " " ) .. error_str;
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the url into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['[']='%5b',[']']='%5d'}); -- replace '[' and ']' with their percent encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wikimarkup url
if is_set (access) then -- access level (subscription, registration, limited)
base_url = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return table.concat ({base_url, error_str});
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
table.insert( z.message_tail, { set_error( 'deprecated_params', {name}, true ) } ); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the Module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wikimarkup) are not kerned.
Replaces unicode quotemarks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc; not for book titles.
]=]
local function kern_quotes (str)
local cap='';
local cap2='';
local wl_type, label, link;
wl_type, label, link = is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = substitute (cfg.presentation['kern-wl-both'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = substitute (cfg.presentation['kern-wl-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = substitute (cfg.presentation['kern-wl-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label= mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label= mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap, cap2 = mw.ustring.match (label, "^([\"\'])([^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if is_set (cap) then
label = substitute (cfg.presentation['kern-left'], {cap, cap2});
end
cap, cap2 = mw.ustring.match (label, "^(.+[^\'])([\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if is_set (cap) then
label = substitute (cfg.presentation['kern-right'], {cap, cap2});
end
if 2 == wl_type then
str = make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate rtl languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
-- if script_value:match('^%l%l%s*:') then -- if first 3 non-space characters are script language prefix
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
-- lang = script_value:match('^(%l%l)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not is_set (lang) then
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'missing title part'}, true ) } ); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_code_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if is_set (name) then -- is prefix a proper ISO 639-1 language code?
-- script_value = script_value:gsub ('^%l%l%s*:%s*', ''); -- strip prefix from script
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if in_array (lang, cfg.script_lang_codes) then
add_prop_cat ('script_with_name', {name, lang})
else
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'unknown language code'}, true ) } ); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'invalid language code'}, true ) } ); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
table.insert( z.message_tail, { set_error( 'script_parameter', {script_param, 'missing prefix'}, true ) } ); -- no language code prefix; add error message
end
script_value = substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is rtl
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script value has been
wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang atribute, categorization, etc; returns empty string on error
if is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not is_set( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return substitute( msg, str ); -- including template text
else
return substitute( cfg.messages[key], str );
end
end
--[[--------------------------< W I K I S O U R C E _ U R L _ M A K E >----------------------------------------
makes a wikisource url from wikisource interwiki link. returns the url and appropriate label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
wl_type, D, L = is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if is_set (str) then
ws_url = table.concat ({ -- build a wikisource url
'https://en.wikisource.org/wiki/', -- prefix
str, -- article title
});
ws_label = str; -- label for the url
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if is_set (str) then
ws_url = table.concat ({ -- build a wikisource url
'https://en.wikisource.org/wiki/', -- prefix
str, -- article title
});
ws_label = str; -- label for the url
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a wikisource url
'https://en.wikisource.org/wiki/', -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable url
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent encoding of anchor
end
return ws_url, ws_label, L or D; -- return proper url or nil and a label or nil
end
--[[--------------------------< F O R M A T _ P E R I O D I C A L >--------------------------------------------
Format the four periodical parameters: |script-<periodical>=, |<periodical>=, and |trans-<periodical>= into a single Periodical meta-
parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
local periodical_error = '';
if not is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
if is_set (trans_periodical) then
trans_periodical = wrap_style ('trans-italic-title', trans_periodical);
if is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when transchapter without chapter or script-chapter
periodical = trans_periodical;
periodical_error = ' ' .. set_error ('trans_missing_title', {'periodical'});
end
end
return periodical .. periodical_error;
end
--[[--------------------------< F O R M A T _ C H A P T E R _ T I T L E >--------------------------------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=, and |chapter-url= into a single Chapter meta-
parameter (chapter_url_source used for error messages).
]]
local function format_chapter_title (scriptchapter, script_chapter_source, chapter, transchapter, chapterurl, chapter_url_source, no_quotes, access)
local chapter_error = '';
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource url and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ''); -- replace underscore separaters with space characters
chapter = ws_label;
end
if not is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from Module provided quote marks
chapter = wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, scriptchapter, script_chapter_source); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
if is_set (chapterurl) then
chapter = external_link (chapterurl, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if is_set (transchapter) then
transchapter = wrap_style ('trans-quoted-title', transchapter);
if is_set (chapter) then
chapter = chapter .. ' ' .. transchapter;
else -- here when transchapter without chapter or script-chapter
chapter = transchapter;
chapter_error = ' ' .. set_error ('trans_missing_title', {'chapter'});
end
end
-- if is_set (chapterurl) then
-- chapter = external_link (chapterurl, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
-- end
return chapter .. chapter_error;
end
--[[--------------------------< H A S _ I N V I S I B L E _ C H A R S >----------------------------------------
This function searches a parameter's value for nonprintable or invisible characters. The search stops at the
first match.
This function will detect the visible replacement character when it is part of the wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers (gallery, math, pre, ref)
and identifies them with a slightly different error message. See also coins_cleanup().
Output of this function is an error message that identifies the character or the Unicode group, or the stripmarker
that was detected along with its position (or, for multi-byte characters, the position of its first byte) in the
parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local dummy; -- end of matching string; not used but required to hold end position when a capture is returned
local capture; -- used by stripmarker detection to hold name of the stripmarker
local i=1;
local stripmarker, apostrophe;
capture = string.match (v, '[%w%p ]*'); -- Test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no unicode characters
return;
end
while cfg.invisible_chars[i] do
local char=cfg.invisible_chars[i][1] -- the character or group name
local pattern=cfg.invisible_chars[i][2] -- the pattern used to find it
position, dummy, capture = mw.ustring.find (v, pattern) -- see if the parameter value contains characters that match the pattern
if position and (char == 'zero width joiner') then -- if we found a zero width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- its ok if one of the indic scripts
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and 'delete' == char then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture then
err_msg = capture .. ' ' .. char;
else
err_msg = char .. ' ' .. 'character';
end
table.insert( z.message_tail, { set_error( 'invisible_char', {err_msg, wrap_style ('parameter', param), position}, true ) } ); -- add error message
return; -- and done with this parameter
end
end
i=i+1; -- bump our index
end
end
--[[--------------------------< A R G U M E N T _ W R A P P E R >----------------------------------------------
Argument wrapper. This function provides support for argument mapping defined in the configuration file so that
multiple names can be transparently aliased to single internal variable.
]]
local function argument_wrapper( args )
local origin = {};
return setmetatable({
ORIGIN = function( self, k )
local dummy = self[k]; --force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = select_one( args, list, 'redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = cfg.defaults[k] or '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >--------------------------------------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>. When date is DD MMMM YYYY or is
MMMM DD, YYYY then wrap in nowrap span: <span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap='';
local cap2='';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >----------------------------------------------------
This function sets default title types (equivalent to the citation including |type=<default value>) for those templates that have defaults.
Also handles the special case where it is desirable to omit the title type from the rendered citation (|type=none).
]]
local function set_titletype (cite_class, title_type)
if is_set(title_type) then
if "none" == title_type then
title_type = ""; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate like items; unlike items are
returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash( str )
if not is_set (str) then
return str;
end
str, count = str:gsub ('^%(%((.+)%)%)$', '%1'); -- remove accept-this-as-written markup when it wraps all of str
if 0 ~= count then -- non-zero when markup removed; zero else
return str; -- nothing to do, we're done
end
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace html numeric entity with hyphen character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
if mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous white space
end
end
item = item:gsub ('^%(%((.+)%)%)$', '%1'); -- remove the accept-this-as-written markup
table.insert (out, item); -- add the (possibly modified) item to the output table
end
return table.concat (out, ', '); -- concatenate the output table into a comma separated string
end
--[[--------------------------< S A F E _ J O I N >------------------------------------------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'dupicate character'
if 1 == #duplicate_char then -- for single byte ascii characters use the string library functions
f.gsub=string.gsub
f.match=string.match
f.sub=string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub=mw.ustring.gsub
f.match=mw.ustring.match
f.sub=mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1,1) == '<' then -- Special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove html markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if f.sub(comp, 1,1) == duplicate_char then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc?
trim = false;
end_chr = f.sub(str, -1,-1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr.. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = f.sub(str, 1,-2); -- remove it
elseif end_chr == "'" then -- if it might be wikimarkup
if f.sub(str, -3,-1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5,-1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4,-1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wikimarkup
if f.sub(str, -3,-1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3,-1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2,-1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4,-1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2,-1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1,-3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains html markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows html markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; --add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >------------------------------------------------------------
returns true is suffix is properly formed Jr, Sr, or ordinal in the range 2–9. Puncutation not allowed.
]]
local function is_suffix (suffix)
if in_array (suffix, {'Jr', 'Sr', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------------< I S _ G O O D _ V A N C _ N A M E >--------------------------------------------
For Vancouver Style, author/editor names are supposed to be rendered in Latin (read ASCII) characters. When a name
uses characters that contain diacritical marks, those characters are to converted to the corresponding Latin character.
When a name is written using a non-Latin alphabet or logogram, that name is to be transliterated into Latin characters.
These things are not currently possible in this module so are left to the editor to do.
This test allows |first= and |last= names to contain any of the letters defined in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes. (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$") or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written ouside of the code editor and pasted here because the code editor gets confused between character insertion point and cursor position.
The test has been rewritten to use decimal character escape sequence for the individual bytes of the unicode characters so that it is not necessary
to use an external editor to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first)
local first, suffix = first:match ('(.-),?%s*([%dJS][%drndth]+)%.?$') or first; -- if first has something that looks like a generational suffix, get it
if is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error ('suffix');
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error ('non-Latin character');
return false; -- not a string of latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-format=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc) to be rendered as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just intials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error ('suffix'); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and names[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = names[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i],1,1)); -- insert the intial at end of initials table
end
i = i+1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< L I S T _ P E O P L E >-------------------------------------------------------
Formats a list of people (e.g. authors / editors)
]]
local function list_people(control, people, etal)
local sep;
local namesep;
local format = control.format
local maximum = control.maximum
local lastauthoramp = control.lastauthoramp;
local text = {}
if 'vanc' == format then -- Vancouver-like author/editor name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between authors is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
lastauthoramp = nil; -- unset because isn't used by Vancouver style
else
sep = cfg.presentation['sep_nl']; -- name-list separator between authors is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub(-1,-1) ~= " " then sep = sep .. " " end
if is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for authors
for i,person in ipairs(people) do
if is_set(person.last) then
local mask = person.mask
local one
local sep_one = sep;
if is_set (maximum) and i > maximum then
etal = true;
break;
elseif (mask ~= nil) then
local n = tonumber(mask)
if (n ~= nil) then
one = string.rep("—",n)
else
one = mask;
sep_one = " ";
end
else
one = person.last
local first = person.first
if is_set(first) then
if ( "vanc" == format ) then -- if vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials(first) -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
if is_set(person.link) and person.link ~= control.page_name then
one = make_wikilink (person.link, one); -- link author/editor if this page is not the author's/editor's page
end
end
table.insert( text, one )
table.insert( text, sep_one )
end
end
local count = #text / 2; -- (number of names + number of separators) divided by 2
if count > 0 then
if count > 1 and is_set(lastauthoramp) and not etal then
text[#text-2] = " & "; -- replace last separator with ampersand text
end
text[#text] = nil; -- erase the last separator
end
local result = table.concat(text) -- construct list
if etal and is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. ' ' .. cfg.messages['et al']; -- we've go a last-first list and etal so add et al.
end
return result, count
end
--[[--------------------------< A N C H O R _ I D >------------------------------------------------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that order. year is Year or anchor_year.
]]
local function anchor_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< N A M E _ H A S _ E T A L >----------------------------------------------------
Evaluates the content of name parameters (author, editor, etc) for variations on the theme of et al. If found,
the et al. is removed, a flag is set to true and the function returns the modified name and the flag.
This function never sets the flag to false but returns it's previous state because it may have been set by
previous passes through this function or by the associated |display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; --get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
table.insert( z.message_tail, {set_error ('etal', {param})}); -- and set an error if not added
end
end
end
end
return name, etal; --
end
--[[--------------------------< N A M E _ H A S _ E D _ M A R K U P >------------------------------------------
Evaluates the content of author and editor parameters for extranious editor annotations: ed, ed., eds, (Ed.), etc.
These annotation do not belong in author parameters and are redundant in editor parameters. If found, the function
adds the editor markup maintenance category.
]]
local function name_has_ed_markup (name, list_name)
local _, pattern;
local patterns = cfg.editor_markup_patterns; -- get patterns from configuration
if is_set (name) then
for _, pattern in ipairs (patterns) do -- spin through patterns table and
if name:match (pattern) then
add_maint_cat ('extra_text_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
break;
end
end
end
return name; -- and done
end
--[[--------------------------< N A M E _ H A S _ M U L T _ N A M E S >----------------------------------------
Evaluates the content of author and editor (surnames only) parameters for multiple names. Multiple names are
indicated if there is more than one comma and or semicolon. If found, the function adds the multiple name
(author or editor) maintenance category.
]]
local function name_has_mult_names (name, list_name)
local count, _;
if is_set (name) then
_, count = name:gsub ('[;,]', ''); -- count the number of separator-like characters
if 1 < count then -- param could be |author= or |editor= so one separator character is acceptable
add_maint_cat ('mult_names', cfg.special_case_translation [list_name]); -- more than one separator indicates multiple names so add a maint cat for this template
end
end
return name; -- and done
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding
parameters.
]]
local function name_checks (last, first, list_name)
if is_set (last) then
if last:match ('^%(%(.*%)%)$') then -- if wrapped in doubled parentheses, accept as written
last = last:match ('^%(%((.*)%)%)$'); -- strip parens
else
last = name_has_mult_names (last, list_name); -- check for multiple names in the parameter (last only)
last = name_has_ed_markup (last, list_name); -- check for extraneous 'editor' annotation
end
end
if is_set (first) then
if first:match ('^%(%(.*%)%)$') then -- if wrapped in doubled parentheses, accept as written
first = first:match ('^%(%((.*)%)%)$'); -- strip parens
else
first = name_has_ed_markup (first, list_name); -- check for extraneous 'editor' annotation
end
end
return last, first; -- done
end
--[[--------------------------< E X T R A C T _ N A M E S >----------------------------------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters (or their aliases), and their matching link and mask parameters.
Stops searching when both |lastn= and |firstn= are not found in args after two sequential attempts: found |last1=, |last2=, and |last3= but doesn't
find |last4= and |last5= then the search is done.
This function emits an error message when there is a |firstn= without a matching |lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.' is stripped from the parameter and a flag (etal) returned
that will cause list_people() to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps 'et al.' out of the
template's metadata. When this occurs, the page is added to a maintenance category.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal=false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = select_one( args, cfg.aliases[list_name .. '-Last'], 'redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = select_one( args, cfg.aliases[list_name .. '-First'], 'redundant_parameters', i );
link = select_one( args, cfg.aliases[list_name .. '-Link'], 'redundant_parameters', i );
mask = select_one( args, cfg.aliases[list_name .. '-Mask'], 'redundant_parameters', i );
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first= name_checks (last, first, list_name); -- multiple names, extraneous annotation, etc checks
if first and not last then -- if there is a firstn without a matching lastn
table.insert( z.message_tail, { set_error( 'first_missing_last', {first_alias, first_alias:gsub('first', 'last')}, true ) } ); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
link_title_ok (link, list_name:match ("(%w+)List"):lower() .. '-link' .. i, last, list_name:match ("(%w+)List"):lower() .. '-last' .. i); -- check for improper wikimarkup
names[n] = {last = last, first = first, link = link, mask = mask, corporate=false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
table.insert( z.message_tail, { set_error( 'missing_name', {list_name:match ("(%w+)List"):lower(), i-1}, true ) } ); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< G E T _ I S O 6 3 9 _ C O D E >------------------------------------------------
Validates language names provided in |language= parameter if not an ISO639-1 or 639-2 code.
Returns the language name and associated two- or three-character code. Because case of the source may be incorrect
or different from the case that WikiMedia uses, the name comparisons are done in lower case and when a match is
found, the Wikimedia version (assumed to be correct) is returned along with the code. When there is no match, we
return the original language name string.
mw.language.fetchLanguageNames(<local wiki language>, 'all') returns a list of languages that in some cases may include
extensions. For example, code 'cbk-zam' and its associated name 'Chavacano de Zamboanga' (MediaWiki does not support
code 'cbk' or name 'Chavacano'. Most (all?) of these languages are not used a 'language' codes per se, rather they
are used as sub-domain names: cbk-zam.wikipedia.org. A list of language names and codes supported by fetchLanguageNames()
can be found at Template:Citation Style documentation/language/doc
Names that are included in the list will be found if that name is provided in the |language= parameter. For example,
if |language=Chavacano de Zamboanga, that name will be found with the associated code 'cbk-zam'. When names are found
and the associated code is not two or three characters, this function returns only the WikiMedia language name.
Some language names have multiple entries under different codes:
Aromanian has code rup and code roa-rup
When this occurs, this function returns the language name and the 2- or 3-character code
Adapted from code taken from Module:Check ISO 639-1.
]]
local function get_iso639_code (lang, this_wiki_code)
if cfg.lang_name_remap[lang:lower()] then -- if there is a remapped name (because MediaWiki uses something that we don't think is correct)
return cfg.lang_name_remap[lang:lower()][1], cfg.lang_name_remap[lang:lower()][2]; -- for this language 'name', return a possibly new name and appropriate code
end
local ietf_code; -- because some languages have both ietf-like codes and iso 639-like codes
local ietf_name;
local languages = mw.language.fetchLanguageNames(this_wiki_code, 'all') -- get a list of language names known to Wikimedia
-- ('all' is required for North Ndebele, South Ndebele, and Ojibwa)
local langlc = mw.ustring.lower(lang); -- lower case version for comparisons
for code, name in pairs(languages) do -- scan the list to see if we can find our language
if langlc == mw.ustring.lower(name) then
if 2 == code:len() or 3 == code:len() then -- two- or three-character codes only; extensions not supported
return name, code; -- so return the name and the code
end
ietf_code = code; -- remember that we found an ietf-like code and save its name
ietf_name = name; -- but keep looking for a 2- or 3-char code
end
end
-- didn't find name with 2- or 3-char code; if ietf-like code found return
return ietf_code and ietf_name or lang; -- associated name; return original language text else
end
--[[--------------------------< L A N G U A G E _ P A R A M E T E R >------------------------------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code is recognized by MediaWiki,
use the returned name; if not, then use the value that was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is assigned to the category for
that code: Category:Norwegian-language sources (no). For valid three-character code languages, the page is assigned
to the single category for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does not recognize three-character
equivalents of two-character codes: code 'ar' is recognized bit code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th where the language names or codes are
separated from each other by commas.
]]
local function language_parameter (lang)
local code; -- the two- or three-character language code
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_table = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName(cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_table = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_table) do -- reuse lang
name = cfg.lang_code_remap[lang:lower()]; -- first see if this is a code that is not supported by MediaWiki but is in remap
if name then -- there was a remapped code so
if not lang:match ('^%a%a%a?%-x%-%a+$') then -- if not a private ietf tag
lang = lang:gsub ('^(%a%a%a?)%-.*', '%1'); -- strip ietf tags from code
end
else
if lang:match ('^%a%a%-') then -- strip ietf tags from code; TODO: is there a need to support 3-char with tag?
lang = lang:match ('(%a%a)%-') -- keep only 639-1 code portion to lang; TODO: do something with 3166 alpha 2 country code?
end
if 2 == lang:len() or 3 == lang:len() then -- if two-or three-character code
name = mw.language.fetchLanguageName (lang:lower(), cfg.this_wiki_code); -- get language name if |language= is a proper code
end
end
if is_set (name) then -- if |language= specified a valid code
code = lang:lower(); -- save it
else
name, code = get_iso639_code (lang, cfg.this_wiki_code); -- attempt to get code from name (assign name here so that we are sure of proper capitalization)
end
if is_set (code) then -- only 2- or 3-character codes
name = cfg.lang_code_remap[code] or name; -- override wikimedia when they misuse language codes/names
if cfg.this_wiki_code ~= code then -- when the language is not the same as this wiki's language
if 2 == code:len() then -- and is a two-character code
add_prop_cat ('foreign_lang_source' .. code, {name, code}); -- categorize it; code appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character code)
add_prop_cat ('foreign_lang_source_2' .. code, {code}); -- categorize it differently TODO: support mutliple three-character code categories per cs1|2 template
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
add_prop_cat ('local_lang_source', {name, code}); -- categorize it
end
else
add_maint_cat ('unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
code = #language_list -- reuse code as number of languages in the list
if 2 >= code then
name = table.concat (language_list, cfg.messages['parameter-pair-separator']) -- insert '<space>and<space>' between two language names
elseif 2 < code then
name = table.concat (language_list, ', '); -- and concatenate with '<comma><space>' separators
name = name:gsub (', ([^,]+)$', cfg.messages['parameter-final-separator'] .. '%1'); -- replace last '<comma><space>' separator with '<comma><space>and<space>' separator
end
if this_wiki_name == name then
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[--------------------------< S E T _ C S 1 _ S T Y L E >----------------------------------------------------
Set style settings for CS1 citation templates. Returns separator and postscript settings
At en.wiki, for cs1:
ps gets: '.'
sep gets: '.'
]]
local function set_cs1_style (ps)
if not is_set (ps) then -- unless explicitely set to something
ps = cfg.presentation['ps_cs1']; -- terminate the rendered citation
end
return cfg.presentation['sep_cs1'], ps; -- element separator
end
--[[--------------------------< S E T _ C S 2 _ S T Y L E >----------------------------------------------------
Set style settings for CS2 citation templates. Returns separator, postscript, ref settings
At en.wiki, for cs2:
ps gets: '' (empty string - no terminal punctuation)
sep gets: ','
]]
local function set_cs2_style (ps, ref)
if not is_set (ps) then -- if |postscript= has not been set, set cs2 default
ps = cfg.presentation['ps_cs2']; -- terminate the rendered citation
end
if not is_set (ref) then -- if |ref= is not set
ref = "harv"; -- set default |ref=harv
end
return cfg.presentation['sep_cs2'], ps, ref; -- element separator
end
--[[--------------------------< G E T _ S E T T I N G S _ F R O M _ C I T E _ C L A S S >----------------------
When |mode= is not set or when its value is invalid, use config.CitationClass and parameter values to establish
rendered style.
]]
local function get_settings_from_cite_class (ps, ref, cite_class)
local sep;
if (cite_class == "citation") then -- for citation templates (CS2)
sep, ps, ref = set_cs2_style (ps, ref);
else -- not a citation template so CS1
sep, ps = set_cs1_style (ps);
end
return sep, ps, ref -- return them all
end
--[[--------------------------< S E T _ S T Y L E >------------------------------------------------------------
Establish basic style settings to be used when rendering the citation. Uses |mode= if set and valid or uses
config.CitationClass from the template's #invoke: to establish style.
]]
local function set_style (mode, ps, ref, cite_class)
local sep;
if 'cs2' == mode then -- if this template is to be rendered in CS2 (citation) style
sep, ps, ref = set_cs2_style (ps, ref);
elseif 'cs1' == mode then -- if this template is to be rendered in CS1 (cite xxx) style
sep, ps = set_cs1_style (ps);
else -- anything but cs1 or cs2
sep, ps, ref = get_settings_from_cite_class (ps, ref, cite_class); -- get settings based on the template's CitationClass
end
if 'none' == ps:lower() then -- if assigned value is 'none' then
ps = ''; -- set to empty string
end
return sep, ps, ref
end
--[=[-------------------------< I S _ P D F >------------------------------------------------------------------
Determines if a url has the file extension that is one of the pdf file extensions used by [[MediaWiki:Common.css]] when
applying the pdf icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >------------------------------------------------------
Applies css style to |format=, |chapter-format=, etc. Also emits an error message if the format parameter does
not have a matching url parameter. If the format parameter is not set and the url contains a file extension that
is recognized as a pdf document by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if is_set (format) then
format = wrap_style ('format', format); -- add leading space, parentheses, resize
if not is_set (url) then
format = format .. set_error( 'format_missing_url', {fmt_param, url_param} ); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if url is a pdf file then
format = wrap_style ('format', 'PDF'); -- set format to pdf
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[--------------------------< G E T _ D I S P L A Y _ N A M E S >--------------------------------------------
Returns a number that defines the number of names displayed for author and editor name lists and a boolean flag
to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero, return the number and
the previous state of the 'etal' flag (false by default but may have been set to true if the name list contains
some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number that is one greater than the
number of authors in the list and set the 'etal' flag true. This will cause the list_people() to display all of
the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors']; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
]]
local function get_display_names (max, count, list_name, etal)
if is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
add_maint_cat ('disp_name', cfg.special_case_translation [list_name]);
end
else -- not a valid keyword or number
table.insert( z.message_tail, { set_error( 'invalid_param_val', {'display-' .. list_name, max}, true ) } ); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[--------------------------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >------------------------------
Adds page to Category:CS1 maint: extra text if |page= or |pages= has what appears to be some form of p. or pp.
abbreviation in the first characters of the parameter content.
check Page and Pages for extraneous p, p., pp, and pp. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when |page(s)= begins PX or P# but not Px where x and X are letters and # is a dgiit
bad pattern: '^[Pp][Pp]' matches matches when |page(s)= begins pp or pP or Pp or PP
]]
local function extra_text_in_page_check (page)
local good_pattern = '^P[^%.Pp]'; -- ok to begin with uppercase P: P7 (pg 7 of section P) but not p123 (page 123) TODO: add Gg for PG or Pg?
local bad_pattern = '^[Pp]?[Pp]%.?[ %d]';
if not page:match (good_pattern) and (page:match (bad_pattern) or page:match ('^[Pp]ages?')) then
add_maint_cat ('extra_text');
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parnetheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a place holder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parens
local name = name_table[i];
i=i+1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parens
break; -- and done reassembling so
end
i=i+1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i+1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled paranethese ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the vancouver error when a reqired comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
if v_name:match ('^%(%(.+%)%)$') then -- corporate authors are wrapped in doubled parentheses to supress vanc formatting and error detection
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
last = v_name:match ('^%(%((.+)%)%)$') -- remove doubled parntheses
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error ('punctuation');
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be author intials
if is_suffix (first) then -- if a valid suffix
suffix = first -- save it as a suffix and
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end -- no suffix error message here because letter combination may be result of Romanization; check for digits?
last = table.concat(lastfirstTable, " ") -- returns a string that is the concatenation of all other names that are not initials
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error ('missing comma'); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error ('name'); -- matches a space between two intiials
end
else
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error ('initials'); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first); -- check first and last before restoring the suffix which may have a non-Latin digit
if is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '');
end
end
link = select_one( args, cfg.aliases[list_name .. '-Link'], 'redundant_parameters', i ) or v_link_table[i];
mask = select_one( args, cfg.aliases[list_name .. '-Mask'], 'redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate=corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editors=, |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest and
similarly, |editorn= (and aliases) highest and |editors= lowest
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors or editors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if select_one( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice incase we have a |first1= without a |last1=; this ...
select_one( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
select_one( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
select_one( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst=true;
end
if (is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(is_set (vxxxxors) and is_set (xxxxors)) or
(true == lastfirst and is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
table.insert( z.message_tail, { set_error( 'redundant_parameters',
{err_name .. '-name-list parameters'}, true ) } ); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if is_set (vxxxxors) then return 2 end;
if is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
]]
local function is_valid_parameter_value (value, name, possible, ret_val)
if not is_set (value) then
return ret_val; -- an empty parameter is ok
elseif in_array (value, possible) then
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
else
table.insert( z.message_tail, { set_error( 'invalid_param_val', {name, value}, true ) } ); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list,-3,-1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list,-1,-1) == sepc) or (string.sub (name_list,-3,-1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terninate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >----------------------------------------
returns the concatenation of the formatted volume and issue parameters as a single string; or formatted volume
or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, cite_class, origin, sepc, lower)
if not is_set (volume) and not is_set (issue) then
return '';
end
if 'magazine' == cite_class or (in_array (cite_class, {'citation', 'map'}) and 'magazine' == origin) then
if is_set (volume) and is_set (issue) then
return wrap_msg ('vol-no', {sepc, volume, issue}, lower);
elseif is_set (volume) then
return wrap_msg ('vol', {sepc, volume}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
if 'podcast' == cite_class and is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
local vol = ''; -- here for all cites except magazine
if is_set (volume) then
if volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')then -- volume value is all digits or all uppercase roman numerals
vol = substitute (cfg.presentation['vol-bold'], {sepc, hyphen_to_dash(volume)}); -- render in bold face
elseif (4 < mw.ustring.len(volume)) then -- not all digits or roman numerals and longer than 4 characters
vol = substitute (cfg.messages['j-vol'], {sepc, volume}); -- not bold
add_prop_cat ('long_vol');
else -- four or less characters
vol = substitute (cfg.presentation['vol-bold'], {sepc, hyphen_to_dash(volume)}); -- bold
end
end
if is_set (issue) then
return vol .. substitute (cfg.messages['j-issue'], issue);
end
return vol;
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if is_set (page) then
if is_journal then
return substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif is_set(pages) then
if is_journal then
return substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to wikisource, returns the label portion of the interwikilink as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki link to and external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, pages, at)
local ws_url, ws_label, coins_pages, L; -- for wikisource interwikilinks; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if is_set (page) then
if is_set (pages) or is_set(at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page); -- add this page to maint cat if |page= value begins with what looks like p. or pp.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws url from |page= interwiki link; link portion L becomes tool tip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif is_set (pages) then
if is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages); -- add this page to maint cat if |pages= value begins with what looks like p. or pp.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws url from |pages= interwiki link; link portion L becomes tool tip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws url from |at= interwiki link; link portion L becomes tool tip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org urls to make sure they at least look like they are pointing at valid archives and not to the
save snapshot url or to calendar pages. When the archive url is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the url. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org url does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command url
|archive-url= is an archive.org url that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org urls:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this funct may return a modified
archive url:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the url unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.or url
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine url
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command url, we don't want to allow saving of the target page
err_msg = 'save command';
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = 'liveweb';
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the url parts for evaluation
if not is_set(timestamp) or 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = 'timestamp';
if '*' ~= flag then
url=url:gsub ('(//web%.archive%.org/[^%d]*%d?%d?%d?%d?%d?%d?)[^/]*', '%1*', 1) -- for preview, modify ts to be yearmo* max (0-6 digits plus splat)
end
elseif is_set(path) and 'web/' ~= path then -- older archive urls do not have the extra 'web/' path element
err_msg = 'path';
elseif is_set (flag) and not is_set (path) then -- flag not allowed with the old form url (without the 'web/' path element)
err_msg = 'flag';
elseif is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = 'flag';
else
return url, date; -- return archiveURL and ArchiveDate
end
end
-- if here, something not right so
table.insert( z.message_tail, { set_error( 'archive_url', {err_msg}, true ) } ); -- add error message and
if is_set (Frame:preprocess('{{REVISIONID}}')) then
return '', ''; -- return empty strings for archiveURL and ArchiveDate
else
return url, date; -- preview mode so return archiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors mis-use location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
add_maint_cat ('location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args)
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListFormat = is_valid_parameter_value (A['NameListFormat'], A:ORIGIN('NameListFormat'), cfg.keywords_lists['name-list-format'], '');
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListFormat = 'vanc'; -- override whatever |name-list-format= might be
a, author_etal = parse_vauthors_veditors (args, args.vauthors, 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
add_maint_cat ('authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local Others = A['Others'];
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
local Editors;
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], A['Editors'], args, 'EditorList');
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListFormat = 'vanc'; -- override whatever |name-list-format= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
elseif 3 == selected then
Editors = A['Editors']; -- use content of |editors=
add_maint_cat ('editors'); -- but add a maint cat because use of this parameter is discouraged
end
end
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
local Translators; -- assembled translators name list
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local interviewer_etal;
local interviewers_list = {};
local Interviewers; -- used later
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local contributor_etal;
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
local Contributors; -- assembled contributors name list
local Contribution = A['Contribution'];
if in_array(config.CitationClass, {"book","citation"}) and not is_set(A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not is_set (Contribution) then -- |contributor= requires |contribution=
table.insert( z.message_tail, { set_error( 'contributor_missing_required_param', 'contribution')}); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
table.insert( z.message_tail, { set_error( 'contributor_missing_required_param', 'author')}); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if select_one (args, cfg.aliases['ContributorList-Last'], 'redundant_parameters', 1 ) then -- are there contributor name list parameters?
table.insert( z.message_tail, { set_error( 'contributor_ignored')}); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
if is_set (Others) then
if 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
add_maint_cat ('others');
end
end
local Year = A['Year'];
local PublicationDate = A['PublicationDate'];
local OrigYear = A['OrigYear'];
local Date = A['Date'];
local LayDate = A['LayDate'];
------------------------------------------------- Get title data
local Title = A['Title'];
local ScriptTitle = A['ScriptTitle'];
local BookTitle = A['BookTitle'];
local Conference = A['Conference'];
local TransTitle = A['TransTitle'];
local TitleNote = A['TitleNote'];
local TitleLink = A['TitleLink'];
link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wikimarkup in |title-link= or wikimarkup in |title= when |title-link= is set
local Chapter = A['Chapter'];
local ScriptChapter = A['ScriptChapter'];
local ScriptChapterOrigin = A:ORIGIN ('ScriptChapter');
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local TransChapter = A['TransChapter'];
local TitleType = A['TitleType'];
local Degree = A['Degree'];
local Docket = A['Docket'];
local ArchiveFormat = A['ArchiveFormat'];
local ArchiveDate;
local ArchiveURL;
ArchiveURL, ArchiveDate = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local URL = A['URL']
local URLorigin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL = A['ChapterURL'];
local ChapterURLorigin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
local ConferenceURLorigin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
local Periodical = A['Periodical'];
local Periodical_origin = '';
if is_set (Periodical) then
Periodical_origin = A:ORIGIN('Periodical'); -- get the name of the periodical parameter
local i;
Periodical, i = strip_apostrophe_markup (Periodical); -- strip appostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
table.insert( z.message_tail, {set_error ('apostrophe_markup', {Periodical_origin}, true)});
end
end
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (is_set (Periodical) or is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
table.insert( z.message_tail, {set_error ('missing_periodical', {config.CitationClass, p[config.CitationClass]}, true)});
end
end
local TransPeriodical = A['TransPeriodical'];
local Series = A['Series'];
local Volume;
local Issue;
local Page;
local Pages;
local At;
if 'citation' == config.CitationClass then
if is_set (Periodical) then
if not in_array (Periodical_origin, {'website', 'mailinglist'}) then -- {{citation}} does not render volume for these 'periodicals'
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
if 'citation' == config.CitationClass then
if is_set (Periodical) and in_array (Periodical_origin, {'journal', 'magazine', 'newspaper', 'periodical', 'work'}) or -- {{citation}} renders issue for these 'periodicals'
is_set (ScriptPeriodical) and in_array (ScriptPeriodical_origin, {'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-work'}) then -- and these 'script-periodicals'
Issue = hyphen_to_dash (A['Issue']);
end
elseif in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (is_set (Periodical) or is_set (ScriptPeriodical))) then
Issue = hyphen_to_dash (A['Issue']);
end
end
local Position = '';
if not in_array (config.CitationClass, cfg.templates_not_using_page) then
Page = A['Page'];
Pages = hyphen_to_dash (A['Pages']);
At = A['At'];
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if is_set (PublisherName) then
local i=0;
PublisherName, i = strip_apostrophe_markup (PublisherName); -- strip appostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i then -- non-zero when markup was stripped so emit an error message
table.insert( z.message_tail, {set_error ('apostrophe_markup', {PublisherName_origin}, true)});
end
end
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not is_set(URL) and is_set(UrlAccess) then
UrlAccess = nil;
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {'url'}, true ) } );
end
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not is_set(ChapterURL) and is_set(ChapterUrlAccess) then
ChapterUrlAccess = nil;
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')}, true ) } );
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not is_set(A['MapURL']) and is_set(MapUrlAccess) then
MapUrlAccess = nil;
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {'map-url'}, true ) } );
end
local Via = A['Via'];
local AccessDate = A['AccessDate'];
local Agency = A['Agency'];
local Language = A['Language'];
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local DoiBroken = A['DoiBroken'];
local ID = A['ID'];
local ASINTLD = A['ASINTLD'];
local IgnoreISBN = is_valid_parameter_value (A['IgnoreISBN'], A:ORIGIN('IgnoreISBN'), cfg.keywords_lists['yes_true_y'], nil);
local Embargo = A['Embargo'];
local Class = A['Class']; -- arxiv class identifier
local ID_list = extract_ids( args );
if is_set (DoiBroken) and not ID_list['DOI'] then
table.insert( z.message_tail, { set_error( 'doibroken_missing_doi', A:ORIGIN('DoiBroken'))});
end
local ID_access_levels = extract_id_access_levels( args, ID_list );
local Quote = A['Quote'];
local LayFormat = A['LayFormat'];
local LayURL = A['LayURL'];
local LaySource = A['LaySource'];
local Transcript = A['Transcript'];
local TranscriptFormat = A['TranscriptFormat'];
local TranscriptURL = A['TranscriptURL']
local TranscriptURLorigin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
local LastAuthorAmp = is_valid_parameter_value (A['LastAuthorAmp'], A:ORIGIN('LastAuthorAmp'), cfg.keywords_lists['yes_true_y'], nil);
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
--local variables that are not cs1 parameters
local use_lowercase; -- controls capitalization of certain static text
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local anchor_year; -- used in the CITEREF identifier
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not is_set (DF) then
DF = cfg.global_df; -- local df if present overrides global df set by {{use xxx date}} template
end
local sepc; -- separator between citation elements for CS1 a period, for CS2, a comma
local PostScript;
local Ref;
sepc, PostScript, Ref = set_style (Mode:lower(), A['PostScript'], A['Ref'], config.CitationClass);
use_lowercase = ( sepc == ',' ); -- used to control capitalization for certain static text
--check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if in_array (this_page.nsText, cfg.uncategorized_namespaces) then
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _,v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
select_one( args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'redundant_parameters' ); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, Pages, At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if is_set (PublicationPlace) and is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
add_prop_cat ('location test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not is_set (PublicationPlace) and is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
-- if not is_set(PublicationPlace) and is_set(Place) then -- both |publication-place= and |place= (|location=) allowed if different
-- PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
-- end
--
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia and |title then map |title to |article and |encyclopedia to |title
|encyclopedia and |article then map |encyclopedia to |title
|trans-title maps to |trans-chapter when |title is re-mapped
|url maps to |chapterurl when |title is remapped
All other combinations of |encyclopedia, |title, and |article are not modified
]]
local Encyclopedia = A['Encyclopedia'];
if ( config.CitationClass == "encyclopaedia" ) or ( config.CitationClass == "citation" and is_set (Encyclopedia)) then -- test code for citation
if is_set (Periodical) then -- Periodical is set when |encyclopedia is set
if is_set(Title) or is_set (ScriptTitle) then
if not is_set(Chapter) then
Chapter = Title; -- |encyclopedia and |title are set so map |title to |article and |encyclopedia to |title
ScriptChapter = ScriptTitle;
ScriptChapterOrigin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
if not is_set (ChapterURL) and is_set (TitleLink) then
Chapter = make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif is_set (Chapter) then -- |title not set
Title = Periodical; -- |encyclopedia set and |article set so map |encyclopedia to |title
Periodical = ''; -- redundant so unset
end
end
end
-- Special case for cite techreport.
if (config.CitationClass == "techreport") then -- special case for cite techreport
if is_set(A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not is_set(ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
table.insert( z.message_tail, { set_error('redundant_parameters', {wrap_style ('parameter', 'id') .. ' and ' .. wrap_style ('parameter', 'number')}, true )});
end
end
end
-- special case for cite mailing list
if (config.CitationClass == "mailinglist") then
Periodical = A ['MailingList'];
elseif 'mailinglist' == Periodical_origin then
Periodical = ''; -- unset because mailing list is only used for cite mailing list
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
if 'conference' == config.CitationClass then
if is_set(BookTitle) then
Chapter = Title;
-- ChapterLink = TitleLink; -- |chapterlink= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURLorigin = URLorigin;
URLorigin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
Chapter = A['Map'];
ChapterURL = A['MapURL'];
ChapterURLorigin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapterOrigin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if is_set( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if is_set( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local AirDate = A['AirDate'];
local SeriesLink = A['SeriesLink'];
link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wikimarkup in |series-link= or wikimarkup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if is_set(Network) then table.insert(n, Network); end
if is_set(Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if not is_set (Date) and is_set (AirDate) then -- promote airdate to date
Date = AirDate;
end
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if is_set (Season) and is_set (SeriesNumber) then -- these are mutually exclusive so if both are set
table.insert( z.message_tail, { set_error( 'redundant_parameters', {wrap_style ('parameter', 'season') .. ' and ' .. wrap_style ('parameter', 'seriesno')}, true ) } ); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if is_set(Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if is_set(SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if is_set(Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
-- ScriptChapterOrigin = 'title';
ScriptChapterOrigin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias episodelink
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURLorigin = A:ORIGIN('URL');
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if is_set (ChapterLink) and not is_set (ChapterURL) then -- link but not URL
Chapter = make_wikilink (ChapterLink, Chapter);
elseif is_set (ChapterLink) and is_set (ChapterURL) then -- if both are set, URL links episode;
Series = make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if is_set (Series) and is_set (SeriesLink) then
Series = make_wikilink (SeriesLink, Series);
end
Series = wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite ssrn}}, before generation of COinS data.
do
if in_array (config.CitationClass, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then
if not is_set (ID_list[config.CitationClass:upper()]) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv= & |citeseerx= required for their templates
table.insert( z.message_tail, { set_error( config.CitationClass .. '_missing', {}, true ) } ); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
end
-- handle type parameter for those CS1 citations that have default values
if in_array(config.CitationClass, {"AV-media-notes", "interview", "mailinglist", "map", "podcast", "pressrelease", "report", "techreport", "thesis"}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if is_set(Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if is_set(TitleType) then -- if type parameter is specified
TitleType = substitute( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
if not is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not is_set (Date) and is_set(PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val=AccessDate, name=A:ORIGIN ('AccessDate')},
['archive-date'] = {val=ArchiveDate, name=A:ORIGIN ('ArchiveDate')},
['date'] = {val=Date, name=Date_origin},
['doi-broken-date'] = {val=DoiBroken, name=A:ORIGIN ('DoiBroken')},
['embargo'] = {val=Embargo, name=A:ORIGIN ('Embargo')},
['lay-date'] = {val=LayDate, name=A:ORIGIN ('LayDate')},
['publication-date'] ={val=PublicationDate, name=A:ORIGIN ('PublicationDate')},
['year'] = {val=Year, name=A:ORIGIN ('Year')},
};
anchor_year, Embargo, error_message = dates(date_parameters_list, COinS_date);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
add_prop_cat ('jul_greg_uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if is_set (Year) and is_set (Date) then -- both |date= and |year= not normally needed;
local mismatch = year_date_check (Year, Date)
if 0 == mismatch then -- |year= does not match a year-value in |date=
if is_set (error_message) then -- if there is already an error message
error_message = error_message .. ', '; -- tack on this additional message
end
error_message = error_message .. '|year= / |date= mismatch';
elseif 1 == mismatch then -- |year= matches year-value in |date=
add_maint_cat ('date_year');
end
end
if not is_set(error_message) then -- error free dates only
local modified = false; -- flag
if is_set (DF) then -- if we need to reformat dates
modified = reformat_dates (date_parameters_list, DF, false); -- reformat to DF format, use long month names if appropriate
end
if true == date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
add_maint_cat ('date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language,
-- uncomment these three lines. Not supported by en.wiki (for obvious reasons)
-- set date_name_xlate() second argument to true to translate English digits to local digits (will translate ymd dates)
-- if date_name_xlate (date_parameters_list, false) then
-- modified = true;
-- end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
else
table.insert( z.message_tail, { set_error( 'bad_date', {error_message}, true ) } ); -- add this error message
end
end -- end of do
-- Account for the oddity that is {{cite journal}} with |pmc= set and |url= not set. Do this after date check but before COInS.
-- Here we unset Embargo if PMC not embargoed (|embargo= not set in the citation) or if the embargo time has expired. Otherwise, holds embargo date
Embargo = is_embargoed (Embargo);
if config.CitationClass == "journal" and not is_set(URL) and is_set(ID_list['PMC']) then
if not is_set (Embargo) then -- if not embargoed or embargo has expired
URL=cfg.id_handlers['PMC'].prefix .. ID_list['PMC']; -- set url to be the same as the PMC external link if not embargoed
URLorigin = cfg.id_handlers['PMC'].parameters[1]; -- set URLorigin to parameter name for use in error message if citation is missing a |title=
if is_set(AccessDate) then -- access date requires |url=; pmc created url is not |url=
table.insert( z.message_tail, { set_error( 'accessdate_missing_url', {}, true ) } );
AccessDate = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not is_set(Title) and
not is_set(TransTitle) and
not is_set(ScriptTitle) then
if 'episode' == config.CitationClass then -- special case for cite episode; TODO: is there a better way to do this?
table.insert( z.message_tail, { set_error( 'citation_missing_title', {'series'}, true ) } );
else
table.insert( z.message_tail, { set_error( 'citation_missing_title', {'title'}, true ) } );
end
end
if 'none' == Title and
in_array (config.CitationClass, {'journal', 'citation'}) and
(is_set (Periodical) or is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
add_maint_cat ('untitled');
end
check_for_url ({ -- add error message when any of these parameters hold a URL
['title']=Title,
[A:ORIGIN('Chapter')]=Chapter,
[Periodical_origin] = Periodical,
[PublisherName_origin] = PublisherName
});
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and is_set (Encyclopedia)) then
if is_set (Chapter) and is_set (Title) and is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = COinS({
['Periodical'] = strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = strip_apostrophe_markup (Encyclopedia),
['Chapter'] = make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic wikimarkup
['Degree'] = Degree; -- cite thesis only
['Title'] = make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic wikimarkup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date has correctly formatted date if Date is valid;
['Season'] = COinS_date.rftssn,
['Chron'] = COinS_date.rftchron or (not COinS_date.rftdate and Date) or '', -- chron but if not set and invalid date format use Date; keep this last bit?
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['Pages'] = coins_pages or get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At}, 5)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName, -- any apostrophe markup already removed
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, and {{cite ssrn}} AFTER generation of COinS data.
if in_array (config.CitationClass, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass then
if is_set (PublisherName) then
PublisherName = substitute (cfg.messages['newsgroup'], external_link( 'news:' .. PublisherName, PublisherName, PublisherName_origin, nil ));
end
end
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
do
local last_first_list;
local control = {
format = NameListFormat, -- empty string or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
lastauthoramp = LastAuthorAmp,
page_name = this_page.text, -- get current page name so that we don't wikilink to it via editorlinkn
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal);
last_first_list, EditorCount = list_people(control, e, editor_etal);
if is_set (Editors) then
Editors, editor_etal = name_has_etal (Editors, editor_etal, false, 'editors'); -- find and remove variations on et al.
if editor_etal then
Editors = Editors .. ' ' .. cfg.messages['et al']; -- add et al. to editors parameter beause |display-editors=etal
EditorCount = 2; -- with et al., |editors= is multiple names; spoof to display (eds.) annotation
else
EditorCount = 2; -- we don't know but assume |editors= is multiple names; spoof to display (eds.) annotation
end
else
Editors = last_first_list; -- either an author name list or an empty string
end
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
control.maximum , interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal);
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
control.maximum , translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal);
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
control.maximum , contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal);
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
control.maximum , author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal);
last_first_list = list_people(control, a, author_etal);
if is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if is_set (Authors) and is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
-- apply |[xx-]format= styling; at the end, these parameters hold correctly styled format annotation,
-- an error message if the associated url is not set, or an empty string for concatenation
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
-- special case for chapter format so no error message or cat when chapter not supported
if not (in_array(config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical)) and not is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not is_set(URL) then
if in_array(config.CitationClass, {"web","podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
table.insert( z.message_tail, { set_error( 'cite_web_url', {}, true ) } );
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if is_set(AccessDate) and not is_set(ChapterURL)then -- ChapterURL may be set when URL is not set;
table.insert( z.message_tail, { set_error( 'accessdate_missing_url', {}, true ) } );
AccessDate = '';
end
end
local OriginalURL, OriginalURLorigin, OriginalFormat, OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if is_set( ArchiveURL ) then
if is_set (ChapterURL) then -- if chapter-url is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURLorigin = ChapterURLorigin; -- name of chapter-url parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's url
ChapterURLorigin = A:ORIGIN('ArchiveURL') -- name of archive-url parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived urls
end
elseif is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURLorigin = URLorigin; -- name of url parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then archive-url applies to it
URL = ArchiveURL -- swap-in the archive's url
URLorigin = A:ORIGIN('ArchiveURL') -- name of archive url parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived urls
end
end
end
if in_array(config.CitationClass, {'web','news','journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical)) and not is_set (Encyclopedia)) then
local chap_param;
if is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif is_set (ScriptChapter) then
chap_param = ScriptChapterOrigin;
else is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if is_set (chap_param) then -- if we found one
table.insert( z.message_tail, { set_error( 'chapter_ignored', {chap_param}, true ) } ); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapterOrigin, Chapter, TransChapter, ChapterURL, ChapterURLorigin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter.. sepc .. ' ';
elseif is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title.
if is_set (ArchiveURL) and mw.ustring.match (mw.ustring.lower(Title), cfg.special_case_translation['archived_copy']) then -- if title is 'Archived copy' (place holder added by bots that can't find proper title)
add_maint_cat ('archived_copy'); -- add maintenance category before we modify the content of Title
end
if Title:match ('^%(%(.*%)%)$') then -- if keep as written markup:
Title= Title:gsub ('^%(%((.*)%)%)$', '%1') -- remove the markup
else
if '...' == Title:sub (-3) then -- if elipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%'..sepc..'$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
end
if in_array(config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical)) and not is_set (Encyclopedia)) or
('map' == config.CitationClass and (is_set (Periodical) or is_set (ScriptPeriodical))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from Module provided quote marks
Title = wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle= wrap_style ('trans-quoted-title', TransTitle );
elseif 'report' == config.CitationClass then -- no styling for cite report
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle= wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle = wrap_style ('trans-italic-title', TransTitle);
end
local TransError = "";
if is_set(TransTitle) then
if is_set(Title) then
TransTitle = " " .. TransTitle;
else
TransError = " " .. set_error( 'trans_missing_title', {'title'} );
end
end
if is_set(Title) then
if not is_set (TitleLink) and is_set (URL) then
Title = external_link (URL, Title, URLorigin, UrlAccess) .. TransTitle .. TransError .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif is_set (TitleLink) and not is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle .. TransError;
else
Title = make_wikilink (TitleLink, Title) .. TransTitle .. TransError;
end
else
local ws_url, ws_label;
ws_url, ws_label, L = wikisource_url_make (Title); -- make ws url from |title= interwiki link; link portion L becomes tool tip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle .. TransError;
else
Title = Title .. TransTitle .. TransError;
end
end
else
Title = TransTitle .. TransError;
end
if is_set(Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
if is_set (Conference) then
if is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURLorigin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif is_set(ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURLorigin, nil );
end
if not is_set(Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if is_set(Minutes) then
if is_set (Time) then
table.insert( z.message_tail, { set_error( 'redundant_parameters', {wrap_style ('parameter', 'minutes') .. ' and ' .. wrap_style ('parameter', 'time')}, true ) } );
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if is_set(Time) then
local TimeCaption = A['TimeCaption']
if not is_set(TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = is_set(At) and (sepc .. " " .. At) or "";
Position = is_set(Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Section = A['Section'];
local Sections = A['Sections'];
local Inset = A['Inset'];
if is_set( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if is_set( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif is_set( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
if is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc
else
Language=""; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
Others = is_set(Others) and (sepc .. " " .. Others) or "";
if is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
TitleNote = is_set(TitleNote) and (sepc .. " " .. TitleNote) or "";
if is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%.?$') or Edition:match ('%f[%a][Ee]dition$') then
add_maint_cat ('extra_text', 'edition');
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
OrigYear = is_set (OrigYear) and wrap_msg ('origyear', OrigYear) or '';
Agency = is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, config.CitationClass, Periodical_origin, sepc, use_lowercase);
------------------------------------ totally unrelated data
Via = is_set (Via) and wrap_msg ('via', Via) or '';
if is_set(AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if is_set(ID) then ID = sepc .." ".. ID; end
if "thesis" == config.CitationClass and is_set(Docket) then
ID = sepc .." Docket ".. Docket .. ID;
end
if "report" == config.CitationClass and is_set(Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
ID_list = build_id_list( ID_list, {IdAccessLevels=ID_access_levels, DoiBroken = DoiBroken, ASINTLD = ASINTLD, IgnoreISBN = IgnoreISBN, Embargo=Embargo, Class = Class} );
if is_set(URL) then
URL = " " .. external_link( URL, nil, URLorigin, UrlAccess );
end
if is_set(Quote) then
if Quote:sub(1,1) == '"' and Quote:sub(-1,-1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2,-2); -- strip them off
end
Quote = sepc .." " .. wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
local Archived
if is_set(ArchiveURL) then
local arch_text;
if not is_set(ArchiveDate) then
ArchiveDate = set_error('archive_missing_date');
end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. substitute( cfg.messages['archived-live'],
{ external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil ) .. ArchiveFormat, ArchiveDate } );
if not is_set (OriginalURL) then
Archived = Archived .. " " .. set_error('archive_missing_url');
end
elseif is_set(OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
add_maint_cat ('bot:_unknown'); -- and add a category if not already added
else
add_maint_cat ('unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. substitute( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURLorigin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
end
else -- OriginalUrl not set
arch_text = cfg.messages['archived-missing'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. " " .. substitute( arch_text,
{ set_error('archive_missing_url'), ArchiveDate } );
end
elseif is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = ""
end
local Lay = '';
if is_set(LayURL) then
if is_set(LayDate) then LayDate = " (" .. LayDate .. ")" end
if is_set(LaySource) then
LaySource = " – ''" .. safe_for_italics(LaySource) .. "''";
else
LaySource = "";
end
if sepc == '.' then
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
else
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
end
elseif is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
end
if is_set(Transcript) then
if is_set(TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURLorigin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif is_set(TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURLorigin, nil );
end
local Publisher;
if is_set(PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if is_set(PublisherName) then
if is_set(PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif is_set(PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (is_set (Periodical) or is_set (ScriptPeriodical) or is_set (TransPeriodical)) then
if is_set(Title) or is_set(TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical);
end
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = " (Speech)"; -- annotate the citation
if is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if in_array(config.CitationClass, {"journal","citation"}) and is_set(Periodical) then
if is_set(Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif in_array(config.CitationClass, {"book","citation"}) and not is_set(Periodical) then -- special cases for book cites
if is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
if is_set(Date) then
if is_set (Authors) or is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date ..")" .. OrigYear .. sepc .. " "; -- in paranetheses
else -- neither of authors and editors set
if (string.sub(tcommon,-1,-1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigYear; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigYear; -- Date begins with sepc
end
end
end
if is_set(Authors) then
if (not is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if is_set(Editors) then
local in_text = " ";
local post_text = "";
if is_set(Chapter) and 0 == #c then
in_text = in_text .. cfg.messages['in'] .. " "
if (sepc ~= '.') then
in_text = in_text:lower() -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = " (" .. cfg.messages['editor'] .. ")"; -- be consistent with no-author, no-date case
else
post_text = " (" .. cfg.messages['editors'] .. ")";
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if is_set (Contributors) then -- book cite and we're citing the intro, preface, etc
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
if is_set (Editors) and is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc and a space
end
if (not is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif is_set(Editors) then
if is_set(Date) then
if EditorCount <= 1 then
Editors = Editors .. ", " .. cfg.messages['editor'];
else
Editors = Editors .. ", " .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if in_array(config.CitationClass, {"journal","citation"}) and is_set(Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if is_set(PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); --Deals with italics, spaces, etc.
text = text:sub(1,-sepc:len()-1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite/> element
local options = {};
if is_set(config.CitationClass) and config.CitationClass ~= "citation" then
options.class = config.CitationClass;
options.class = "citation " .. config.CitationClass; -- class=citation required for blue highlight when used with |ref=
else
options.class = "citation";
end
if is_set(Ref) and Ref:lower() ~= "none" then -- set reference anchor if appropriate
local id = Ref
if ('harv' == Ref ) then
local namelist = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist = c; -- select it
elseif #a > 0 then -- or an author list
namelist = a;
elseif #e > 0 then -- or an editor list
namelist = e;
end
if #namelist > 0 then -- if there are names in namelist
id = anchor_id (namelist, year); -- go make the CITEREF anchor
else
id = ''; -- unset
end
end
options.id = id;
end
if string.len(text:gsub("<span[^>/]*>(.-)</span>", "%1"):gsub("%b<>","")) <= 2 then -- remove <span> tags and other html-like markup; then get length of what remains
z.error_categories = {};
text = set_error('empty_citation');
z.message_tail = {};
end
local render = {}; -- here we collect the final bits for concatenation into the rendered citation
if is_set(options.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render, substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options.id), mw.text.nowiki(options.class), text})); -- when |ref= is set
else
table.insert (render, substitute (cfg.presentation['cite'], {mw.text.nowiki(options.class), text})); -- all other cases
end
table.insert (render, substitute (cfg.presentation['ocins'], {OCinSoutput})); -- append metadata to the citation
if 0 ~= #z.message_tail then
table.insert (render, ' ');
for i,v in ipairs( z.message_tail ) do
if is_set(v[1]) then
if i == #z.message_tail then
table.insert (render, error_comment( v[1], v[2] ));
else
table.insert (render, error_comment( v[1] .. "; ", v[2] ));
end
end
end
end
if 0 ~= #z.maintenance_cats then
local maint_msgs = {}; -- here we collect all of the maint messages
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
local maint = {}; -- here we assemble a maintenence message
table.insert (maint, v); -- maint msg is the category name
table.insert (maint, ' ('); -- open the link text
table.insert (maint, make_wikilink (':Category:' .. v, 'link')); -- add the link
table.insert (maint, ')'); -- and close it
table.insert (maint_msgs, table.concat (maint)); -- assemble new maint message and add it to the maint_msgs table
end
table.insert (render, substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs, ' '))); -- wrap the group of maint message with proper presentation and save
end
-- no_tracking_cats = no_tracking_cats:lower();
-- if in_array(no_tracking_cats, {"", "no", "false", "n"}) then
if not no_tracking_cats then
for _, v in ipairs( z.error_categories ) do
table.insert (render, make_wikilink ('Category:' .. v));
end
for _, v in ipairs( z.maintenance_cats ) do -- append maintenance categories
table.insert (render, make_wikilink ('Category:' .. v));
end
for _, v in ipairs( z.properties_cats ) do -- append properties categories
table.insert (render, make_wikilink ('Category:' .. v));
end
end
return table.concat (render);
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class)
local name = tostring (name);
local state;
if in_array (cite_class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- limited parameter sets allowed for these templates
state = whitelist.limited_basic_arguments[name];
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
state = whitelist[cite_class .. '_basic_arguments'][name]; -- look in the parameter-list for the template identified by cite_class
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
-- limited enumerated parameters list
name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.limited_numbered_arguments[name];
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
state = whitelist.basic_arguments[name]; -- all other templates; all normal parameters allowed
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
-- all enumerated parameters allowed
name = name:gsub("%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.numbered_arguments[name];
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
return false; -- not supported because not found or name is set to nil
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe:
{{cite ... |title=Title access-date=2016-03-17}}
cs1|2 shares some parameter names with xml/html atributes: class=, title=, etc. To prevent false positives xml/html
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove xml/html tags because attributes: class=, title=, etc
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
table.insert( z.message_tail, {set_error ('missing_pipe',parameter)});
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
add_maint_cat ('extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy incase we need to display an error message in preview mode
local pframe = frame:getParent()
local validation, utilities, identifiers, metadata, styles;
if nil ~= string.find (frame:getTitle(), 'sandbox', 1, true) then -- did the {{#invoke:}} use sandbox version?
cfg = mw.loadData ('Module:Citation/CS1/Configuration/sandbox'); -- load sandbox versions of support modules
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist/sandbox');
utilities = require ('Module:Citation/CS1/Utilities/sandbox');
validation = require ('Module:Citation/CS1/Date_validation/sandbox');
identifiers = require ('Module:Citation/CS1/Identifiers/sandbox');
metadata = require ('Module:Citation/CS1/COinS/sandbox');
styles = 'Module:Citation/CS1/sandbox/styles.css';
else -- otherwise
cfg = mw.loadData ('Module:Citation/CS1/Configuration'); -- load live versions of support modules
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist');
utilities = require ('Module:Citation/CS1/Utilities');
validation = require ('Module:Citation/CS1/Date_validation');
identifiers = require ('Module:Citation/CS1/Identifiers');
metadata = require ('Module:Citation/CS1/COinS');
styles = 'Module:Citation/CS1/styles.css';
end
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
dates = validation.dates; -- imported functions from Module:Citation/CS1/Date validation
year_date_check = validation.year_date_check;
reformat_dates = validation.reformat_dates;
date_hyphen_to_dash = validation.date_hyphen_to_dash;
date_name_xlate = validation.date_name_xlate;
is_set = utilities.is_set; -- imported functions from Module:Citation/CS1/Utilities
in_array = utilities.in_array;
substitute = utilities.substitute;
error_comment = utilities.error_comment;
set_error = utilities.set_error;
select_one = utilities.select_one;
add_maint_cat = utilities.add_maint_cat;
wrap_style = utilities.wrap_style;
safe_for_italics = utilities.safe_for_italics;
is_wikilink = utilities.is_wikilink;
make_wikilink = utilities.make_wikilink;
strip_apostrophe_markup = utilities.strip_apostrophe_markup;
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
extract_ids = identifiers.extract_ids; -- imported functions from Module:Citation/CS1/Identifiers
build_id_list = identifiers.build_id_list;
is_embargoed = identifiers.is_embargoed;
extract_id_access_levels = identifiers.extract_id_access_levels;
make_coins_title = metadata.make_coins_title; -- imported functions from Module:Citation/CS1/COinS
get_coins_pages = metadata.get_coins_pages;
COinS = metadata.COinS;
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text, error_state;
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do
config[k] = v;
-- args[k] = v; -- debug tool that allows us to render a citation from module {{#invoke:}}
end
local capture; -- the single supported capture when matching unknown parameters using patterns
for k, v in pairs( pframe.args ) do
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
error_text = "";
if type( k ) ~= 'string' then
-- Exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text, error_state = set_error( 'text_ignored', {v}, true );
end
elseif validate( k:lower(), config.CitationClass ) then
error_text, error_state = set_error( 'parameter_ignored_suggest', {k, k:lower()}, true ); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
if nil ~= string.find (frame:getTitle(), 'sandbox', 1, true) then -- did the {{#invoke:}} use sandbox version?
suggestions = mw.loadData( 'Module:Citation/CS1/Suggestions/sandbox' ); -- use the sandbox version
else
suggestions = mw.loadData( 'Module:Citation/CS1/Suggestions' ); -- use the live version
end
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no caputre in pattern else the capture if a match
if capture then -- if the pattern matches
param = substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text, error_state = set_error ('parameter_ignored_suggest', {k, param}, true); -- set the suggestion error message
else
error_text, error_state = set_error( 'parameter_ignored', {param}, true ); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not is_set (error_text) then -- couldn't match with a pattern, is there an expicit suggestion?
if suggestions.suggestions[ k:lower() ] ~= nil then
error_text, error_state = set_error( 'parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]}, true );
else
error_text, error_state = set_error( 'parameter_ignored', {k}, true );
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
if error_text ~= '' then
table.insert( z.message_tail, {error_text, error_state} );
end
end
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
-- TODO: is this the best place for this translation?
args[k] = v;
elseif args[k] ~= nil or (k == 'postscript') then -- here when v is empty string
args[k] = v; -- why do we do this? we don't support 'empty' parameters
end
end
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v);
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
end
end
return table.concat ({citation0( config, args), frame:extensionTag ('templatestyles', '', {src=styles})});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
a5feb2cf853a747bb079162056a94b701cdc2518
Module:Citation/CS1/COinS
828
86
171
170
2024-06-03T23:43:01Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local is_set, in_array, remove_wiki_link, strip_apostrophe_markup; -- functions in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--[[--------------------------< M A K E _ C O I N S _ T I T L E >----------------------------------------------
Makes a title for COinS from Title and / or ScriptTitle (or any other name-script pairs)
Apostrophe markup (bold, italics) is stripped from each value so that the COinS metadata isn't corrupted with strings
of %27%27...
]]
local function make_coins_title (title, script)
if is_set (title) then
title = strip_apostrophe_markup (title); -- strip any apostrophe markup
else
title=''; -- if not set, make sure title is an empty string
end
if is_set (script) then
script = script:gsub ('^%l%l%s*:%s*', ''); -- remove language prefix if present (script value may now be empty string)
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script=''; -- if not set, make sure script is an empty string
end
if is_set (title) and is_set (script) then
script = ' ' .. script; -- add a space before we concatenate
end
return title .. script; -- return the concatenation
end
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
Returns a string where all of lua's magic characters have been escaped. This is important because functions like
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
]]
local function escape_lua_magic_chars (argument)
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other lua magic pattern characters
return argument;
end
--[[--------------------------< G E T _ C O I N S _ P A G E S >------------------------------------------------
Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.
]]
local function get_coins_pages (pages)
local pattern;
if not is_set (pages) then return pages; end -- if no page numbers then we're done
while true do
pattern = pages:match("%[(%w*:?//[^ ]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the url and following space(s): "[url "
if nil == pattern then break; end -- no more urls
pattern = escape_lua_magic_chars (pattern); -- pattern is not a literal string; escape lua's magic pattern characters
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace html entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
--[=[-------------------------< C O I N S _ R E P L A C E _ M A T H _ S T R I P M A R K E R >------------------
There are three options for math markup rendering that depend on the editor's math preference settings. These
settings are at [[Special:Preferences#mw-prefsection-rendering]] and are
PNG images
TeX source
MathML with SVG or PNG fallback
All three are heavy with html and css which doesn't belong in the metadata.
Without this function, the metadata saved in the raw wikitext contained the rendering determined by the settings
of the last editor to save the page.
This function gets the rendered form of an equation according to the editor's preference before the page is saved. It
then searches the rendering for the text equivalent of the rendered equation and replaces the rendering with that so
that the page is saved without extraneous html/css markup and with a reasonably readable text form of the equation.
When a replacement is made, this function returns true and the value with replacement; otherwise false and the intital
value. To replace multipe equations it is necesary to call this function from within a loop.
]=]
local function coins_replace_math_stripmarker (value)
local stripmarker = cfg.stripmarkers['math'];
local rendering = value:match (stripmarker); -- is there a math stripmarker
if not rendering then -- when value doesn't have a math stripmarker, abandon this test
return false, value;
end
rendering = mw.text.unstripNoWiki (rendering); -- convert stripmarker into rendered value (or nil? ''? when math render error)
if rendering:match ('alt="[^"]+"') then -- if PNG math option
rendering = rendering:match ('alt="([^"]+)"'); -- extract just the math text
elseif rendering:match ('$%s+.+%s+%$') then -- if TeX math option; $ is legit character that is escapes as \$
rendering = rendering:match ('$%s+(.+)%s+%$') -- extract just the math text
elseif rendering:match ('<annotation[^>]+>.+</annotation>') then -- if MathML math option
rendering = rendering:match ('<annotation[^>]+>(.+)</annotation>') -- extract just the math text
else
return false, value; -- had math stripmarker but not one of the three defined forms
end
return true, value:gsub (stripmarker, rendering, 1);
end
--[[--------------------------< C O I N S _ C L E A N U P >----------------------------------------------------
Cleanup parameter values for the metadata by removing or replacing invisible characters and certain html entities.
2015-12-10: there is a bug in mw.text.unstripNoWiki (). It replaces math stripmarkers with the appropriate content
when it shouldn't. See https://phabricator.wikimedia.org/T121085 and Wikipedia_talk:Lua#stripmarkers_and_mw.text.unstripNoWiki.28.29
TODO: move the replacement patterns and replacement values into a table in /Configuration similar to the invisible
characters table?
]]
local function coins_cleanup (value)
local replaced = true; -- default state to get the do loop running
while replaced do -- loop until all math stripmarkers replaced
replaced, value = coins_replace_math_stripmarker (value); -- replace math stripmarker with text representation of the equation
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR"); -- one or more couldn't be replaced; insert vague error message
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
value = value:gsub (' ', ' '); -- replace entity with plain space
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero width joiner characters from indic script
value = value:gsub ('‍', ''); -- remove ‍ entities
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013]', ' '); -- replace horizontal tab, line feed, carriage return with plain space
return value;
end
--[[--------------------------< C O I N S >--------------------------------------------------------------------
COinS metadata (see <http://ocoins.info/>) allows automated tools to parse the citation information.
]]
local function COinS(data, class)
if 'table' ~= type(data) or nil == next(data) then
return '';
end
for k, v in pairs (data) do -- spin through all of the metadata parameter values
if 'ID_list' ~= k and 'Authors' ~= k then -- except the ID_list and Author tables (author nowiki stripmarker done when Author table processed)
data[k] = coins_cleanup (v);
end
end
local ctx_ver = "Z39.88-2004";
-- treat table strictly as an array with only set values.
local OCinSoutput = setmetatable( {}, {
__newindex = function(self, key, value)
if is_set(value) then
rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( remove_wiki_link( value ) ) } );
end
end
});
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn', 'journal', 'news', 'magazine'}) or (in_array (class, {'conference', 'interview', 'map', 'press release', 'web'}) and is_set(data.Periodical)) or
('citation' == class and is_set(data.Periodical) and not is_set (data.Encyclopedia)) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal"; -- journal metadata identifier
if in_array (class, {'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) then -- set genre according to the type of citation template we are rendering
OCinSoutput["rft.genre"] = "preprint"; -- cite arxiv, cite biorxiv, cite citeseerx, cite ssrn
elseif 'conference' == class then
OCinSoutput["rft.genre"] = "conference"; -- cite conference (when Periodical set)
elseif 'web' == class then
OCinSoutput["rft.genre"] = "unknown"; -- cite web (when Periodical set)
else
OCinSoutput["rft.genre"] = "article"; -- journal and other 'periodical' articles
end
OCinSoutput["rft.jtitle"] = data.Periodical; -- journal only
OCinSoutput["rft.atitle"] = data.Title; -- 'periodical' article titles
-- these used only for periodicals
OCinSoutput["rft.ssn"] = data.Season; -- keywords: winter, spring, summer, fall
OCinSoutput["rft.chron"] = data.Chron; -- free-form date components
OCinSoutput["rft.volume"] = data.Volume; -- does not apply to books
OCinSoutput["rft.issue"] = data.Issue;
OCinSoutput["rft.pages"] = data.Pages; -- also used in book metadata
elseif 'thesis' ~= class then -- all others except cite thesis are treated as 'book' metadata; genre distinguishes
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book"; -- book metadata identifier
if 'report' == class or 'techreport' == class then -- cite report and cite techreport
OCinSoutput["rft.genre"] = "report";
elseif 'conference' == class then -- cite conference when Periodical not set
OCinSoutput["rft.genre"] = "conference";
OCinSoutput["rft.atitle"] = data.Chapter; -- conference paper as chapter in proceedings (book)
elseif in_array (class, {'book', 'citation', 'encyclopaedia', 'interview', 'map'}) then
if is_set (data.Chapter) then
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.atitle"] = data.Chapter; -- book chapter, encyclopedia article, interview in a book, or map title
else
if 'map' == class or 'interview' == class then
OCinSoutput["rft.genre"] = 'unknown'; -- standalone map or interview
else
OCinSoutput["rft.genre"] = 'book'; -- book and encyclopedia
end
end
else --{'audio-visual', 'AV-media-notes', 'DVD-notes', 'episode', 'interview', 'mailinglist', 'map', 'newsgroup', 'podcast', 'press release', 'serial', 'sign', 'speech', 'web'}
OCinSoutput["rft.genre"] = "unknown";
end
OCinSoutput["rft.btitle"] = data.Title; -- book only
OCinSoutput["rft.place"] = data.PublicationPlace; -- book only
OCinSoutput["rft.series"] = data.Series; -- book only
OCinSoutput["rft.pages"] = data.Pages; -- book, journal
OCinSoutput["rft.edition"] = data.Edition; -- book only
OCinSoutput["rft.pub"] = data.PublisherName; -- book and dissertation
else -- cite thesis
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:dissertation"; -- dissertation metadata identifier
OCinSoutput["rft.title"] = data.Title; -- dissertation (also patent but that is not yet supported)
OCinSoutput["rft.degree"] = data.Degree; -- dissertation only
OCinSoutput['rft.inst'] = data.PublisherName; -- book and dissertation
end
-- and now common parameters (as much as possible)
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
local id = cfg.id_handlers[k].COinS;
if string.sub( id or "", 1, 4 ) == 'info' then -- for ids that are in the info:registry
OCinSoutput["rft_id"] = table.concat{ id, "/", v };
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif id then -- when cfg.id_handlers[k].COinS is not nil
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v }; -- others; provide a url
end
end
local last, first;
for k, v in ipairs( data.Authors ) do
last, first = coins_cleanup (v.last), coins_cleanup (v.first or ''); -- replace any nowiki strip markers, non-printing or invisible characers
if k == 1 then -- for the first author name only
if is_set(last) and is_set(first) then -- set these COinS values if |first= and |last= specify the first author name
OCinSoutput["rft.aulast"] = last; -- book, journal, dissertation
OCinSoutput["rft.aufirst"] = first; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation -- otherwise use this form for the first name
end
else -- for all other authors
if is_set(last) and is_set(first) then
OCinSoutput["rft.au"] = table.concat{ last, ", ", first }; -- book, journal, dissertation
elseif is_set(last) then
OCinSoutput["rft.au"] = last; -- book, journal, dissertation
end
end
end
OCinSoutput.rft_id = data.URL;
OCinSoutput.rfr_id = table.concat{ "info:sid/", mw.site.server:match( "[^/]*$" ), ":", data.RawPage };
OCinSoutput = setmetatable( OCinSoutput, nil );
-- sort with version string always first, and combine.
--table.sort( OCinSoutput );
table.insert( OCinSoutput, 1, "ctx_ver=" .. ctx_ver ); -- such as "Z39.88-2004"
return table.concat(OCinSoutput, "&");
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
is_set = utilities_page_ptr.is_set; -- import functions from selected Module:Citation/CS1/Utilities module
in_array = utilities_page_ptr.in_array;
remove_wiki_link = utilities_page_ptr.remove_wiki_link;
strip_apostrophe_markup = utilities_page_ptr.strip_apostrophe_markup;
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
make_coins_title = make_coins_title,
get_coins_pages = get_coins_pages,
COinS = COinS,
set_selected_modules = set_selected_modules,
}
b5ddcb88ee3e52bb23321d231c25c7886747b1be
Module:Citation/CS1/Configuration
828
87
173
172
2024-06-03T23:43:01Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[--------------------------< U N C A T E G O R I Z E D _ N A M E S P A C E S >------------------------------
List of namespaces that should not be included in citation error categories. Same as setting notracking = true by default
Note: Namespace names should use underscores instead of spaces.
]]
local uncategorized_namespaces = { 'User', 'Talk', 'User_talk', 'Wikipedia_talk', 'File_talk', 'Template_talk', 'Help_talk', 'Category_talk', 'Portal_talk', 'Book_talk', 'Draft_talk', 'Education_Program_talk', 'Module_talk', 'MediaWiki_talk' };
local uncategorized_subpages = {'/[Ss]andbox', '/[Tt]estcases'}; -- list of Lua patterns found in page names of pages we should not categorize
--[[--------------------------< M E S S A G E S >--------------------------------------------------------------
Translation table
The following contains fixed text that may be output as part of a citation.
This is separated from the main body to aid in future translations of this
module.
]]
local messages = {
['agency'] = '$1 $2', -- $1 is sepc, $2 is agency
['archived-dead'] = 'Archived from $1 on $2',
['archived-live'] = '$1 from the original on $2',
['archived-missing'] = 'Archived from the original$1 on $2',
['archived-unfit'] = 'Archived from the original on ',
['archived'] = 'Archived',
['by'] = 'By', -- contributions to authored works: introduction, foreword, afterword
['cartography'] = 'Cartography by $1',
['editor'] = 'ed.',
['editors'] = 'eds.',
['edition'] = '($1 ed.)',
['episode'] = 'Episode $1',
['et al'] = 'et al.',
['in'] = 'In', -- edited works
['inactive'] = 'inactive',
['inset'] = '$1 inset',
['interview'] = 'Interviewed by $1',
['lay summary'] = 'Lay summary',
['newsgroup'] = '[[Usenet newsgroup|Newsgroup]]: $1',
['original'] = 'the original',
['origyear'] = ' [$1]',
['published'] = ' (published $1)',
['retrieved'] = 'Retrieved $1',
['season'] = 'Season $1',
['section'] = '§ $1',
['sections'] = '§§ $1',
['series'] = '$1 $2', -- $1 is sepc, $2 is series
['seriesnum'] = 'Series $1',
['translated'] = 'Translated by $1',
['type'] = ' ($1)', -- for titletype
['written'] = 'Written at $1',
['vol'] = '$1 Vol. $2', -- $1 is sepc; bold journal style volume is in presentation{}
['vol-no'] = '$1 Vol. $2 no. $3', -- sepc, volume, issue
['issue'] = '$1 No. $2', -- $1 is sepc
['j-vol'] = '$1 $2', -- sepc, volume; bold journal volume is in presentation{}
['j-issue'] = ' ($1)',
['nopp'] = '$1 $2'; -- page(s) without prefix; $1 is sepc
['p-prefix'] = "$1 p. $2", -- $1 is sepc
['pp-prefix'] = "$1 pp. $2", -- $1 is sepc
['j-page(s)'] = ': $1', -- same for page and pages
['sheet'] = '$1 Sheet $2', -- $1 is sepc
['sheets'] = '$1 Sheets $2', -- $1 is sepc
['j-sheet'] = ': Sheet $1',
['j-sheets'] = ': Sheets $1',
['language'] = '(in $1)',
['via'] = " – via $1",
['event'] = 'Event occurs at',
['minutes'] = 'minutes in',
['parameter-separator'] = ', ',
['parameter-final-separator'] = ', and ',
['parameter-pair-separator'] = ' and ',
-- Determines the location of the help page
['help page link'] = 'Help:CS1 errors',
['help page label'] = 'help',
-- Internal errors (should only occur if configuration is bad)
['undefined_error'] = 'Called with an undefined error condition',
['unknown_manual_ID'] = 'Unrecognized manual ID mode',
['unknown_ID_mode'] = 'Unrecognized ID mode',
['unknown_argument_map'] = 'Argument map not defined for this variable',
['bare_url_no_origin'] = 'Bare url found but origin indicator is nil or empty',
}
--[=[-------------------------< E T _ A L _ P A T T E R N S >--------------------------------------------------
This table provides Lua patterns for the phrase "et al" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the 'etal' message.
]=]
local et_al_patterns = {
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.\"']*$", -- variations on the 'et al' theme
"[;,]? *[\"']*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][Aa][%.\"']*$", -- variations on the 'et alia' theme
"[;,]? *%f[%a]and [Oo]thers", -- and alternate to et al.
"%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]", -- a wikilinked form
"[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]", -- a bracketed form
}
--[[--------------------------< E D I T O R _ M A R K U P _ P A T T E R N S >----------------------------------
This table provides Lua patterns for the phrase "ed" and variants in name text
(author, editor, etc.). The main module uses these to identify and emit the
'extra_text_names' message. (It is not the only series of patterns for this message.)
]]
local editor_markup_patterns = { -- these patterns match annotations at end of name
'%f[%(%[][%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]?$', -- (ed) or (eds): leading '(', case insensitive 'ed', optional 's', '.' and/or ')'
'[,%.%s]%f[e]eds?%.?$', -- ed or eds: without '('or ')'; case sensitive (ED could be initials Ed could be name)
'%f[%(%[][%(%[]%s*[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%.?%s*[%)%]]?$', -- (editor) or (editors): leading '(', case insensitive, optional '.' and/or ')'
'[,%.%s]%f[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%.?$', -- editor or editors: without '('or ')'; case insensitive
-- these patterns match annotations at beginning of name
'^eds?[%.,;]', -- ed. or eds.: lower case only, optional 's', requires '.'
'^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]', -- (ed) or (eds): also sqare brackets, case insensitive, optional 's', '.'
'^[%(%[]?%s*[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%A', -- (editor or (editors: also sq brackets, case insensitive, optional brackets, 's'
'^[%(%[]?%s*[Ee][Dd][Ii][Tt][Ee][Dd]%A', -- (edited: also sq brackets, case insensitive, optional brackets
-- these patterns match annotations that are the 'name'
'^[Ee][Dd][Ii][Tt][Oo][Rr][Ss]?%.?$', -- editor or editors; case insensitive
}
--[[--------------------------< P R E S E N T A T I O N >------------------------------------------------------
Fixed presentation markup. Originally part of citation_config.messages it has been moved into its own, more semantically
correct place.
]]
local presentation =
{
-- Error output
-- .error class is specified at https://git.wikimedia.org/blob/mediawiki%2Fcore.git/9553bd02a5595da05c184f7521721fb1b79b3935/skins%2Fcommon%2Fshared.css#L538
-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display
['hidden-error'] = '<span class="cs1-hidden-error error citation-comment">$1</span>',
['visible-error'] = '<span class="cs1-visible-error error citation-comment">$1</span>',
['hidden-maint'] = '<span class="cs1-maint citation-comment">$1</span>',
['accessdate'] = '<span class="reference-accessdate">$1$2</span>', -- to allow editors to hide accessdate using personal css
['bdi'] = '<bdi$1>$2</bdi>', -- bidirectional isolation used with |script-title= and the like
['cite'] = '<cite class="$1">$2</cite>'; -- |ref= not set so no id="..." attribute
['cite-id'] = '<cite id="$1" class="$2">$3</cite>'; -- for use when |ref= is set
['format'] = ' <span class="cs1-format">($1)</span>', -- for |format=, |chapter-format=, etc
-- various access levels, for |access=, |doi-access=, |arxiv=, ...
-- narrow no-break space   may work better than nowrap css. Or not? browser support?
['ext-link-access-signal'] = '<span class="$1" title="$2">$3</span>', -- external link with appropriate lock icon
['free'] = {class='cs1-lock-free', title='Freely accessible'}, -- classes defined in Module:Citation/CS1/styles.css
['registration'] = {class='cs1-lock-registration', title='Free registration required'},
['limited'] = {class='cs1-lock-limited', title='Free access subject to limited trial, subscription normally required'},
['subscription'] = {class='cs1-lock-subscription', title='Paid subscription required'},
['interwiki-icon'] = '<span class="$1" title="$2">$3</span>',
['class-wikisource'] = 'cs1-ws-icon',
['italic-title'] = "''$1''",
['kern-left'] = '<span class="cs1-kern-left">$1</span>$2', -- spacing to use when title contains leading single or double quote mark
['kern-right'] = '$1<span class="cs1-kern-right">$2</span>', -- spacing to use when title contains trailing single or double quote mark
-- these for simple wikilinked titles [["text]], [[text"]] and [["text"]]
-- span wraps entire wikilink
['kern-wl-left'] = '<span class="cs1-kern-wl-left">$1</span>', -- when title contains leading single or double quote mark
['kern-wl-right'] = '<span class="cs1-kern-wl-left">$1</span>', -- when title contains trailing single or double quote mark
['kern-wl-both'] = '<span class="cs1-kern-wl-left cs1-kern-wl-right">$1</span>', -- when title contains leading and trailing single or double quote marks
['nowrap1'] = '<span class="nowrap">$1</span>', -- for nowrapping an item: <span ...>yyyy-mm-dd</span>
['nowrap2'] = '<span class="nowrap">$1</span> $2', -- for nowrapping portions of an item: <span ...>dd mmmm</span> yyyy (note white space)
['ocins'] = '<span title="$1" class="Z3988"></span>',
['parameter'] = '<code class="cs1-code">|$1=</code>',
['ps_cs1'] = '.'; -- cs1 style postscript (terminal) character
['ps_cs2'] = ''; -- cs2 style postscript (terminal) character (empty string)
['quoted-text'] = '<q>$1</q>', -- for wrapping |quote= content
['quoted-title'] = '"$1"',
['sep_cs1'] = '.', -- cs1 element separator
['sep_cs2'] = ',', -- cs2 separator
['sep_nl'] = ';', -- cs1|2 style name-list separator between authors is a semicolon
['sep_name'] = ', ', -- cs1|2 style last/first separator is <comma><space>
['sep_nl_vanc'] = ',', -- Vancouver style name-list separator between authors is a comma
['sep_name_vanc'] = ' ', -- Vancouver style last/first separator is a space
['trans-italic-title'] = "[''$1'']",
['trans-quoted-title'] = "[$1]",
['vol-bold'] = '$1 <b>$2</b>', -- sepc, volume; for bold journal cites; for other cites ['vol'] in messages{}
}
--[[--------------------------< A L I A S E S >----------------------------------------------------------------
Aliases table for commonly passed parameters
]]
local aliases = {
['AccessDate'] = {'access-date', 'accessdate'}, -- (Used by InternetArchiveBot)
['Agency'] = 'agency',
['AirDate'] = {'air-date', 'airdate'},
['ArchiveDate'] = {'archive-date', 'archivedate'}, -- (Used by InternetArchiveBot)
['ArchiveFormat'] = 'archive-format',
['ArchiveURL'] = {'archive-url', 'archiveurl'}, -- (Used by InternetArchiveBot)
['ASINTLD'] = 'asin-tld',
['At'] = 'at', -- (Used by InternetArchiveBot)
['Authors'] = {'authors', 'people', 'credits'},
['BookTitle'] = {'book-title', 'booktitle'},
['Cartography'] = 'cartography',
['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section'},
['ChapterFormat'] = {'chapter-format', 'contribution-format', 'entry-format', 'article-format', 'section-format'};
['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'entry-url', 'article-url', 'section-url', 'sectionurl'}, -- (Used by InternetArchiveBot)
['ChapterUrlAccess'] = {'chapter-url-access', 'contribution-url-access', 'entry-url-access', 'article-url-access', 'section-url-access'}, -- (Used by InternetArchiveBot)
['Class'] = 'class', -- cite arxiv and arxiv identifiers
['Collaboration'] = 'collaboration',
['Conference'] = {'conference', 'event'},
['ConferenceFormat'] = {'conference-format', 'event-format'},
['ConferenceURL'] = {'conference-url', 'conferenceurl', 'event-url', 'eventurl'}, -- (Used by InternetArchiveBot)
['Contribution'] = 'contribution', -- introduction, foreword, afterword, etc; required when |contributor= set
['Date'] = 'date',
['Degree'] = 'degree',
['DF'] = 'df',
['DisplayAuthors'] = {'display-authors', 'displayauthors'},
['DisplayContributors'] = 'display-contributors',
['DisplayEditors'] = {'display-editors', 'displayeditors'},
['DisplayInterviewers'] = 'display-interviewers',
['DisplayTranslators'] = 'display-translators',
['Docket'] = 'docket',
['DoiBroken'] = {'doi-broken', 'doi-broken-date', 'doi-inactive-date'},
['Edition'] = 'edition',
['Editors'] = 'editors',
['Embargo'] = 'embargo',
['Encyclopedia'] = {'encyclopedia', 'encyclopaedia'}, -- this one only used by citation
['Episode'] = 'episode', -- cite serial only TODO: make available to cite episode?
['Format'] = 'format',
['ID'] = {'id', 'ID'},
['IgnoreISBN'] = {'ignore-isbn-error', 'ignoreisbnerror'},
['Inset'] = 'inset',
['Issue'] = {'issue', 'number'},
['Language'] = {'language', 'lang'},
['LastAuthorAmp'] = {'last-author-amp', 'lastauthoramp'},
['LayDate'] = {'lay-date', 'laydate'},
['LayFormat'] = 'lay-format',
['LaySource'] = {'lay-source', 'laysource'},
['LayURL'] = {'lay-url', 'layurl'}, -- (Used by InternetArchiveBot)
['MailingList'] = {'mailinglist', 'mailing-list'}, -- cite mailing list only
['Map'] = 'map', -- cite map only
['MapFormat'] = 'map-format', -- cite map only
['MapURL'] = {'mapurl', 'map-url'}, -- cite map only -- (Used by InternetArchiveBot)
['MapUrlAccess'] = 'map-url-access', -- cite map only -- (Used by InternetArchiveBot)
['MessageID'] = 'message-id',
['Minutes'] = 'minutes',
['Mode'] = 'mode',
['NameListFormat'] = 'name-list-format',
['Network'] = 'network',
['NoPP'] = {'no-pp', 'nopp'},
['NoTracking'] = {'template-doc-demo', 'no-cat', 'nocat',
'no-tracking', 'notracking'},
['Number'] = 'number', -- this case only for cite techreport
['OrigYear'] = {'orig-year', 'origyear'},
['Others'] = 'others',
['Page'] = {'p', 'page'}, -- (Used by InternetArchiveBot)
['Pages'] = {'pp', 'pages'}, -- (Used by InternetArchiveBot)
['Periodical'] = {'journal', 'magazine', 'newspaper', 'periodical', 'website', 'work',
'encyclopedia', 'encyclopaedia', 'dictionary', 'mailinglist'}, -- these masquerade as periodicals but aren't TODO: find a better way to handle these?
['Place'] = {'place', 'location'},
['PostScript'] = 'postscript',
['PublicationDate'] = {'publicationdate', 'publication-date'},
['PublicationPlace'] = {'publication-place', 'publicationplace'},
['PublisherName'] = {'publisher', 'institution', 'newsgroup'},
['Quote'] = {'quote', 'quotation'},
['Ref'] = 'ref',
['Scale'] = 'scale',
['ScriptChapter'] = {'script-chapter', 'script-contribution', 'script-entry', 'script-article', 'script-section'},
['ScriptMap'] = 'script-map',
['ScriptPeriodical'] = {'script-journal', 'script-magazine', 'script-newspaper', 'script-periodical', 'script-website', 'script-work'},
['ScriptTitle'] = 'script-title', -- (Used by InternetArchiveBot)
['Section'] = 'section',
['Season'] = 'season',
['Sections'] = 'sections', -- cite map only
['Series'] = {'series', 'version'},
['SeriesSeparator'] = 'series-separator',
['SeriesLink'] = {'series-link', 'serieslink'},
['SeriesNumber'] = {'series-number', 'series-no', 'seriesnumber', 'seriesno'},
['Sheet'] = 'sheet', -- cite map only
['Sheets'] = 'sheets', -- cite map only
['Station'] = 'station',
['Time'] = 'time',
['TimeCaption'] = {'time-caption', 'timecaption'},
['Title'] = 'title', -- (Used by InternetArchiveBot)
['TitleLink'] = {'title-link', 'episode-link', 'titlelink', 'episodelink'}, -- (Used by InternetArchiveBot)
['TitleNote'] = 'department',
['TitleType'] = {'type', 'medium'},
['TransChapter'] = {'trans-article', 'trans-chapter', 'trans-contribution', 'trans-entry', 'trans-section'},
['Transcript'] = 'transcript',
['TranscriptFormat'] = 'transcript-format',
['TranscriptURL'] = {'transcript-url', 'transcripturl'}, -- (Used by InternetArchiveBot)
['TransMap'] = 'trans-map', -- cite map only
['TransPeriodical'] = {'trans-journal', 'trans-magazine', 'trans-newspaper', 'trans-periodical', 'trans-website', 'trans-work'},
['TransTitle'] = 'trans-title', -- (Used by InternetArchiveBot)
['URL'] = {'url', 'URL'}, -- (Used by InternetArchiveBot)
['UrlAccess'] = {'url-access'}, -- (Used by InternetArchiveBot)
['UrlStatus'] = 'url-status', -- (Used by InternetArchiveBot)
['Vauthors'] = 'vauthors',
['Veditors'] = 'veditors',
['Via'] = 'via',
['Volume'] = 'volume',
['Year'] = 'year',
['AuthorList-First'] = {"first#", "given#", "author-first#", "author#-first"},
['AuthorList-Last'] = {"last#", "author#", "surname#", "author-last#", "author#-last", "subject#", 'host#'},
['AuthorList-Link'] = {"authorlink#", "author-link#", "author#-link", "subjectlink#", "author#link", "subject-link#", "subject#-link", "subject#link"},
['AuthorList-Mask'] = {"author-mask#", "authormask#", "author#mask", "author#-mask"},
['ContributorList-First'] = {'contributor-first#', 'contributor#-first', 'contributor-given#', 'contributor#-given'},
['ContributorList-Last'] = {'contributor#', 'contributor-last#', 'contributor#-last', 'contributor-surname#', 'contributor#-surname'},
['ContributorList-Link'] = {'contributor-link#', 'contributor#-link'},
['ContributorList-Mask'] = {'contributor-mask#', 'contributor#-mask'},
['EditorList-First'] = {"editor-first#", "editor#-first", "editor-given#", "editor#-given"},
['EditorList-Last'] = {"editor#", "editor-last#", "editor#-last", "editor-surname#", "editor#-surname"},
['EditorList-Link'] = {"editor-link#", "editor#-link", "editorlink#", "editor#link"},
['EditorList-Mask'] = {"editor-mask#", "editor#-mask", "editormask#", "editor#mask"},
['InterviewerList-First'] = {'interviewer-first#', 'interviewer#-first'},
['InterviewerList-Last'] = {'interviewer#', 'interviewer-last#', 'interviewer#-last'},
['InterviewerList-Link'] = {'interviewer-link#', 'interviewer#-link'},
['InterviewerList-Mask'] = {'interviewer-mask#', 'interviewer#-mask'},
['TranslatorList-First'] = {'translator-first#', 'translator#-first', 'translator-given#', 'translator#-given'},
['TranslatorList-Last'] = {'translator#', 'translator-last#', 'translator#-last', 'translator-surname#', 'translator#-surname'},
['TranslatorList-Link'] = {'translator-link#', 'translator#-link'},
['TranslatorList-Mask'] = {'translator-mask#', 'translator#-mask'},
}
--[[--------------------------< P U N C T _ S K I P >----------------------------------------------------------
builds a table of parameter names that the extraneous terminal punctuation check should not check.
]]
local punct_skip = {};
local meta_params = { -- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value
'BookTitle', 'Chapter', 'ScriptChapter', 'ScriptTitle', 'Title', 'TransChapter', 'Transcript', 'TransMap', 'TransTitle', -- title-holding parameters
'PostScript', 'Quote', -- miscellaneous
'ArchiveURL', 'ChapterURL', 'ConferenceURL', 'LayURL', 'MapURL', 'TranscriptURL', 'URL', -- url-holding parameters
}
for _, meta_param in ipairs (meta_params) do -- for each meta parameter key
local params = aliases[meta_param]; -- get the parameter or the table of parameters associated with the meta parameter name
if 'string' == type (params) then
punct_skip[params] = 1; -- just a single parameter
else
for _, param in ipairs (params) do -- get the parameter name
punct_skip[param] = 1; -- add the parameter name to the skip table
end
end
end
--[[--------------------------< S P E C I A L C A S E T R A N S L A T I O N S >----------------------------
This table is primarily here to support internationalization. Translations in this table are used, for example,
when an error message, category name, etc is extracted from the English alias key. There may be other cases where
this translation table may be useful.
]]
local special_case_translation = {
['AuthorList'] = 'authors list', -- these for multiple names maint categories
['ContributorList'] = 'contributors list',
['EditorList'] = 'editors list',
['InterviewerList'] = 'interviewers list',
['TranslatorList'] = 'translators list',
['authors'] = 'authors', -- used in get_display_names()
['contributors'] = 'contributors',
['editors'] = 'editors',
['interviewers'] = 'interviewers',
['translators'] = 'translators',
['archived_copy'] = '^archived?%s+copy$', -- lua pattern to match pseudo title used by Internet Archive bot and others as place holder for unknown |title= value
-- used with CS1 maint: Archived copy as title
}
--[[--------------------------< D E F A U L T S >--------------------------------------------------------------
Default parameter values
TODO: keep this? Only one default?
]]
local defaults = {
['UrlStatus'] = 'dead', -- (Used by InternetArchiveBot)
}
--[[--------------------------< D A T E _ N A M E S >----------------------------------------------------------
This table of tables lists local language date names and fallback English date names. The code in Date_validation
will look first in the local table for valid date names. If date names are not found in the local table, the code
will look in the English table.
Because citations can be copied to the local wiki from en.wiki, the English is required when the date-name translation
function date_name_xlate() is used.
In these tables, season numbering is defined by ISO DIS 8601:2016 part 2 §4.7 'Divisions of a year'. The standard
defines various divisions using numbers 21-41. cs1|2 only supports generic seasons. ISO DIS 8601:2016 does support
the distinction between north and south hemispere seasons but cs1|2 has no way to make that distinction.
The standard does not address 'named' dates so, for the purposes of cs1|2, Christmas is defined here as 99, which
should be out of the ISO DIS 8601:2016 range of uses for a while.
]]
local date_names = {
['en'] = { -- English
['long'] = {['January']=1, ['February']=2, ['March']=3, ['April']=4, ['May']=5, ['June']=6, ['July']=7, ['August']=8, ['September']=9, ['October']=10, ['November']=11, ['December']=12},
['short'] = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12},
['season'] = {['Winter']=24, ['Spring']=21, ['Summer']=22, ['Fall']=23, ['Autumn']=23},
['named'] = {['Christmas']=99},
},
['local'] = { -- replace these English date names with the local language equivalents
['long'] = {['January']=1, ['February']=2, ['March']=3, ['April']=4, ['May']=5, ['June']=6, ['July']=7, ['August']=8, ['September']=9, ['October']=10, ['November']=11, ['December']=12},
['short'] = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12},
['season'] = {['Winter']=24, ['Spring']=21, ['Summer']=22, ['Fall']=23, ['Autumn']=23},
['named'] = {['Christmas']=99},
},
['inv_local_l'] = {}, -- used in date reformatting; copy of date_names['local'].long where k/v are inverted: [1]='<local name>' etc
['inv_local_s'] = {}, -- used in date reformatting; copy of date_names['local'].short where k/v are inverted: [1]='<local name>' etc
['local_digits'] = {['0'] = '0', ['1'] = '1', ['2'] = '2', ['3'] = '3', ['4'] = '4', ['5'] = '5', ['6'] = '6', ['7'] = '7', ['8'] = '8', ['9'] = '9'}, -- used to convert local language digits to Western 0-9
['xlate_digits'] = {},
}
for name, i in pairs (date_names['local'].long) do -- this table is ['name'] = i
date_names['inv_local_l'][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
for name, i in pairs (date_names['local'].short) do -- this table is ['name'] = i
date_names['inv_local_s'][i] = name; -- invert to get [i] = 'name' for conversions from ymd
end
for ld, ed in pairs (date_names.local_digits) do -- make a digit translation table for simple date translation from en to local language using local_digits table
date_names.xlate_digits [ed] = ld; -- en digit becomes index with local digit as the value
end
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
'{{ *[Uu]se (dmy) dates *[|}]', -- 915k -- sorted by approximate transclusion count
'{{ *[Uu]se *(mdy) *dates *[|}]', -- 161k
'{{ *[Uu]se (DMY) dates *[|}]', -- 2929
'{{ *[Uu]se *(dmy) *[|}]', -- 250 + 34
'{{ *([Dd]my) *[|}]', -- 272
'{{ *[Uu]se (MDY) dates *[|}]', -- 173
'{{ *[Uu]se *(mdy) *[|}]', -- 59 + 12
'{{ *([Mm]dy) *[|}]', -- 9
'{{ *[Uu]se (MDY) *[|}]', -- 3
'{{ *([Dd]MY) *[|}]', -- 2
'{{ *([Mm]DY) *[|}]', -- 0
-- '{{ *[Uu]se(mdy) *[|}]',
-- '{{ *[Uu]se(mdy)dates *[|}]',
-- '{{ *[Uu]se(dmy) *[|}]',
}
local function get_date_format ()
local content = mw.title.getCurrentTitle():getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
if match then
content = content:match ('%b{}', start); -- get the whole template
if content:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
return match:lower() .. '-' .. content:match ('| *cs1%-dates *= *([lsy][sy]?)');
else
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
end
end
end
end
local global_df = get_date_format ();
--[[--------------------------< V O L U M E , I S S U E , P A G E S >----------------------------------------
These tables hold cite class values (from the template invocation) and identify those templates that support
|volume=, |issue=, and |page(s)= parameters. Cite conference and cite map require further qualification which
is handled in the main module.
]]
local templates_using_volume = {'citation', 'audio-visual', 'book', 'conference', 'encyclopaedia', 'interview', 'journal', 'magazine', 'map', 'news', 'report', 'techreport', 'thesis'}
local templates_using_issue = {'citation', 'conference', 'episode', 'interview', 'journal', 'magazine', 'map', 'news', 'podcast'}
local templates_not_using_page = {'audio-visual', 'episode', 'mailinglist', 'newsgroup', 'podcast', 'serial', 'sign', 'speech'}
--[[--------------------------< K E Y W O R D S >--------------------------------------------------------------
These tables hold keywords for those parameters that have defined sets of acceptible keywords.
]]
--[[--------------------------< M A K E _ K E Y W O R D S _ L I S T >------------------------------------------
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.
keywords_lists{}, is a table of tables from keywords{}
]]
local function make_keywords_list (keywords_lists)
local out_table = {}; -- output goes here
for _, keyword_list in ipairs (keywords_lists) do -- spin through keywords_lists{} and get a table of keywords
for _, keyword in ipairs (keyword_list) do -- spin through keyword_list{} and add each keyword, ...
table.insert (out_table, keyword); -- ... as plain text, to the output list
end
end
return out_table;
end
--[[--------------------------< K E Y W O R D S T A B L E >--------------------------------------------------
this is a list of keywords; each key in the list is associated with a table of synonymous keywords possibly from
different languages.
for i18n: add local-language keywords to value table; do not change the key. For example, adding the German keyword 'ja':
['affirmative'] = {'yes', 'true', 'y', 'ja'},
Because cs1|2 templates from en.wiki articles are often copied to other local wikis, it is recommended that the English
keywords remain in these tables.
]]
local keywords = {
['affirmative'] = {'yes', 'true', 'y'}, -- ignore-isbn-error, last-author-amp, no-tracking, nopp -- (Used by InternetArchiveBot)
['afterword'] = {'afterword'}, -- contribution
['bot: unknown'] = {'bot: unknown'}, -- url-status -- (Used by InternetArchiveBot)
['cs1'] = {'cs1'}, -- mode
['cs2'] = {'cs2'}, -- mode
['dead'] = {'dead'}, -- url-status -- (Used by InternetArchiveBot)
['dmy'] = {'dmy'}, -- df
['dmy-all'] = {'dmy-all'}, -- df
['foreword'] = {'foreword'}, -- contribution
['free'] = {'free'}, -- url-access -- (Used by InternetArchiveBot)
['introduction'] = {'introduction'}, -- contribution
['limited'] = {'limited'}, -- url-access -- (Used by InternetArchiveBot)
['live'] = {'live'}, -- url-status -- (Used by InternetArchiveBot)
['mdy'] = {'mdy'}, -- df
['mdy-all'] = {'mdy-all'}, -- df
['preface'] = {'preface'}, -- contribution
['registration'] = {'registration'}, -- url-access -- (Used by InternetArchiveBot)
['subscription'] = {'subscription'}, -- url-access -- (Used by InternetArchiveBot)
['unfit'] = {'unfit'}, -- url-status -- (Used by InternetArchiveBot)
['usurped'] = {'usurped'}, -- url-status -- (Used by InternetArchiveBot)
['vanc'] = {'vanc'}, -- name-list-format
['ymd'] = {'ymd'}, -- df
['ymd-all'] = {'ymd-all'}, -- df
-- ['yMd'] = {'yMd'}, -- df; not supported at en.wiki
-- ['yMd-all'] = {'yMd-all'}, -- df; not supported at en.wiki
}
--[[--------------------------< X L A T E _ K E Y W O R D S >--------------------------------------------------
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:
['affirmative'] = {'yes', 'true', 'y'}, -- in keywords{}
becomes
['yes'] = 'affirmative', -- in keywords_xlate{}
['true'] = 'affirmative',
['y'] = 'affirmative',
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent
that may be used in other modules of this suite
]]
local function xlate_keywords ()
local out_table = {}; -- output goes here
for k, keywords_t in pairs (keywords) do -- spin through the keywords table
for _, keyword in ipairs (keywords_t) do -- for each keyword
out_table[keyword] = k; -- create an entry in the output table where keyword is the key
end
end
return out_table;
end
local keywords_xlate = xlate_keywords (); -- the list of translated keywords
--[[--------------------------< K E Y W O R D S _ L I S T S >--------------------------------------------------
this is a list of lists of valid keywords for the various parameters in [key]. Generally the keys in this table
are the canonical en.wiki parameter names though some are contrived because of use in multiple differently named
parameters: ['yes_true_y'], ['id-access'].
The function make_keywords_list() extracts the individual keywords from the appropriate list in keywords{}.
The lists in this table are used to validate the keyword assignment for the parameters named in this table's keys.
]]
local keywords_lists = {
['yes_true_y'] = make_keywords_list ({keywords.affirmative}),
['contribution'] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),
['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all']}),
-- ['df'] = make_keywords_list ({keywords.dmy, keywords['dmy-all'], keywords.mdy, keywords['mdy-all'], keywords.ymd, keywords['ymd-all'], keywords.yMd, keywords['yMd-all']}), -- not supported at en.wiki
['mode'] = make_keywords_list ({keywords.cs1, keywords.cs2}),
['name-list-format'] = make_keywords_list ({keywords.vanc}),
['url-access'] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),
['url-status'] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords['bot: unknown']}),
['id-access'] = make_keywords_list ({keywords.free}),
}
--[[--------------------------< S T R I P M A R K E R S >------------------------------------------------------
Common pattern definition location for stripmarkers so that we don't have to go hunting for them if (when)
MediaWiki changes their form.
]]
local stripmarkers = {
['any'] = '\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127', -- capture returns name of stripmarker
['math'] = '\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127' -- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()
}
--[[--------------------------< I N V I S I B L E _ C H A R A C T E R S >--------------------------------------
This table holds non-printing or invisible characters indexed either by name or by Unicode group. Values are decimal
representations of UTF-8 codes. The table is organized as a table of tables because the lua pairs keyword returns
table data in an arbitrary order. Here, we want to process the table from top to bottom because the entries at
the top of the table are also found in the ranges specified by the entries at the bottom of the table.
Also here is a pattern that recognizes stripmarkers that begin and end with the delete characters. The nowiki
stripmarker is not an error but some others are because the parameter values that include them become part of the
template's metadata before stripmarker replacement.
]]
local invisible_chars = {
{'replacement', '\239\191\189'}, -- U+FFFD, EF BF BD
{'zero width joiner', '\226\128\141'}, -- U+200D, E2 80 8D
{'zero width space', '\226\128\139'}, -- U+200B, E2 80 8B
{'hair space', '\226\128\138'}, -- U+200A, E2 80 8A
{'soft hyphen', '\194\173'}, -- U+00AD, C2 AD
{'horizontal tab', '\009'}, -- U+0009 (HT), 09
{'line feed', '\010'}, -- U+000A (LF), 0A
{'carriage return', '\013'}, -- U+000D (CR), 0D
{'stripmarker', stripmarkers.any}, -- stripmarker; may or may not be an error; capture returns the stripmaker type
{'delete', '\127'}, -- U+007F (DEL), 7F; must be done after stripmarker test
{'C0 control', '[\000-\008\011\012\014-\031]'}, -- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))
{'C1 control', '[\194\128-\194\159]'}, -- U+0080–U+009F (XXX–APC), C2 80 – C2 9F
-- {'Specials', '[\239\191\185-\239\191\191]'}, -- U+FFF9-U+FFFF, EF BF B9 – EF BF BF
-- {'Private use area', '[\238\128\128-\239\163\191]'}, -- U+E000–U+F8FF, EE 80 80 – EF A3 BF
-- {'Supplementary Private Use Area-A', '[\243\176\128\128-\243\191\191\189]'}, -- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD
-- {'Supplementary Private Use Area-B', '[\244\128\128\128-\244\143\191\189]'}, -- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD
}
--[[
Indic script makes use of zero width joiner as a character modifier so zwj characters must be left in. This
pattern covers all of the unicode characters for these languages:
Devanagari 0900–097F – https://unicode.org/charts/PDF/U0900.pdf
Devanagari extended A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf
Bengali 0980–09FF – https://unicode.org/charts/PDF/U0980.pdf
Gurmukhi 0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf
Gujarati 0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf
Oriya 0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf
Tamil 0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf
Telugu 0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf
Kannada 0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf
Malayalam 0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf
plus the not-necessarily Indic scripts for Sinhala and Burmese:
Sinhala 0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf
Myanmar 1000-109F - https://unicode.org/charts/PDF/U1000.pdf
Myanmar extended A AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf
Myanmar extended B A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf
the pattern is used by has_invisible_chars() and coins_cleanup()
TODO: find a better place for this?
]]
local indic_script = '[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]';
--[[--------------------------< L A N G U A G E S U P P O R T >----------------------------------------------
These tables and constants support various language-specific functionality.
]]
local this_wiki_code = mw.getContentLanguage():getCode() -- get this wiki's language code
local local_lang_cat_enable = false; -- set to true to categorize pages where |language=<local wiki's language>
--[[--------------------------< S C R I P T _ L A N G _ C O D E S >--------------------------------------------
This table is used to hold ISO 639-1 two-character language codes that apply only to |script-title= and |script-chapter=
]]
local script_lang_codes = {
'am', 'ar', 'be', 'bg', 'bn', 'bo', 'bs', 'dv', 'dz', 'el', 'fa', -- ISO 639-1 codes only for |script-title= and |script-chapter=
'gu', 'he', 'hi', 'hy', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'ku',
'mk', 'ml', 'mn', 'mr', 'my', 'ne', 'ota', 'ps', 'ru', 'sd', 'si',
'sr', 'ta', 'tg', 'th', 'ug', 'uk', 'ur', 'uz', 'yi', 'zh'
};
--[[--------------------------< L A N G U A G E R E M A P P I N G >------------------------------------------
These tables hold language information that is different (correct) from MediaWiki's definitions
]]
local lang_code_remap = { -- used for |language= and |script-title= / |script-chapter=
['als'] = 'Tosk Albanian', -- MediaWiki returns Alemannisch
['bh'] = 'Bihari', -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri wWikipedia: bh.wikipedia.org
['bla'] = 'Blackfoot', -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['bn'] = 'Bengali', -- MediaWiki returns Bangla
['ca-valencia'] = 'Valencian', -- IETF variant of Catalan
['crh'] = 'Crimean Tatar', -- synonymous with Crimean Turkish (return value from {{#language:crh|en}})
['ilo'] = 'Ilocano', -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['ksh'] = 'Kölsch', -- MediaWiki: Colognian; use IANA/ISO 639 preferred name
['ksh-x-colog'] = 'Colognian', -- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data
['mis-x-ripuar'] = 'Ripuarian', -- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data
['nan-tw'] = 'Taiwanese Hokkien', -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name
}
local lang_name_remap = { -- used for |language=
['alemannisch'] = {'Swiss German', 'gsw'}, -- not an ISO or IANA language name; MediaWiki uses 'als' as a subdomain name for Alemannic Wikipedia: als.wikipedia.org
['bangla'] = {'Bengali', 'bn'}, -- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap
['bengali'] = {'Bengali', 'bn'}, -- MediaWiki doesn't use exonym so here we provide correct language name and 639-1 code
['bhojpuri'] = {'Bhojpuri', 'bho'}, -- MediaWiki uses 'bh' as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org
['bihari'] = {'Bihari', 'bh'}, -- MediaWiki replaces 'Bihari' with 'Bhojpuri' so 'Bihari' cannot be found
['blackfoot'] = {'Blackfoot', 'bla'}, -- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name
['colognian'] = {'Colognian', 'ksh-x-colog'}, -- MediaWiki preferred name for ksh
['crimean tatar'] = {'Crimean Tatar', 'crh'}, -- MediaWiki uses 'crh' as a subdomain name for Crimean Tatar Wikipedia: crh.wikipedia.org
['ilocano'] = {'Ilocano', 'ilo'}, -- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name
['kolsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name (use o instead of ö)
['kölsch'] = {'Kölsch', 'ksh'}, -- use IANA/ISO 639 preferred name
['ripuarian'] = {'Ripuarian', 'mis-x-ripuar'}, -- group of dialects; no code in MediaWiki or in IANA/ISO 639
-- ['siksika'] = {'Siksika', 'bla'}, -- MediaWiki/IANA/ISO 639 preferred name: Siksika
['taiwanese hokkien'] = {'Taiwanese Hokkien', 'nan-TW'}, -- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese
['tosk albanian'] = {'Tosk Albanian', 'als'}, -- MediaWiki replaces 'Tosk Albanian' with 'Alemannisch' so 'Tosk Albanian' cannot be found
['valencian'] = {'Valencian', 'ca'}, -- variant of Catalan; categorizes as Catalan
}
--[[--------------------------< M A I N T E N A N C E _ C A T E G O R I E S >----------------------------------
Here we name maintenance categories to be used in maintenance messages.
]]
local maint_cats = {
['ASIN'] = 'CS1 maint: ASIN uses ISBN',
['archived_copy'] = 'CS1 maint: archived copy as title',
['authors'] = 'CS1 maint: uses authors parameter',
['bot:_unknown'] = 'CS1 maint: BOT: original-url status unknown',
['date_format'] = 'CS1 maint: date format',
['date_year'] = 'CS1 maint: date and year',
['disp_name'] = 'CS1 maint: display-$1', -- $1 is authors, contributors, editors, interviewers, translators; gets value from special_case_translation table
['editors'] = 'CS1 maint: uses editors parameter',
['embargo'] = 'CS1 maint: PMC embargo expired',
['extra_punct'] = 'CS1 maint: extra punctuation',
['extra_text'] = 'CS1 maint: extra text',
['extra_text_names'] = 'CS1 maint: extra text: $1', -- $1 is <name>s list; gets value from special_case_translation table
['ignore_isbn_err'] = 'CS1 maint: ignored ISBN errors',
['location'] = 'CS1 maint: location',
['mult_names'] = 'CS1 maint: multiple names: $1', -- $1 is <name>s list; gets value from special_case_translation table
['others'] = 'CS1 maint: others',
['pmc_format'] = 'CS1 maint: PMC format',
['unfit'] = 'CS1 maint: unfit url',
['unknown_lang'] = 'CS1 maint: unrecognized language',
['untitled'] = 'CS1 maint: untitled periodical',
['zbl'] = 'CS1 maint: ZBL',
}
--[[--------------------------< P R O P E R T I E S _ C A T E G O R I E S >------------------------------------
Here we name properties categories
]]
local prop_cats = {
['foreign_lang_source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code
['foreign_lang_source_2'] = 'CS1 foreign language sources (ISO 639-2)|$1', -- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key
['local_lang_source'] = 'CS1 $1-language sources ($2)', -- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false
['location test'] = 'CS1 location test',
['script'] = 'CS1 uses foreign language script', -- when language specified by |script-title=xx: doesn't have its own category
['script_with_name'] = 'CS1 uses $1-language script ($2)', -- |script-title=xx: has matching category; $1 is language name, $2 is ISO639-1 code
['jul_greg_uncertainty'] = 'CS1: Julian–Gregorian uncertainty', -- probably temporary cat to identify scope of template with dates 1 October 1582 – 1 January 1926
['long_vol'] = 'CS1: long volume value', -- probably temporary cat to identify scope of |volume= values longer than 4 charachters
}
--[[--------------------------< T I T L E _ T Y P E S >--------------------------------------------------------
Here we map a template's CitationClass to TitleType (default values for |type= parameter)
]]
local title_types = {
['AV-media-notes'] = 'Media notes',
['interview'] = 'Interview',
['mailinglist'] = 'Mailing list',
['map'] = 'Map',
['podcast'] = 'Podcast',
['pressrelease'] = 'Press release',
['report'] = 'Report',
['techreport'] = 'Technical report',
['thesis'] = 'Thesis',
}
--[[--------------------------< E R R O R _ C O N D I T I O N S >----------------------------------------------
Error condition table
The following contains a list of IDs for various error conditions defined in the code. For each ID, we specify a
text message to display, an error category to include, and whether the error message should be wrapped as a hidden comment.
Anchor changes require identical changes to matching anchor in Help:CS1 errors
]]
local error_conditions = {
accessdate_missing_url = {
message = '<code class="cs1-code">|access-date=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'accessdate_missing_url',
category = 'Pages using citations with accessdate and no URL',
hidden = false
},
apostrophe_markup = {
message = 'Italic or bold markup not allowed in: <code class="cs1-code">|$1=</code>',
anchor = 'apostrophe_markup',
category = 'CS1 errors: markup',
hidden = false
},
archive_missing_date = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|archive-date=</code>',
anchor = 'archive_missing_date',
category = 'Pages with archiveurl citation errors',
hidden = false
},
archive_missing_url = {
message = '<code class="cs1-code">|archive-url=</code> requires <code class="cs1-code">|url=</code>',
anchor = 'archive_missing_url',
category = 'Pages with archiveurl citation errors',
hidden = false
},
archive_url = {
message = '<code class="cs1-code">|archive-url=</code> is malformed: $1',
anchor = 'archive_url',
category = 'Pages with archiveurl citation errors',
hidden = false
},
arxiv_missing = {
message = '<code class="cs1-code">|arxiv=</code> required',
anchor = 'arxiv_missing',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
arxiv_params_not_supported = {
message = 'Unsupported parameter(s) in cite arXiv',
anchor = 'arxiv_params_not_supported',
category = 'CS1 errors: arXiv', -- same as bad arxiv
hidden = false
},
bad_arxiv = {
message = 'Check <code class="cs1-code">|arxiv=</code> value',
anchor = 'bad_arxiv',
category = 'CS1 errors: arXiv',
hidden = false
},
bad_asin = {
message = 'Check <code class="cs1-code">|asin=</code> value',
anchor = 'bad_asin',
category ='CS1 errors: ASIN',
hidden = false
},
bad_bibcode = {
message = 'Check <code class="cs1-code">|bibcode=</code> $1',
anchor = 'bad_bibcode',
category = 'CS1 errors: bibcode',
hidden = false
},
bad_biorxiv = {
message = 'Check <code class="cs1-code">|biorxiv=</code> value',
anchor = 'bad_biorxiv',
category = 'CS1 errors: bioRxiv',
hidden = false
},
bad_citeseerx = {
message = 'Check <code class="cs1-code">|citeseerx=</code> value',
anchor = 'bad_citeseerx',
category = 'CS1 errors: citeseerx',
hidden = false
},
bad_date = {
message = 'Check date values in: <code class="cs1-code">$1</code>',
anchor = 'bad_date',
category = 'CS1 errors: dates',
hidden = false
},
bad_doi = {
message = 'Check <code class="cs1-code">|doi=</code> value',
anchor = 'bad_doi',
category = 'CS1 errors: DOI',
hidden = false
},
bad_hdl = {
message = 'Check <code class="cs1-code">|hdl=</code> value',
anchor = 'bad_hdl',
category = 'CS1 errors: HDL',
hidden = false
},
bad_isbn = {
message = 'Check <code class="cs1-code">|isbn=</code> value: $1',
anchor = 'bad_isbn',
category = 'CS1 errors: ISBN',
hidden = false
},
bad_ismn = {
message = 'Check <code class="cs1-code">|ismn=</code> value',
anchor = 'bad_ismn',
category = 'CS1 errors: ISMN',
hidden = false
},
bad_issn = {
message = 'Check <code class="cs1-code">|$1issn=</code> value',
anchor = 'bad_issn',
category = 'CS1 errors: ISSN',
hidden = false
},
bad_jfm = {
message = 'Check <code class="cs1-code">|jfm=</code> value',
anchor = 'bad_jfm',
category = 'CS1 errors: JFM',
hidden = false
},
bad_lccn = {
message = 'Check <code class="cs1-code">|lccn=</code> value',
anchor = 'bad_lccn',
category = 'CS1 errors: LCCN',
hidden = false
},
bad_usenet_id = {
message = 'Check <code class="cs1-code">|message-id=</code> value',
anchor = 'bad_message_id',
category = 'CS1 errors: message-id',
hidden = false
},
bad_mr = {
message = 'Check <code class="cs1-code">|mr=</code> value',
anchor = 'bad_mr',
category = 'CS1 errors: MR',
hidden = false
},
bad_ol = {
message = 'Check <code class="cs1-code">|ol=</code> value',
anchor = 'bad_ol',
category = 'CS1 errors: OL',
hidden = false
},
bad_paramlink = { -- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=
message = 'Check <code class="cs1-code">|$1=</code> value',
anchor = 'bad_paramlink',
category = 'CS1 errors: parameter link',
hidden = false
},
bad_pmc = {
message = 'Check <code class="cs1-code">|pmc=</code> value',
anchor = 'bad_pmc',
category = 'CS1 errors: PMC',
hidden = false
},
bad_pmid = {
message = 'Check <code class="cs1-code">|pmid=</code> value',
anchor = 'bad_pmid',
category = 'CS1 errors: PMID',
hidden = false
},
bad_oclc = {
message = 'Check <code class="cs1-code">|oclc=</code> value',
anchor = 'bad_oclc',
category = 'CS1 errors: OCLC',
hidden = false
},
bad_ssrn = {
message = 'Check <code class="cs1-code">|ssrn=</code> value',
anchor = 'bad_ssrn',
category = 'CS1 errors: SSRN',
hidden = false
},
bad_url = {
message = 'Check $1 value',
anchor = 'bad_url',
category = 'Pages with URL errors',
hidden = false
},
bad_zbl = {
message = 'Check <code class="cs1-code">|zbl=</code> value',
anchor = 'bad_zbl',
category = 'CS1 errors: ZBL',
hidden = false
},
bare_url_missing_title = {
message = '$1 missing title',
anchor = 'bare_url_missing_title',
category = 'Pages with citations having bare URLs',
hidden = false
},
biorxiv_missing = {
message = '<code class="cs1-code">|biorxiv=</code> required',
anchor = 'biorxiv_missing',
category = 'CS1 errors: bioRxiv', -- same as bad bioRxiv
hidden = false
},
chapter_ignored = {
message = '<code class="cs1-code">|$1=</code> ignored',
anchor = 'chapter_ignored',
category = 'CS1 errors: chapter ignored',
hidden = false
},
citation_missing_title = {
message = 'Missing or empty <code class="cs1-code">|$1=</code>',
anchor = 'citation_missing_title',
category = 'Pages with citations lacking titles',
hidden = false
},
citeseerx_missing = {
message = '<code class="cs1-code">|citeseerx=</code> required',
anchor = 'citeseerx_missing',
category = 'CS1 errors: citeseerx', -- same as bad citeseerx
hidden = false
},
cite_web_url = { -- this error applies to cite web and to cite podcast
message = 'Missing or empty <code class="cs1-code">|url=</code>',
anchor = 'cite_web_url',
category = 'Pages using web citations with no URL',
hidden = false
},
class_ignored = {
message = '<code class="cs1-code">|class=</code> ignored',
anchor = 'class_ignored',
category = 'CS1 errors: class',
hidden = false
},
contributor_ignored = {
message = '<code class="cs1-code">|contributor=</code> ignored',
anchor = 'contributor_ignored',
category = 'CS1 errors: contributor',
hidden = false
},
contributor_missing_required_param = {
message = '<code class="cs1-code">|contributor=</code> requires <code class="cs1-code">|$1=</code>',
anchor = 'contributor_missing_required_param',
category = 'CS1 errors: contributor',
hidden = false
},
deprecated_params = {
message = 'Cite uses deprecated parameter <code class="cs1-code">|$1=</code>',
anchor = 'deprecated_params',
category = 'CS1 errors: deprecated parameters',
hidden = false
},
doibroken_missing_doi = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|doi=</code>',
anchor = 'doibroken_missing_doi',
category = 'CS1 errors: DOI',
hidden = false
},
empty_citation = {
message = 'Empty citation',
anchor = 'empty_citation',
category = 'Pages with empty citations',
hidden = false
},
etal = {
message = 'Explicit use of et al. in: <code class="cs1-code">|$1=</code>',
anchor = 'explicit_et_al',
category = 'CS1 errors: explicit use of et al.',
hidden = false
},
first_missing_last = {
message = '<code class="cs1-code">|$1=</code> missing <code class="cs1-code">|$2=</code>', -- $1 is first alias, $2 is matching last alias
anchor = 'first_missing_last',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
format_missing_url = {
message = '<code class="cs1-code">|$1=</code> requires <code class="cs1-code">|$2=</code>',
anchor = 'format_missing_url',
category = 'Pages using citations with format and no URL',
hidden = false
},
invalid_param_val = {
message = 'Invalid <code class="cs1-code">|$1=$2</code>',
anchor = 'invalid_param_val',
category = 'CS1 errors: invalid parameter value',
hidden = false
},
invisible_char = {
message = '$1 in $2 at position $3',
anchor = 'invisible_char',
category = 'CS1 errors: invisible characters',
hidden = false
},
missing_name = {
message = 'Missing <code class="cs1-code">|$1$2=</code>', -- $1 is modified NameList; $2 is enumerator
anchor = 'missing_name',
category = 'CS1 errors: missing name', -- author, contributor, editor, interviewer, translator
hidden = false
},
missing_periodical = {
message = 'Cite $1 requires <code class="cs1-code">|$2=</code>', -- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1
anchor = 'missing_periodical',
category = 'CS1 errors: missing periodical',
hidden = true
},
missing_pipe = {
message = 'Missing pipe in: <code class="cs1-code">|$1=</code>',
anchor = 'missing_pipe',
category = 'CS1 errors: missing pipe',
hidden = false
},
param_access_requires_param = {
message = '<code class="cs1-code">|$1-access=</code> requires <code class="cs1-code">|$1=</code>',
anchor = 'param_access_requires_param',
category = 'CS1 errors: param-access',
hidden = false
},
param_has_ext_link = {
message = 'External link in <code class="cs1-code">$1</code>',
anchor = 'param_has_ext_link',
category = 'CS1 errors: external links',
hidden = false
},
parameter_ignored = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored',
anchor = 'parameter_ignored',
category = 'Pages with citations using unsupported parameters',
hidden = false
},
parameter_ignored_suggest = {
message = 'Unknown parameter <code class="cs1-code">|$1=</code> ignored (<code class="cs1-code">|$2=</code> suggested)',
anchor = 'parameter_ignored_suggest',
category = 'Pages with citations using unsupported parameters',
hidden = false
},
redundant_parameters = {
message = 'More than one of $1 specified',
anchor = 'redundant_parameters',
category = 'Pages with citations having redundant parameters',
hidden = false
},
script_parameter = {
message = 'Invalid <code class="cs1-code">|$1=</code>: $2',
anchor = 'script_parameter',
category = 'CS1 errors: script parameters',
hidden = false
},
ssrn_missing = {
message = '<code class="cs1-code">|ssrn=</code> required',
anchor = 'ssrn_missing',
category = 'CS1 errors: ssrn', -- same as bad arxiv
hidden = false
},
text_ignored = {
message = 'Text "$1" ignored',
anchor = 'text_ignored',
category = 'Pages with citations using unnamed parameters',
hidden = false
},
trans_missing_title = {
message = '<code class="cs1-code">|trans-$1=</code> requires <code class="cs1-code">|$1=</code>',
anchor = 'trans_missing_title',
category = 'CS1 errors: translated title',
hidden = false
},
vancouver = {
message = 'Vancouver style error: $1',
anchor = 'vancouver',
category = 'CS1 errors: Vancouver style',
hidden = false
},
wikilink_in_url = {
message = 'URL–wikilink conflict', -- uses ndash
anchor = 'wikilink_in_url',
category = 'CS1 errors: URL–wikilink conflict', -- uses ndash
hidden = false
},
}
--[[--------------------------< I D _ H A N D L E R S >--------------------------------------------------------
The following contains a list of values for various defined identifiers. For each identifier we specify a
variety of information necessary to properly render the identifier in the citation.
parameters: a list of parameter aliases for this identifier
link: Wikipedia article name
q: wikidata q number for the identifier
label: the alternate name to apply to link
mode: 'manual' when there is a specific function in the code to handle the identifier;
'external' for identifiers that link outside of Wikipedia;
prefix: the first part of a url that will be concatenated with a second part which usually contains the identifier
encode: true if uri should be percent encoded; otherwise false
COinS: identifier link or keyword for use in COinS:
for identifiers registered at info-uri.info use: info:....
for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn
for others make a url using the value in prefix, use the keyword: pre (not checked; any text other than 'info' or 'rft' works here)
set to nil to leave the identifier out of the COinS
separator: character or text between label and the identifier in the rendered citation
access: use this parameter to set the access level for all instances of this identifier.
the value must be a valid access level for an identifier (see ['id-access'] in this file).
custom_access: to enable custom access level for an identifier, set this parameter
to the parameter that should control it (normally 'id-access')
]]
local id_handlers = {
['ARXIV'] = {
parameters = {'arxiv', 'eprint'},
link = 'arXiv',
q = 'Q118398',
label = 'arXiv',
mode = 'manual',
prefix = '//arxiv.org/abs/', -- protocol relative tested 2013-09-04
encode = false,
COinS = 'info:arxiv',
separator = ':',
access = 'free', -- free to read
},
['ASIN'] = {
parameters = { 'asin', 'ASIN' },
link = 'Amazon Standard Identification Number',
q = 'Q1753278',
label = 'ASIN',
mode = 'manual',
prefix = '//www.amazon.',
COinS = nil, -- no COinS for this id (needs thinking on implementation because |asin-tld=)
separator = ' ',
encode = false;
},
['BIBCODE'] = {
parameters = {'bibcode'},
link = 'Bibcode',
q = 'Q25754',
label = 'Bibcode',
mode = 'manual',
prefix = 'https://ui.adsabs.harvard.edu/abs/',
encode = false,
COinS = 'info:bibcode',
separator = ':',
custom_access = 'bibcode-access',
},
['BIORXIV'] = {
parameters = {'biorxiv'},
link = 'bioRxiv',
q = 'Q19835482',
label = 'bioRxiv',
mode = 'manual',
prefix = '//doi.org/10.1101/',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['CITESEERX'] = {
parameters = {'citeseerx'},
link = 'CiteSeerX',
q = 'Q2715061',
label = 'CiteSeerX',
mode = 'manual', -- manual for custom validation of the "doi"
prefix = '//citeseerx.ist.psu.edu/viewdoc/summary?doi=',
COinS = 'pre', -- use prefix value
access = 'free', -- free to read
encode = true,
separator = ' ',
},
['DOI'] = { -- (Used by InternetArchiveBot)
parameters = { 'doi', 'DOI' },
link = 'Digital object identifier',
q = 'Q25670',
label = 'doi',
mode = 'manual',
prefix = '//doi.org/',
COinS = 'info:doi',
separator = ':',
encode = true,
custom_access = 'doi-access',
},
['EISSN'] = {
parameters = {'eissn', 'EISSN'},
link = 'International_Standard_Serial_Number#Electronic_ISSN',
q = 'Q46339674',
label = 'eISSN',
mode = 'manual',
prefix = '//www.worldcat.org/issn/',
COinS = 'rft.eissn',
encode = false,
separator = ' ',
},
['HDL'] = {
parameters = { 'hdl', 'HDL' },
link = 'Handle System',
q = 'Q3126718',
label = 'hdl',
mode = 'manual',
prefix = '//hdl.handle.net/',
COinS = 'info:hdl',
separator = ':',
encode = true,
custom_access = 'hdl-access',
},
['ISBN'] = { -- (Used by InternetArchiveBot)
parameters = {'isbn', 'ISBN', 'isbn13', 'ISBN13'},
link = 'International Standard Book Number',
q = 'Q33057',
label = 'ISBN',
mode = 'manual',
prefix = 'Special:BookSources/',
COinS = 'rft.isbn',
separator = ' ',
},
['ISMN'] = {
parameters = {'ismn', 'ISMN'},
link = 'International Standard Music Number',
q = 'Q1666938',
label = 'ISMN',
mode = 'manual',
prefix = '', -- not currently used;
COinS = 'nil', -- nil because we can't use pre or rft or info:
separator = ' ',
},
['ISSN'] = {
parameters = {'issn', 'ISSN'},
link = 'International Standard Serial Number',
q = 'Q131276',
label = 'ISSN',
mode = 'manual',
prefix = '//www.worldcat.org/issn/',
COinS = 'rft.issn',
encode = false,
separator = ' ',
},
['JFM'] = {
parameters = {'jfm', 'JFM'},
link = 'Jahrbuch über die Fortschritte der Mathematik',
q = '',
label = 'JFM',
mode = 'manual',
prefix = '//zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['JSTOR'] = {
parameters = {'jstor', 'JSTOR'},
link = 'JSTOR',
q = 'Q1420342',
label = 'JSTOR',
mode = 'external',
prefix = '//www.jstor.org/stable/', -- protocol relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
custom_access = 'jstor-access',
},
['LCCN'] = {
parameters = {'LCCN', 'lccn'},
link = 'Library of Congress Control Number',
q = 'Q620946',
label = 'LCCN',
mode = 'manual',
prefix = '//lccn.loc.gov/', -- protocol relative tested 2015-12-28
COinS = 'info:lccn', -- use prefix value
encode = false,
separator = ' ',
},
['MR'] = {
parameters = {'MR', 'mr'},
link = 'Mathematical Reviews',
q = 'Q211172',
label = 'MR',
mode = 'manual',
prefix = '//www.ams.org/mathscinet-getitem?mr=', -- protocol relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
['OCLC'] = {
parameters = {'OCLC', 'oclc'},
link = 'OCLC',
q = 'Q190593',
label = 'OCLC',
mode = 'manual',
prefix = '//www.worldcat.org/oclc/',
COinS = 'info:oclcnum',
encode = true,
separator = ' ',
},
['OL'] = {
parameters = { 'ol', 'OL' },
link = 'Open Library',
q = 'Q1201876',
label = 'OL',
mode = 'manual',
prefix = '//openlibrary.org/',
COinS = nil, -- no COinS for this id (needs thinking on implementation because /authors/books/works/OL)
separator = ' ',
encode = true,
custom_access = 'ol-access',
},
['OSTI'] = {
parameters = {'OSTI', 'osti'},
link = 'Office of Scientific and Technical Information',
q = 'Q2015776',
label = 'OSTI',
mode = 'external',
prefix = '//www.osti.gov/biblio/', -- protocol relative tested 2018-09-12
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
custom_access = 'osti-access',
},
['PMC'] = {
parameters = {'PMC', 'pmc'},
link = 'PubMed Central',
q = 'Q229883',
label = 'PMC',
mode = 'manual',
prefix = '//www.ncbi.nlm.nih.gov/pmc/articles/PMC',
suffix = " ",
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
access = 'free', -- free to read
},
['PMID'] = {
parameters = {'PMID', 'pmid'},
link = 'PubMed Identifier',
q = '',
label = 'PMID',
mode = 'manual',
-- prefix = '//www.ncbi.nlm.nih.gov/pubmed/',
prefix = '//pubmed.ncbi.nlm.nih.gov/', -- new for 2020
COinS = 'info:pmid',
encode = false,
separator = ' ',
},
['RFC'] = {
parameters = {'RFC', 'rfc'},
link = 'Request for Comments',
q = 'Q212971',
label = 'RFC',
mode = 'external',
prefix = '//tools.ietf.org/html/rfc',
COinS = 'pre', -- use prefix value
encode = false,
separator = ' ',
access = 'free', -- free to read
},
['SSRN'] = {
parameters = {'SSRN', 'ssrn'},
link = 'Social Science Research Network',
q = 'Q7550801',
label = 'SSRN',
mode = 'manual',
prefix = '//ssrn.com/abstract=', -- protocol relative tested 2013-09-04
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
access = 'free', -- always free to read
},
['USENETID'] = {
parameters = {'message-id'},
link = 'Usenet',
q = 'Q193162',
label = 'Usenet:',
mode = 'manual',
prefix = 'news:',
encode = false,
COinS = 'pre', -- use prefix value
separator = ' ',
},
['ZBL'] = {
parameters = {'ZBL', 'zbl'},
link = 'Zentralblatt MATH',
q = 'Q190269',
label = 'Zbl',
mode = 'manual',
prefix = '//zbmath.org/?format=complete&q=an:',
COinS = 'pre', -- use prefix value
encode = true,
separator = ' ',
},
}
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
aliases = aliases,
special_case_translation = special_case_translation,
defaults = defaults,
date_names = date_names,
error_conditions = error_conditions,
editor_markup_patterns = editor_markup_patterns,
et_al_patterns = et_al_patterns,
global_df = global_df,
id_handlers = id_handlers,
keywords_lists = keywords_lists,
keywords_xlate = keywords_xlate,
stripmarkers=stripmarkers,
invisible_chars = invisible_chars,
indic_script = indic_script,
local_lang_cat_enable = local_lang_cat_enable,
maint_cats = maint_cats,
messages = messages,
presentation = presentation,
prop_cats = prop_cats,
punct_skip = punct_skip,
script_lang_codes = script_lang_codes,
lang_code_remap = lang_code_remap,
lang_name_remap = lang_name_remap,
this_wiki_code = this_wiki_code,
title_types = title_types,
uncategorized_namespaces = uncategorized_namespaces,
uncategorized_subpages = uncategorized_subpages,
templates_using_volume = templates_using_volume,
templates_using_issue = templates_using_issue,
templates_not_using_page = templates_not_using_page,
}
ddf60a780d143f62224dbde9f95759a9d7bfaa03
Module:Citation/CS1/Date validation
828
88
175
174
2024-06-03T23:43:01Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local is_set, in_array; -- imported functions from selected Module:Citation/CS1/Utilities
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< F I L E - S C O P E D E C L A R A T I O N S >--------------------------------
File-scope variables are declared here
]]
local lang_object = mw.getContentLanguage(); -- used by is_valid_accessdate(), is_valid_year(), date_name_xlate(); TODO: move to ~/Configuration?
local year_limit; -- used by is_valid_year()
--[=[-------------------------< I S _ V A L I D _ A C C E S S D A T E >----------------------------------------
returns true if:
Wikipedia start date <= accessdate < today + 2 days
Wikipedia start date is 2001-01-15T00:00:00 UTC which is 979516800 seconds after 1970-01-01T00:00:00 UTC (the start of Unix time)
accessdate is the date provided in |accessdate= at time 00:00:00 UTC
today is the current date at time 00:00:00 UTC plus 48 hours
if today is 2015-01-01T00:00:00 then
adding 24 hours gives 2015-01-02T00:00:00 – one second more than today
adding 24 hours gives 2015-01-03T00:00:00 – one second more than tomorrow
This function does not work if it is fed month names for languages other than English. Wikimedia #time: parser
apparently doesn't understand non-Engish date month names. This function will always return false when the date
contains a non-English month name because good1 is false after the call to lang.formatDate(). To get around that
call this function with YYYY-MM-DD format dates.
]=]
local function is_valid_accessdate (accessdate)
local good1, good2;
local access_ts, tomorrow_ts; -- to hold unix time stamps representing the dates
good1, access_ts = pcall (lang_object.formatDate, lang_object, 'U', accessdate ); -- convert accessdate value to unix timesatmp
good2, tomorrow_ts = pcall (lang_object.formatDate, lang_object, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
if good1 and good2 then -- lang.formatDate() returns a timestamp in the local script which which tonumber() may not understand
access_ts = tonumber (access_ts) or lang_object:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
tomorrow_ts = tonumber (tomorrow_ts) or lang_object:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to unix time stamp
end
if 979516800 <= access_ts and access_ts < tomorrow_ts then -- Wikipedia start date <= accessdate < tomorrow's date
return true;
else
return false; -- accessdate out of range
end
end
--[[--------------------------< G E T _ M O N T H _ N U M B E R >----------------------------------------------
returns a number according to the month in a date: 1 for January, etc. Capitalization and spelling must be correct. If not a valid month, returns 0
]]
local function get_month_number (month)
return cfg.date_names['local'].long[month] or cfg.date_names['local'].short[month] or -- look for local names first
cfg.date_names['en'].long[month] or cfg.date_names['en'].short[month] or -- failing that, look for English names
0; -- not a recognized month name
end
--[[--------------------------< I S _ V A L I D _ E M B A R G O _ D A T E >------------------------------------
returns true and date value if that value has proper dmy, mdy, ymd format.
returns false and 9999 (embargoed forever) when date value is not proper format; assumes that when |embargo= is
set, the editor intended to embargo a pmc but |embargo= does not hold a single date.
]]
local function is_valid_embargo_date (v)
if v:match ('^%d%d%d%d%-%d%d%-%d%d$') or -- ymd
v:match ('^%d%d?%s+%a+%s+%d%d%d%d$') or -- dmy
v:match ('^%a+%s+%d%d?%s*,%s*%d%d%d%d$') then -- mdy
return true, v;
end
return false, '9999'; -- if here not good date so return false and set embargo date to long time in future
end
--[[--------------------------< G E T _ S E A S O N _ N U M B E R >--------------------------------------------
returns a number according to the sequence of seasons in a year: 1 for Winter, etc. Capitalization and spelling must be correct. If not a valid season, returns 0
Uses ISO DIS 8601 2016 part 2 §4.7 Divisions of a year for hemishpere-independent seasons:
21-24 = Spring, Summer, Autumn, Winter, independent of “Hemisphere”
These additional divisions not currently supported:
25-28 = Spring - Northern Hemisphere, Summer- Northern Hemisphere, Autumn - Northern Hemisphere, Winter - Northern Hemisphere
29-32 = Spring – Southern Hemisphere, Summer– Southern Hemisphere, Autumn – Southern Hemisphere, Winter - Southern Hemisphere
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)
37-39 = Quadrimester 1, Quadrimester 2, Quadrimester 3 (4 months each)
40-41 = Semestral 1, Semestral-2 (6 months each)
]]
local function get_season_number (season)
return cfg.date_names['local'].season[season] or -- look for local names first
cfg.date_names['en'].season[season] or -- failing that, look for English names
0; -- not a recognized season name
end
--[[--------------------------< I S _ P R O P E R _ N A M E >--------------------------------------------------
returns a non-zero number if date contains a recognized proper name. Capitalization and spelling must be correct.
]]
local function is_proper_name (name)
return cfg.date_names['local'].named[name] or -- look for local names dates first
cfg.date_names['en'].named[name] or -- failing that, look for English names
0; -- not a recognized named date
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ O R _ S E A S O N >------------------------------
--returns true if month or season is valid (properly spelled, capitalized, abbreviated)
]]
local function is_valid_month_or_season (month_season)
if 0 == get_month_number (month_season) then -- if month text isn't one of the twelve months, might be a season
if 0 == get_season_number (month_season) then -- not a month, is it a season?
return false; -- return false not a month or one of the five seasons
end
end
return true;
end
--[[--------------------------< I S _ V A L I D _ Y E A R >----------------------------------------------------
Function gets current year from the server and compares it to year from a citation parameter. Years more than one year in the future are not acceptable.
]]
local function is_valid_year(year)
if not is_set(year_limit) then
year_limit = tonumber(os.date("%Y"))+1; -- global variable so we only have to fetch it once
end
year = tonumber (year) or lang_object:parseFormattedNumber (year); -- convert to numbers for the comparison;
return year and (year <= year_limit) or false;
end
--[[--------------------------< I S _ V A L I D _ D A T E >----------------------------------------------------
Returns true if day is less than or equal to the number of days in month and year is no farther into the future
than next year; else returns false.
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap
years before 1582 and Gregorian leap years after 1582. Where the two calendars overlap (1582 to approximately
1923) dates are assumed to be Gregorian.
]]
local function is_valid_date (year, month, day)
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
local month_length;
if not is_valid_year(year) then -- no farther into the future than next year
return false;
end
month = tonumber(month); -- required for YYYY-MM-DD dates
if (2==month) then -- if February
month_length = 28; -- then 28 days unless
if 1582 > tonumber(year) then -- Julian calendar
if 0==(year%4) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
else -- Gregorian calendar
if (0==(year%4) and (0~=(year%100) or 0==(year%400))) then -- is a leap year?
month_length = 29; -- if leap year then 29 days in February
end
end
else
month_length=days_in_month[month];
end
if tonumber (day) > month_length then
return false;
end
return true;
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ R A N G E _ S T Y L E >--------------------------
Months in a range are expected to have the same style: Jan–Mar or October–December but not February–Mar or Jul–August.
There is a special test for May because it can be either short or long form.
Returns true when style for both months is the same
]]
local function is_valid_month_range_style (month1, month2)
local len1 = month1:len();
local len2 = month2:len();
if len1 == len2 then
return true; -- both months are short form so return true
elseif 'May' == month1 or 'May'== month2 then
return true; -- both months are long form so return true
elseif 3 == len1 or 3 == len2 then
return false; -- months are mixed form so return false
else
return true; -- both months are long form so return true
end
end
--[[--------------------------< I S _ V A L I D _ M O N T H _ S E A S O N _ R A N G E >------------------------
Check a pair of months or seasons to see if both are valid members of a month or season pair.
Month pairs are expected to be left to right, earliest to latest in time.
All season ranges are accepted as valid because there are publishers out there who have published a Summer–Spring YYYY issue so ... ok
]]
local function is_valid_month_season_range(range_start, range_end)
local range_start_number = get_month_number (range_start);
local range_end_number;
if 0 == range_start_number then -- is this a month range?
range_start_number = get_season_number (range_start); -- not a month; is it a season? get start season number
range_end_number = get_season_number (range_end); -- get end season number
if (0 ~= range_start_number) and (0 ~= range_end_number) then
return true; -- any season pairing is accepted
end
return false; -- range_start and/or range_end is not a season
end
-- here when range_start is a month
range_end_number = get_month_number (range_end); -- get end month number
if range_start_number < range_end_number then -- range_start is a month; does range_start precede range_end?
if is_valid_month_range_style (range_start, range_end) then -- do months have the same style?
return true; -- proper order and same style
end
end
return false; -- range_start month number is greater than or equal to range end number; or range end isn't a month
end
--[[--------------------------< M A K E _ C O I N S _ D A T E >------------------------------------------------
This function receives a table of date parts for one or two dates and an empty table reference declared in
Module:Citation/CS1. The function is called only for |date= parameters and only if the |date=<value> is
determined to be a valid date format. The question of what to do with invalid date formats is not answered here.
The date parts in the input table are converted to an ISO 8601 conforming date string:
single whole dates: yyyy-mm-dd
month and year dates: yyyy-mm
year dates: yyyy
ranges: yyyy-mm-dd/yyyy-mm-dd
yyyy-mm/yyyy-mm
yyyy/yyyy
Dates in the Julian calendar are reduced to year or year/year so that we don't have to do calendar conversion from
Julian to Proleptic Gregorian.
The input table has:
year, year2 – always present; if before 1582, ignore months and days if present
month, month2 – 0 if not provided, 1-12 for months, 21-24 for seasons; 99 Christmas
day, day2 – 0 if not provided, 1-31 for days
the output table receives:
rftdate: an IS8601 formatted date
rftchron: a free-form version of the date, usually without year which is in rftdate (season ranges and propername dates)
rftssn: one of four season keywords: winter, spring, summer, fall (lowercase)
]]
local function make_COinS_date (input, tCOinS_date)
local date; -- one date or first date in a range
local date2 = ''; -- end of range date
-- start temporary Julian / Gregorian calendar uncertainty detection
local year = tonumber(input.year); -- this temporary code to determine the extent of sources dated to the Julian/Gregorian
local month = tonumber(input.month); -- interstice 1 October 1582 – 1 January 1926
local day = tonumber (input.day);
if (0 ~= day) and -- day must have a value for this to be a whole date
(((1582 == year) and (10 <= month) and (12 >= month)) or -- any whole 1582 date from 1 october to 31 December or
((1926 == year) and (1 == month) and (1 == input.day)) or -- 1 January 1926 or
((1582 < year) and (1925 >= year))) then -- any date 1 January 1583 – 31 December 1925
tCOinS_date.inter_cal_cat = true; -- set category flag true
end
-- end temporary Julian / Gergorian calendar uncertainty detection
if 1582 > tonumber(input.year) or 20 < tonumber(input.month) then -- Julian calendar or season so &rft.date gets year only
date = input.year;
if 0 ~= input.year2 and input.year ~= input.year2 then -- if a range, only the second year portion when not the same as range start year
date = string.format ('%.4d/%.4d', tonumber(input.year), tonumber(input.year2)) -- assemble the date range
end
if 20 < tonumber(input.month) then -- if season or propername date
local season = {[24]='winter', [21]='spring', [22]='summer', [23]='fall', [99]='Christmas'}; -- seasons lowercase, no autumn; proper names use title case
if 0 == input.month2 then -- single season date
if 30 <tonumber(input.month) then
tCOinS_date.rftchron = season[input.month]; -- proper name dates
else
tCOinS_date.rftssn = season[input.month]; -- seasons
end
else -- season range with a second season specified
if input.year ~= input.year2 then -- season year – season year range or season year–year
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
if 0~= input.month2 then
tCOinS_date.rftchron = string.format ('%s %s – %s %s', season[input.month], input.year, season[input.month2], input.year2);
end
else -- season–season year range
tCOinS_date.rftssn = season[input.month]; -- start of range season; keep this?
tCOinS_date.rftchron = season[input.month] .. '–' .. season[input.month2]; -- season–season year range
end
end
end
tCOinS_date.rftdate = date;
return; -- done
end
if 0 ~= input.day then
date = string.format ('%s-%.2d-%.2d', input.year, tonumber(input.month), tonumber(input.day)); -- whole date
elseif 0 ~= input.month then
date = string.format ('%s-%.2d', input.year, tonumber(input.month)); -- year and month
else
date = string.format ('%s', input.year); -- just year
end
if 0 ~= input.year2 then
if 0 ~= input.day2 then
date2 = string.format ('/%s-%.2d-%.2d', input.year2, tonumber(input.month2), tonumber(input.day2)); -- whole date
elseif 0 ~= input.month2 then
date2 = string.format ('/%s-%.2d', input.year2, tonumber(input.month2)); -- year and month
else
date2 = string.format ('/%s', input.year2); -- just year
end
end
tCOinS_date.rftdate = date .. date2; -- date2 has the '/' separator
return;
end
--[[--------------------------< P A T T E R N S >--------------------------------------------------------------
this is the list of patterns for date formats that this module recognizes. Approximately the first half of these
patterns represent formats that might be reformatted into another format. Those that might be reformatted have
'indicator' letters that identify the content of the matching capture: 'd' (day), 'm' (month), 'a' (anchor year),
'y' (year); second day, month, year have a '2' suffix.
These patterns are used for both date validation and for reformatting. This table should not be moved to ~/Configuration
because changes to this table require changes to check_date() and to reformatter() and reformat_date()
]]
local patterns = {
-- year-initial numerical year-month-day
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'},
-- month-initial: month day, year
['Mdy'] = {'^(%D-) +([1-9]%d?), +((%d%d%d%d?)%a?)$', 'm', 'd', 'a', 'y'},
-- month-initial day range: month day–day, year; days are separated by endash
['Md-dy'] = {'^(%D-) +([1-9]%d?)[%-–]([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'd2', 'a', 'y'},
-- day-initial: day month year
['dMy'] = {'^([1-9]%d?) *(%D-) +((%d%d%d%d?)%a?)$', 'd', 'm', 'a', 'y'},
-- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed; not supported at en.wiki
-- ['yMd'] = {'^((%d%d%d%d?)%a?) +(%D-) +(%d%d?)$', 'a', 'y', 'm', 'd'},
-- day-range-initial: day–day month year; days are separated by endash
['d-dMy'] = {'^([1-9]%d?)[%-–]([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'd2', 'm', 'a', 'y'},
-- day initial month-day-range: day month - day month year; uses spaced endash
['dM-dMy'] = {'^([1-9]%d?) +(%D-) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'd2', 'm2', 'a', 'y'},
-- month initial month-day-range: month day – month day, year; uses spaced endash
['Md-Mdy'] = {'^(%D-) +([1-9]%d?) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$','m', 'd', 'm2', 'd2', 'a', 'y'},
-- day initial month-day-year-range: day month year - day month year; uses spaced endash
['dMy-dMy'] = {'^([1-9]%d?) +(%D-) +(%d%d%d%d) +[%-–] +([1-9]%d?) +(%D-) +((%d%d%d%d)%a?)$', 'd', 'm', 'y', 'd2', 'm2', 'a', 'y2'},
-- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
['Mdy-Mdy'] = {'^(%D-) +([1-9]%d?), +(%d%d%d%d) +[%-–] +(%D-) +([1-9]%d?), +((%d%d%d%d)%a?)$', 'm', 'd', 'y', 'm2', 'd2', 'a', 'y2'},
-- these date formats cannot be converted, per se, but month name can be rendered short or long
-- month/season year - month/season year; separated by spaced endash
['My-My'] = {'^(%D-) +(%d%d%d%d) +[%-–] +(%D-) +((%d%d%d%d)%a?)$', 'm', 'y', 'm2', 'a', 'y2'},
-- month/season range year; months separated by endash
['M-My'] = {'^(%D-)[%-–](%D-) +((%d%d%d%d)%a?)$', 'm', 'm2', 'a', 'y'},
-- month/season year or proper-name year
['My'] = {'^([^%d–]-) +((%d%d%d%d)%a?)$', 'm', 'a', 'y'}, -- this way because endash is a member of %D; %D- will match January–March 2019 when it shouldn't
-- these date formats cannot be converted
['Sy4-y2'] = {'^(%D-) +((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
['Sy-y'] = {'^(%D-) +(%d%d%d%d)[%-–]((%d%d%d%d)%a?)$'}, -- special case Winter/Summer year-year; year separated with unspaced endash
['y-y'] = {'^(%d%d%d%d?)[%-–]((%d%d%d%d?)%a?)$'}, -- year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
['y4-y2'] = {'^((%d%d)%d%d)[%-–]((%d%d)%a?)$'}, -- year range: YYYY–YY; separated by unspaced endash
['y'] = {'^((%d%d%d%d?)%a?)$'}, -- year; here accept either YYY or YYYY
}
--[[--------------------------< C H E C K _ D A T E >----------------------------------------------------------
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only
allowed range separator is endash. Additionally, check the date to see that it is a real date: no 31 in 30-day
months; no 29 February when not a leap year. Months, both long-form and three character abbreviations, and seasons
must be spelled correctly. Future years beyond next year are not allowed.
If the date fails the format tests, this function returns false and does not return values for anchor_year and
COinS_date. When this happens, the date parameter is used in the COinS metadata and the CITEREF identifier gets
its year from the year parameter if present otherwise CITEREF does not get a date value.
Inputs:
date_string - date string from date-holding parameters (date, year, accessdate, embargo, archivedate, etc.)
Returns:
false if date string is not a real date; else
true, anchor_year, COinS_date
anchor_year can be used in CITEREF anchors
COinS_date is ISO 8601 format date; see make_COInS_date()
]]
local function check_date (date_string, tCOinS_date, test_accessdate)
local year; -- assume that year2, months, and days are not used;
local year2=0; -- second year in a year range
local month=0;
local month2=0; -- second month in a month range
local day=0;
local day2=0; -- second day in a day range
local anchor_year;
local coins_date;
if date_string:match (patterns['ymd'][1]) then -- year-initial numerical year month day format
year, month, day=date_string:match (patterns['ymd'][1]);
if 12 < tonumber(month) or 1 > tonumber(month) or 1582 > tonumber(year) or 0 == tonumber(day) then return false; end -- month or day number not valid or not Gregorian calendar
anchor_year = year;
elseif mw.ustring.match(date_string, patterns['Mdy'][1]) then -- month-initial: month day, year
month, day, anchor_year, year=mw.ustring.match(date_string, patterns['Mdy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
elseif mw.ustring.match(date_string, patterns['Md-dy'][1]) then -- month-initial day range: month day–day, year; days are separated by endash
month, day, day2, anchor_year, year=mw.ustring.match(date_string, patterns['Md-dy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2=year;
elseif mw.ustring.match(date_string, patterns['dMy'][1]) then -- day-initial: day month year
day, month, anchor_year, year=mw.ustring.match(date_string, patterns['dMy'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
--[[ NOT supported at en.wiki
elseif mw.ustring.match(date_string, patterns['yMd'][1]) then -- year-initial: year month day; day: 1 or 2 two digits, leading zero allowed
anchor_year, year, month, day=mw.ustring.match(date_string, patterns['yMd'][1]);
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
-- end NOT supported at en.wiki ]]
elseif mw.ustring.match(date_string, patterns['d-dMy'][1]) then -- day-range-initial: day–day month year; days are separated by endash
day, day2, month, anchor_year, year=mw.ustring.match(date_string, patterns['d-dMy'][1]);
if tonumber(day) >= tonumber(day2) then return false; end -- date range order is left to right: earlier to later; dates may not be the same;
month = get_month_number (month);
if 0 == month then return false; end -- return false if month text isn't one of the twelve months
month2=month; -- for metadata
year2=year;
elseif mw.ustring.match(date_string, patterns['dM-dMy'][1]) then -- day initial month-day-range: day month - day month year; uses spaced endash
day, month, day2, month2, anchor_year, year=mw.ustring.match(date_string, patterns['dM-dMy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end -- date range order is left to right: earlier to later;
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2=year;
elseif mw.ustring.match(date_string, patterns['Md-Mdy'][1]) then -- month initial month-day-range: month day – month day, year; uses spaced endash
month, day, month2, day2, anchor_year, year=mw.ustring.match(date_string, patterns['Md-Mdy'][1]);
if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
year2=year;
elseif mw.ustring.match(date_string, patterns['dMy-dMy'][1]) then -- day initial month-day-year-range: day month year - day month year; uses spaced endash
day, month, year, day2, month2, anchor_year, year2=mw.ustring.match(date_string, patterns['dMy-dMy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
elseif mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]) then -- month initial month-day-year-range: month day, year – month day, year; uses spaced endash
month, day, year, month2, day2, anchor_year, year2=mw.ustring.match(date_string, patterns['Mdy-Mdy'][1]);
if tonumber(year2) <= tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) or not is_valid_month_range_style(month, month2) then return false; end -- year2 no more than one year in the future; months same style
month = get_month_number (month); -- for metadata
month2 = get_month_number (month2);
elseif mw.ustring.match(date_string, patterns['Sy4-y2'][1]) then -- special case Winter/Summer year-year (YYYY-YY); year separated with unspaced endash
local century;
month, year, century, anchor_year, year2=mw.ustring.match(date_string, patterns['Sy4-y2'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year=year..'–'..anchor_year; -- assemble anchor_year from both years
year2 = century..year2; -- add the century to year2 for comparisons
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number (month);
elseif mw.ustring.match(date_string, patterns['Sy-y'][1]) then -- special case Winter/Summer year-year; year separated with unspaced endash
month, year, anchor_year, year2=mw.ustring.match(date_string, patterns['Sy-y'][1]);
if 'Winter' ~= month and 'Summer' ~= month then return false end; -- 'month' can only be Winter or Summer
anchor_year=year..'–'..anchor_year; -- assemble anchor_year from both years
if 1 ~= tonumber(year2) - tonumber(year) then return false; end -- must be sequential years, left to right, earlier to later
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
month = get_season_number (month); -- for metadata
elseif mw.ustring.match(date_string, patterns['My-My'][1]) then -- month/season year - month/season year; separated by spaced endash
month, year, month2, anchor_year, year2=mw.ustring.match(date_string, patterns['My-My'][1]);
anchor_year=year..'–'..anchor_year; -- assemble anchor_year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
if 0 ~= get_month_number(month) and 0 ~= get_month_number(month2) and is_valid_month_range_style(month, month2) then -- both must be month year, same month style
month = get_month_number(month);
month2 = get_month_number(month2);
elseif 0 ~= get_season_number(month) and 0 ~= get_season_number(month2) then -- both must be or season year, not mixed
month = get_season_number(month);
month2 = get_season_number(month2);
else
return false;
end
elseif mw.ustring.match(date_string, patterns['M-My'][1]) then -- month/season range year; months separated by endash
month, month2, anchor_year, year=mw.ustring.match(date_string, patterns['M-My'][1]);
if (not is_valid_month_season_range(month, month2)) or (not is_valid_year(year)) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
month2 = get_month_number(month2);
else
month = get_season_number(month);
month2 = get_season_number(month2);
end
year2=year;
elseif mw.ustring.match(date_string, patterns['My'][1]) then -- month/season year or proper-name year
month, anchor_year, year=mw.ustring.match(date_string, patterns['My'][1]);
if not is_valid_year(year) then return false; end
if not is_valid_month_or_season (month) and 0 == is_proper_name (month) then return false; end
if 0 ~= get_month_number(month) then -- determined to be a valid range so just check this one to know if month or season
month = get_month_number(month);
elseif 0 ~= get_season_number(month) then
month = get_season_number(month);
else
month = is_proper_name (month); -- must be proper name; not supported in COinS
end
elseif mw.ustring.match(date_string, patterns['y-y'][1]) then -- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999
year, anchor_year, year2=mw.ustring.match(date_string, patterns['y-y'][1]);
anchor_year=year..'–'..anchor_year; -- assemble anchor year from both years
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match(date_string, patterns['y4-y2'][1]) then -- Year range: YYYY–YY; separated by unspaced endash
local century;
year, century, anchor_year, year2=mw.ustring.match(date_string, patterns['y4-y2'][1]);
anchor_year=year..'–'..anchor_year; -- assemble anchor year from both years
if 13 > tonumber(year2) then return false; end -- don't allow 2003-05 which might be May 2003
year2 = century..year2; -- add the century to year2 for comparisons
if tonumber(year) >= tonumber(year2) then return false; end -- left to right, earlier to later, not the same
if not is_valid_year(year2) then return false; end -- no year farther in the future than next year
elseif mw.ustring.match (date_string, patterns['y'][1]) then -- year; here accept either YYY or YYYY
anchor_year, year=mw.ustring.match (date_string, patterns['y'][1]);
if false == is_valid_year(year) then
return false;
end
else
return false; -- date format not one of the MOS:DATE approved formats
end
if test_accessdate then -- test accessdate here because we have numerical date parts
if 0 ~= year and 0 ~= month and 0 ~= day and -- all parts of a single date required
0 == year2 and 0 == month2 and 0 == day2 then -- none of these; accessdate must not be a range
if not is_valid_accessdate (year..'-'..month..'-'..day) then
return false; -- return false when accessdate out of bounds
end
else
return false; -- return false when accessdate is a range of two dates
end
end
local result=true; -- check whole dates for validity; assume true because not all dates will go through this test
if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then -- YMD (simple whole date)
result=is_valid_date(year,month,day);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then -- YMD-d (day range)
result=is_valid_date(year,month,day);
result=result and is_valid_date(year,month,day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-md (day month range)
result=is_valid_date(year,month,day);
result=result and is_valid_date(year,month2,day2);
elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then -- YMD-ymd (day month year range)
result=is_valid_date(year,month,day);
result=result and is_valid_date(year2,month2,day2);
end
if false == result then return false; end
if nil ~= tCOinS_date then -- this table only passed into this function when testing |date= parameter values
make_COinS_date ({year=year, month=month, day=day, year2=year2, month2=month2, day2=day2}, tCOinS_date); -- make an ISO 8601 date string for COinS
end
return true, anchor_year; -- format is good and date string represents a real date
end
--[[--------------------------< D A T E S >--------------------------------------------------------------------
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in
the COinS metadata) are derived. The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords "n.d." or "nd" (without quotes).
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,
a single error message is created as the dates are tested.
]]
local function dates(date_parameters_list, tCOinS_date)
local anchor_year; -- will return as nil if the date being tested is not |date=
local COinS_date; -- will return as nil if the date being tested is not |date=
local embargo_date; -- if embargo date is a good dmy, mdy, ymd date then holds original value else reset to 9999
local error_message = "";
local good_date = false;
for k, v in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(v.val) then -- if the parameter has a value
v.val = mw.ustring.gsub (v.val, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
if v.val:match("^c%. [1-9]%d%d%d?%a?$") then -- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=
local year = v.val:match("c%. ([1-9]%d%d%d?)%a?"); -- get the year portion so it can be tested
if 'date'==k then
anchor_year, COinS_date = v.val:match("((c%. [1-9]%d%d%d?)%a?)"); -- anchor year and COinS_date only from |date= parameter
good_date = is_valid_year(year);
elseif 'year'==k then
good_date = is_valid_year(year);
end
elseif 'date'==k then -- if the parameter is |date=
if v.val:match("^n%.d%.%a?$") then -- if |date=n.d. with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((n%.d%.)%a?)"); --"n.d."; no error when date parameter is set to no date
elseif v.val:match("^nd%a?$") then -- if |date=nd with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((nd)%a?)"); --"nd"; no error when date parameter is set to no date
else
good_date, anchor_year, COinS_date = check_date (v.val, tCOinS_date); -- go test the date
end
elseif 'year'==k then -- if the parameter is |year= it should hold only a year value
if v.val:match("^[1-9]%d%d%d?%a?$") then -- if |year= 3 or 4 digits only with or without a CITEREF disambiguator
good_date, anchor_year, COinS_date = true, v.val:match("((%d+)%a?)");
end
elseif 'access-date'==k then -- if the parameter is |date=
good_date = check_date (v.val, nil, true); -- go test the date; nil is a placeholder; true is the test_accessdate flag
elseif 'embargo'==k then -- if the parameter is |embargo=
good_date = check_date (v.val); -- go test the date
if true == good_date then -- if the date is a valid date
good_date, embargo_date = is_valid_embargo_date (v.val); -- is |embargo= date a single dmy, mdy, or ymd formatted date? yes:returns embargo; no: returns 9999
end
else -- any other date-holding parameter
good_date = check_date (v.val); -- go test the date
end
if false==good_date then -- assemble one error message so we don't add the tracking category multiple times
if is_set(error_message) then -- once we've added the first portion of the error message ...
error_message=error_message .. ", "; -- ... add a comma space separator
end
error_message=error_message .. "|" .. v.name .. "="; -- add the failed parameter
end
end
end
return anchor_year, embargo_date, error_message; -- and done
end
--[[--------------------------< Y E A R _ D A T E _ C H E C K >------------------------------------------------
Compare the value provided in |year= with the year value(s) provided in |date=. This function returns a numeric value:
0 - year value does not match the year value in date
1 - (default) year value matches the year value in date or one of the year values when date contains two years
2 - year value matches the year value in date when date is in the form YYYY-MM-DD and year is disambiguated (|year=YYYYx)
]]
local function year_date_check (year_string, date_string)
local year;
local date1;
local date2;
local result = 1; -- result of the test; assume that the test passes
year = year_string:match ('(%d%d%d%d?)');
if date_string:match ('%d%d%d%d%-%d%d%-%d%d') and year_string:match ('%d%d%d%d%a') then --special case where both date and year are required YYYY-MM-DD and YYYYx
date1 = date_string:match ('(%d%d%d%d)');
year = year_string:match ('(%d%d%d%d)');
if year ~= date1 then
result = 0; -- years don't match
else
result = 2; -- years match; but because disambiguated, don't add to maint cat
end
elseif date_string:match ("%d%d%d%d?.-%d%d%d%d?") then -- any of the standard range formats of date with two three- or four-digit years
date1, date2 = date_string:match ("(%d%d%d%d?).-(%d%d%d%d?)");
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif mw.ustring.match(date_string, "%d%d%d%d[%-–]%d%d") then -- YYYY-YY date ranges
local century;
date1, century, date2 = mw.ustring.match(date_string, "((%d%d)%d%d)[%-–]+(%d%d)");
date2 = century..date2; -- convert YY to YYYY
if year ~= date1 and year ~= date2 then
result = 0;
end
elseif date_string:match ("%d%d%d%d?") then -- any of the standard formats of date with one year
date1 = date_string:match ("(%d%d%d%d?)");
if year ~= date1 then
result = 0;
end
else
result = 0; -- no recognizable year in date
end
return result;
end
--[[--------------------------< R E F O R M A T T E R >--------------------------------------------------------
reformat 'date' into new format specified by format_param if pattern_idx (the current format of 'date') can be
reformatted. Does the grunt work for reformat_dates().
The table re_formats maps patern_idx (current format) and format_param (desired format) to a table that holds:
format string used by string.format()
identifier letters ('d', 'm', 'y', 'd2', 'm2', 'y2') that serve as indexes into a table t{} that holds captures
from mw.ustring.match() for the various date parts specified by patterns[pattern_idx][1]
Items in patterns{} have the general form:
['ymd'] = {'^(%d%d%d%d)%-(%d%d)%-(%d%d)$', 'y', 'm', 'd'}, where:
['ymd'] is pattern_idx
patterns['ymd'][1] is the match pattern with captures for mw.ustring.match()
patterns['ymd'][2] is an indicator letter identifying the content of the first capture
patterns['ymd'][3] ... the second capture etc
when a pattern matches a date, the captures are loaded into table t{} in capture order using the idemtifier
characters as indexes into t{} For the above, a ymd date is in t{} as:
t.y = first capture (year), t.m = second capture (month), t.d = third capture (day)
To reformat, this function is called with the pattern_idx that matches the current format of the date and with
format_param set to the desired format. This function loads table t{} as described and then calls string.format()
with the format string specified by re_format[pattern_idx][format_param][1] using values taken from t{} according
to the capture identifier letters specified by patterns[pattern_idx][format_param][n] where n is 2..
]]
local re_formats = {
['ymd'] = { -- date format is ymd; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Mdy'] = { -- date format is Mdy; reformat to:
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['dMy'] = { -- date format is dMy; reformat to:
['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- ['yMd'] = {'%s %s %s', 'y', 'm', 'd'}, -- |df=yMd; not supported at en.wiki
},
['Md-dy'] = { -- date format is Md-dy; reformat to:
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- |df=dmy -> d-dMy
},
['d-dMy'] = { -- date format is d-d>y; reformat to:
['dmy'] = {'%s–%s %s %s', 'd', 'd2', 'm', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s–%s, %s', 'm', 'd', 'd2', 'y'}, -- |df=mdy -> Md-dy
},
['dM-dMy'] = { -- date format is dM-dMy; reformat to:
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- for long/short reformatting
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- |df=mdy -> Md-Mdy
},
['Md-Mdy'] = { -- date format is Md-Mdy; reformat to:
['mdy'] = {'%s %s – %s %s, %s', 'm', 'd', 'm2', 'd2', 'y'}, -- for long/short reformatting
['dmy'] = {'%s %s – %s %s %s', 'd', 'm', 'd2', 'm2', 'y'}, -- |df=dmy -> dM-dMy
},
['dMy-dMy'] = { -- date format is dMy-dMy; reformat to:
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- for long/short reformatting
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- |df=mdy -> Mdy-Mdy
},
['Mdy-Mdy'] = { -- date format is Mdy-Mdy; reformat to:
['mdy'] = {'%s %s, %s – %s %s, %s', 'm', 'd', 'y', 'm2', 'd2', 'y2'}, -- for long/short reformatting
['dmy'] = {'%s %s %s – %s %s %s', 'd', 'm', 'y', 'd2', 'm2', 'y2'}, -- |df=dmy -> dMy-dMy
},
['My-My'] = { -- these for long/short reformatting
['any'] = {'%s %s – %s %s', 'm', 'y', 'm2', 'y2'}, -- dmy/mdy agnostic
},
['M-My'] = { -- these for long/short reformatting
['any'] = {'%s–%s %s', 'm', 'm2', 'y'}, -- dmy/mdy agnostic
},
['My'] = { -- these for long/short reformatting
['any'] = {'%s %s', 'm', 'y'}, -- dmy/mdy agnostic
},
-- ['yMd'] = { -- not supported at en.wiki
-- ['mdy'] = {'%s %s, %s', 'm', 'd', 'y'}, -- |df=mdy
-- ['dmy'] = {'%s %s %s', 'd', 'm', 'y'}, -- |df=dmy
-- ['ymd'] = {'%s-%s-%s', 'y', 'm', 'd'}, -- |df=ymd
-- },
}
local function reformatter (date, pattern_idx, format_param, mon_len)
if not in_array (pattern_idx, {'ymd', 'Mdy', 'Md-dy', 'dMy', 'yMd', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- not in this set of date format patterns then not a reformattable date
end
if 'ymd' == format_param and in_array (pattern_idx, {'ymd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy', 'My-My', 'M-My', 'My'}) then
return; -- ymd date ranges not supported at en.wiki; no point in reformatting ymd to ymd
end
if in_array (pattern_idx, {'My', 'M-My', 'My-My'}) then -- these are not dmy/mdy so can't be 'reformatted' into either
format_param = 'any'; -- so format-agnostic
end
-- if 'yMd' == format_param and in_array (pattern_idx, {'yMd', 'Md-dy', 'd-dMy', 'dM-dMy', 'Md-Mdy', 'dMy-dMy', 'Mdy-Mdy'}) then -- not supported at en.wiki
if 'yMd' == format_param then -- not supported at en.wiki
return; -- not a reformattable date
end
local c1, c2, c3, c4, c5, c6, c7; -- these hold the captures specified in patterns[pattern_idx][1]
c1, c2, c3, c4, c5, c6, c7 = mw.ustring.match (date, patterns[pattern_idx][1]); -- get the captures
local t = { -- table that holds k/v pairs of date parts from the captures and patterns[pattern_idx][2..]
[patterns[pattern_idx][2]] = c1; -- at minimum there is always one capture with a matching indicator letter
[patterns[pattern_idx][3] or 'x'] = c2; -- patterns can have a variable number of captures; each capture requires an indicator letter;
[patterns[pattern_idx][4] or 'x'] = c3; -- where there is no capture, there is no indicator letter so n in patterns[pattern_idx][n] will be nil;
[patterns[pattern_idx][5] or 'x'] = c4; -- the 'x' here spoofs an indicator letter to prevent 'table index is nil' error
[patterns[pattern_idx][6] or 'x'] = c5;
[patterns[pattern_idx][7] or 'x'] = c6;
[patterns[pattern_idx][8] or 'x'] = c7;
};
if tonumber(t.m) then -- if raw month is a number (converting from ymd)
if 's' == mon_len then -- if we are to use abbreviated month names
t.m = cfg.date_names['inv_local_s'][tonumber(t.m)]; -- convert it to a month name
else
t.m = cfg.date_names['inv_local_l'][tonumber(t.m)]; -- convert it to a month name
end
t.d = t.d:gsub ('0(%d)', '%1'); -- strip leading '0' from day if present
elseif 'ymd' == format_param then -- when converting to ymd
if 1582 > tonumber(t.y) then -- ymd format dates not allowed before 1582
return;
end
t.m = string.format ('%02d', get_month_number (t.m)); -- make sure that month and day are two digits
t.d = string.format ('%02d', t.d);
elseif mon_len then -- if mon_len is set to either 'short' or 'long'
for _, mon in ipairs ({'m', 'm2'}) do -- because there can be two month names, check both
if t[mon] then
t[mon] = get_month_number (t[mon]); -- get the month number for this month (is length agnostic)
if 0 == t[mon] then return; end -- seasons and named dates can't be converted
t[mon] = (('s' == mon_len) and cfg.date_names['inv_local_s'][t[mon]]) or cfg.date_names['inv_local_l'][t[mon]]; -- fetch month name according to length
end
end
end
local new_date = string.format (re_formats[pattern_idx][format_param][1], -- format string
t[re_formats[pattern_idx][format_param][2]], -- named captures from t{}
t[re_formats[pattern_idx][format_param][3]],
t[re_formats[pattern_idx][format_param][4]],
t[re_formats[pattern_idx][format_param][5]],
t[re_formats[pattern_idx][format_param][6]],
t[re_formats[pattern_idx][format_param][7]],
t[re_formats[pattern_idx][format_param][8]]
);
return new_date;
end
--[[-------------------------< R E F O R M A T _ D A T E S >--------------------------------------------------
Reformats existing dates into the format specified by format.
format is one of several manual keywords: dmy, dmy-all, mdy, mdy-all, ymd, ymd-all. The -all version includes
access- and archive-dates; otherwise these dates are not reformatted.
This function allows automatic date formatting. In ~/Configuration, the article source is searched for one of
the {{use xxx dates}} templates. If found, xxx becomes the global date format as xxx-all. If |cs1-dates= in
{{use xxx dates}} has legitimate value then that value determines how cs1|2 dates will be rendered. Legitimate
values for |cs1-dates= are:
l - all dates are rendered with long month names
ls - publication dates use long month names; access-/archive-dates use abbreviated month names
ly - publication dates use long month names; access-/archive-dates rendered in ymd format
s - all dates are rendered with abbreviated (short) month names
sy - publication dates use abbreviated month names; access-/archive-dates rendered in ymd format
y - all dates are rendered in ymd format
the format argument for automatic date formatting will be the format specified by {{use xxx dates}} with the
value supplied by |cs1-dates so one of: xxx-l, xxx-ls, xxx-ly, xxx-s, xxx-sy, xxx-y, or simply xxx (|cs1-dates=
empty, omitted, or invalid) where xxx shall be either of dmy or mdy.
dates are extracted from date_parameters_list, reformatted (if appropriate), and then written back into the
list in the new format. Dates in date_parameters_list are presumed here to be valid (no errors). This function
returns true when a date has been reformatted, false else. Actual reformatting is done by reformatter().
]]
local function reformat_dates (date_parameters_list, format)
local all = false; -- set to false to skip access- and archive-dates
local len_p = 'l'; -- default publication date length shall be long
local len_a = 'l'; -- default access-/archive-date length shall be long
local result = false;
local new_date;
if format:match('%a+%-all') then -- manual df keyword; auto df keyword when length not specified in {{use xxx dates}};
format = format:match('(%a+)%-all'); -- extract the format
all = true; -- all dates are long format dates because this keyword doesn't specify length
elseif format:match('%a+%-[lsy][sy]?') then -- auto df keywords; internal only
all = true; -- auto df applies to all dates; use length specified by capture len_p for all dates
format, len_p, len_a = format:match('(%a+)%-([lsy])([sy]?)'); -- extract the format and length keywords
if 'y' == len_p then -- because allowed by MOS:DATEUNIFY (sort of) range dates and My dates not reformatted
format = 'ymd'; -- override {{use xxx dates}}
elseif (not is_set(len_a)) or (len_p == len_a) then -- no access-/archive-date length specified or same length as publication dates then
len_a = len_p; -- in case len_a not set
end
end -- else only publication dates and they are long
for param_name, param_val in pairs (date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then -- if the parameter has a value
if not (not all and in_array (param_name, {'access-date', 'archive-date'})) then -- skip access- or archive-date unless format is xxx-all; yeah, ugly; TODO: find a better way
for pattern_idx, pattern in pairs (patterns) do
if mw.ustring.match (param_val.val, pattern[1]) then
if all and in_array (param_name, {'access-date', 'archive-date'}) then -- if this date is an access- or archive-date
new_date = reformatter (param_val.val, pattern_idx, (('y' == len_a) and 'ymd') or format, len_a); -- choose ymd or dmy/mdy according to len_a setting
else -- all other dates
new_date = reformatter (param_val.val, pattern_idx, format, len_p);
end
if new_date then -- set when date was reformatted
date_parameters_list[param_name].val = new_date; -- update date in date list
result = true; -- and announce that changes have been made
end
end -- if
end -- for
end -- if
end -- if
end -- for
return result; -- declare boolean result and done
end
--[[--------------------------< D A T E _ H Y P H E N _ T O _ D A S H >----------------------------------------
Loops through the list of date-holding parameters and converts any hyphen to an ndash. Not called if the cs1|2
template has any date errors.
Modifies the date_parameters_list and returns true if hyphens are replaced, else returns false.
]]
local function date_hyphen_to_dash (date_parameters_list)
local result = false;
local n;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set (param_val.val) then
if not mw.ustring.match (param_val.val, '%d%d%d%d%-%d%d%-%d%d') then -- for those that are not ymd dates (ustring because here digits may not be western)
param_val.val, n = param_val.val:gsub ('%-', '–'); -- replace any hyphen with ndash
if 0 ~= n then
date_parameters_list[param_name].val = param_val.val; -- update the list
result = true;
end
end
end
end
return result; -- so we know if any hyphens were replaced
end
--[[-------------------------< D A T E _ N A M E _ X L A T E >------------------------------------------------
Attempts to translate English month names to local-language month names using names supplied by MediaWiki's
date parser function. This is simple name-for-name replacement and may not work for all languages.
if xlat_dig is true, this function will also translate western (English) digits to the local language's digits.
This will also translate ymd dates.
]]
local function date_name_xlate (date_parameters_list, xlt_dig)
local xlate;
local mode; -- long or short month names
local modified = false;
local date;
for param_name, param_val in pairs(date_parameters_list) do -- for each date-holding parameter in the list
if is_set(param_val.val) then -- if the parameter has a value
date = param_val.val;
for month in mw.ustring.gmatch (date, '%a+') do -- iterate through all dates in the date (single date or date range)
if cfg.date_names.en.long[month] then
mode = 'F'; -- English name is long so use long local name
elseif cfg.date_names.en.short[month] then
mode = 'M'; -- English name is short so use short local name
else
mode = nil; -- not an English month name; could be local language month name or an English season name
end
if mode then -- might be a season
xlate = lang_object:formatDate(mode, '1' .. month); -- translate the month name to this local language
date = mw.ustring.gsub (date, month, xlate); -- replace the English with the translation
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
if xlt_dig then -- shall we also translate digits?
date = date:gsub ('%d', cfg.date_names.xlate_digits); -- translate digits from western to 'local digits'
date_parameters_list[param_name].val = date; -- save the translated date
modified = true;
end
end
end
return modified;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
is_set = utilities_page_ptr.is_set; -- import functions from selected Module:Citation/CS1/Utilities module
in_array = utilities_page_ptr.in_array; -- import functions from selected Module:Citation/CS1/Utilities module
cfg = cfg_table_ptr; -- import tables from selected Module:Citation/CS1/Configuration
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return { -- return exported functions
dates = dates,
year_date_check = year_date_check,
reformat_dates = reformat_dates,
date_hyphen_to_dash = date_hyphen_to_dash,
date_name_xlate = date_name_xlate,
set_selected_modules = set_selected_modules
}
ceb2a1f045831c93875c98c30b6c73da97d557c9
Module:Citation/CS1/Identifiers
828
89
177
176
2024-06-03T23:43:02Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local is_set, in_array, set_error, select_one, add_maint_cat, substitute, make_wikilink; -- functions in Module:Citation/CS1/Utilities
local z; -- table of tables defined in Module:Citation/CS1/Utilities
local cfg; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
--============================<< H E L P E R F U N C T I O N S >>============================================
--[[--------------------------< E X T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki style external link
]]
local function external_link_id(options)
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code; -- wikipedia subdomain; 'en' for en.wikipedia.org
local wd_article; -- article title from wikidata
if options.encode == true or options.encode == nil then
url_string = mw.uri.encode( url_string );
end
ext_link = mw.ustring.format ('[%s%s%s %s]', options.prefix, url_string, options.suffix or "", mw.text.nowiki(options.id));
if is_set(options.access) then
ext_link = substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[options.access].class, cfg.presentation[options.access].title, ext_link}); -- add the free-to-read / paywall lock
end
-- this_wiki_code = mw.language.getContentLanguage():getCode(); -- get this wikipedia's language code (subdomain)
if string.match (mw.site.server, 'wikidata') then
this_wiki_code = mw.getCurrentFrame():preprocess('{{int:lang}}'); -- on wikidata so use interface language setting instead
end
if is_set (options.q) and mw.wikibase then -- wikibase test here avoids script errors in third party wikis that aren't using mw.wikibase extension
wd_article = mw.wikibase.getEntity (options.q):getSitelink (this_wiki_code .. 'wiki'); -- fetch article title from wd
if wd_article then
wd_article = table.concat ({':', this_wiki_code, ':', wd_article}); -- make interwiki link if taken from wd; leading colon required
end
end
return table.concat ({
make_wikilink (wd_article or options.link, options.label), -- wikidata link or locally specified
options.separator or ' ',
ext_link
});
end
--[[--------------------------< I N T E R N A L _ L I N K _ I D >----------------------------------------------
Formats a wiki style internal link
]]
local function internal_link_id(options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
return table.concat (
{
make_wikilink (options.link, options.label),
options.separator or ' ',
make_wikilink (
table.concat (
{
options.prefix,
id, -- translated to western digits
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latn script identifiers from being reversed at rtl language wikis
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
});
end
--[[--------------------------< I S _ E M B A R G O E D >------------------------------------------------------
Determines if a PMC identifier's online version is embargoed. Compares the date in |embargo= against today's date. If embargo date is
in the future, returns the content of |embargo=; otherwise, returns and empty string because the embargo has expired or because
|embargo= was not set in this cite.
]]
local function is_embargoed (embargo)
if is_set (embargo) then
local lang = mw.getContentLanguage();
local good1, embargo_date, good2, todays_date;
good1, embargo_date = pcall( lang.formatDate, lang, 'U', embargo );
good2, todays_date = pcall( lang.formatDate, lang, 'U' );
if good1 and good2 then -- if embargo date and today's date are good dates
if tonumber( embargo_date ) >= tonumber( todays_date ) then -- is embargo date is in the future?
return embargo; -- still embargoed
else
add_maint_cat ('embargo')
return ''; -- unset because embargo has expired
end
end
end
return ''; -- |embargo= not set return empty string
end
--[[--------------------------< IS _ V A L I D _ I S X N >-----------------------------------------------------
ISBN-10 and ISSN validator code calculates checksum across all isbn/issn digits including the check digit.
ISBN-13 is checked in isbn().
If the number is valid the result will be 0. Before calling this function, issbn/issn must be checked for length
and stripped of dashes, spaces and other non-isxn characters.
]]
local function is_valid_isxn (isxn_str, len)
local temp = 0;
isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39, 'X' → 0x58
len = len+1; -- adjust to be a loop counter
for i, v in ipairs( isxn_str ) do -- loop through all of the bytes and calculate the checksum
if v == string.byte( "X" ) then -- if checkdigit is X (compares the byte value of 'X' which is 0x58)
temp = temp + 10*( len - i ); -- it represents 10 decimal
else
temp = temp + tonumber( string.char(v) )*(len-i);
end
end
return temp % 11 == 0; -- returns true if calculation result is zero
end
--[[--------------------------< IS _ V A L I D _ I S X N _ 1 3 >-----------------------------------------------
ISBN-13 and ISMN validator code calculates checksum across all 13 isbn/ismn digits including the check digit.
If the number is valid, the result will be 0. Before calling this function, isbn-13/ismn must be checked for length
and stripped of dashes, spaces and other non-isxn-13 characters.
]]
local function is_valid_isxn_13 (isxn_str)
local temp=0;
isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values '0' → 0x30 .. '9' → 0x39
for i, v in ipairs( isxn_str ) do
temp = temp + (3 - 2*(i % 2)) * tonumber( string.char(v) ); -- multiply odd index digits by 1, even index digits by 3 and sum; includes check digit
end
return temp % 10 == 0; -- sum modulo 10 is zero when isbn-13/ismn is correct
end
--[[--------------------------< N O R M A L I Z E _ L C C N >--------------------------------------------------
lccn normalization (http://www.loc.gov/marc/lccn-namespace.html#normalization)
1. Remove all blanks.
2. If there is a forward slash (/) in the string, remove it, and remove all characters to the right of the forward slash.
3. If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed) hyphen. Then (and assuming that steps 1 and 2 have been carried out):
1. All these characters should be digits, and there should be six or less. (not done in this function)
2. If the length of the substring is less than 6, left-fill the substring with zeroes until the length is six.
Returns a normalized lccn for lccn() to validate. There is no error checking (step 3.b.1) performed in this function.
]]
local function normalize_lccn (lccn)
lccn = lccn:gsub ("%s", ""); -- 1. strip whitespace
if nil ~= string.find (lccn,'/') then
lccn = lccn:match ("(.-)/"); -- 2. remove forward slash and all character to the right of it
end
local prefix
local suffix
prefix, suffix = lccn:match ("(.+)%-(.+)"); -- 3.a remove hyphen by splitting the string into prefix and suffix
if nil ~= suffix then -- if there was a hyphen
suffix=string.rep("0", 6-string.len (suffix)) .. suffix; -- 3.b.2 left fill the suffix with 0s if suffix length less than 6
lccn=prefix..suffix; -- reassemble the lccn
end
return lccn;
end
--============================<< I D E N T I F I E R F U N C T I O N S >>====================================
--[[--------------------------< A R X I V >--------------------------------------------------------------------
See: http://arxiv.org/help/arxiv_identifier
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9108 and 0703 is:
arXiv:<archive>.<class>/<date code><number><version>
where:
<archive> is a string of alpha characters - may be hyphenated; no other punctuation
<class> is a string of alpha characters - may be hyphenated; no other punctuation; not the same as |class= parameter which is not supported in this form
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
first digit of YY for this form can only 9 and 0
<number> is a three-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
<date code> is four digits in the form YYMM where YY is the last two digits of the four-digit year and MM is the month number January = 01
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
local function arxiv (id, class)
local handler = cfg.id_handlers['ARXIV'];
local year, month, version;
local err_cat = false; -- assume no error message
local text; -- output text
if id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$") or id:match("^%a[%a%.%-]+/[90]%d[01]%d%d%d%dv%d+$") then -- test for the 9108-0703 format w/ & w/o version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
err_cat = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 w/ & w/o version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((7 > year) or (14 < year) or (1 > month or 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) then --or -- when year is 07, is month invalid (before April)?
err_cat = true; -- flag for error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format w/ & w/o version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_cat = true; -- flag for error message
end
else
err_cat = true; -- not a recognized format; flag for error message
end
err_cat = err_cat and table.concat ({' ', set_error ('bad_arxiv')}) or ''; -- set error message if flag is true
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=handler.access}) .. err_cat;
if is_set (class) then
if id:match ('^%d+') then
text = table.concat ({text, ' [[//arxiv.org/archive/', class, ' ', class, ']]'}); -- external link within square brackets, not wikilink
else
text = table.concat ({text, ' ', set_error ('class_ignored')});
end
end
return text;
end
--[[--------------------------< B I B C O D E >--------------------------------------------------------------------
Validates (sort of) and formats a bibcode id.
Format for bibcodes is specified here: http://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters
and first four digits must be a year. This function makes these tests:
length must be 19 characters
characters in position
1–4 must be digits and must represent a year in the range of 1000 – next year
5 must be a letter
6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &. )
9–18 must be letter, digit, or dot
19 must be a letter or dot
]]
local function bibcode (id, access)
local handler = cfg.id_handlers['BIBCODE'];
local err_type;
local year;
local text = external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix, id=id, separator=handler.separator, encode=handler.encode,
access=access});
if 19 ~= id:len() then
err_type = 'length';
else
year = id:match ("^(%d%d%d%d)[%a][%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$") --
if not year then -- if nil then no pattern match
err_type = 'value'; -- so value error
else
local next_year = tonumber(os.date ('%Y'))+1; -- get the current year as a number and add one for next year
year = tonumber (year); -- convert year portion of bibcode to a number
if (1000 > year) or (year > next_year) then
err_type = 'year'; -- year out of bounds
end
if id:find('&%.') then
err_type = 'journal'; -- journal abbreviation must not have '&.' (if it does its missing a letter)
end
end
end
if is_set (err_type) then -- if there was an error detected
text = text .. ' ' .. set_error( 'bad_bibcode', {err_type});
end
return text;
end
--[[--------------------------< B I O R X I V >-----------------------------------------------------------------
Format bioRxiv id and do simple error checking. BiorXiv ids are exactly 6 digits.
The bioRxiv id is the number following the last slash in the bioRxiv-issued DOI:
https://doi.org/10.1101/078733 -> 078733
]]
local function biorxiv(id)
local handler = cfg.id_handlers['BIORXIV'];
local err_cat = ''; -- presume that bioRxiv id is valid
if nil == id:match("^%d%d%d%d%d%d$") then -- if bioRxiv id has anything but six digits
err_cat = ' ' .. set_error( 'bad_biorxiv'); -- set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator,
encode=handler.encode, access=handler.access}) .. err_cat;
end
--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
CiteSeerX use their own notion of "doi" (not to be confused with the identifiers resolved via doi.org).
The description of the structure of this identifier can be found at Help_talk:Citation_Style_1/Archive_26#CiteSeerX_id_structure
]]
local function citeseerx (id)
local handler = cfg.id_handlers['CITESEERX'];
local matched;
local text = external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix, id=id, separator=handler.separator, encode=handler.encode,
access=handler.access});
matched = id:match ("^10%.1%.1%.[1-9]%d?%d?%d?%.[1-9]%d?%d?%d?$");
if not matched then
text = text .. ' ' .. set_error( 'bad_citeseerx' );
end
return text;
end
--[[--------------------------< D O I >------------------------------------------------------------------------
Formats a DOI and checks for DOI errors.
DOI names contain two parts: prefix and suffix separated by a forward slash.
Prefix: directory indicator '10.' followed by a registrant code
Suffix: character string of any length chosen by the registrant
This function checks a DOI name for: prefix/suffix. If the doi name contains spaces or endashes, or, if it ends
with a period or a comma, this function will emit a bad_doi error message.
DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,
and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in doi names.
]]
local function doi(id, inactive, access)
local cat = ""
local handler = cfg.id_handlers['DOI'];
local text;
if is_set(inactive) then
local inactive_year = inactive:match("%d%d%d%d") or ''; -- try to get the year portion from the inactive date
local inactive_month, good;
if is_set (inactive_year) then
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
if not good then
inactive_month = nil; -- something went wrong so make sure this is unset
end
end
else
inactive_year = nil; -- |doi-broken= has something but it isn't a date
end
if is_set(inactive_year) and is_set (inactive_month) then
table.insert( z.error_categories, 'Pages with DOIs inactive as of ' .. inactive_year .. ' ' .. inactive_month); -- use inactive month in category name
elseif is_set(inactive_year) then
table.insert( z.error_categories, 'Pages with DOIs inactive as of ' .. inactive_year);
else
table.insert( z.error_categories, 'Pages with inactive DOIs'); -- when inactive doesn't contain a recognizable date
end
inactive = " (" .. cfg.messages['inactive'] .. ' ' .. inactive .. ')';
end
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=access}) .. (inactive or '')
local registrant = id:match ('^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when doi has the proper basic form
registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d%d*$', -- 5 digits with subcode (0xxxx, 40000+); accecpts: 10000–39999
'^[^1-3]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 40000+); accecpts: 10000–39999
'^[^1-9]%d%d%d%.%d%d*$', -- 4 digits with subcode (0xxx); accecpts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accecpts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?$', -- less than 4 digits without subcode (with subcode is legitimate)
'^5555$', -- test registrant will never resolve
}
if registrant then -- when doi has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
cat = ' ' .. set_error ('bad_doi'); -- when found, mark this doi as bad
break; -- and done
end
end
else
cat = ' ' .. set_error ('bad_doi'); -- invalid directory or malformed
end
return text .. cat
end
--[[--------------------------< H D L >------------------------------------------------------------------------
Formats an HDL with minor error checking.
HDL names contain two parts: prefix and suffix separated by a forward slash.
Prefix: character string using any character in the UCS-2 character set except '/'
Suffix: character string of any length using any character in the UCS-2 character set chosen by the registrant
This function checks a HDL name for: prefix/suffix. If the HDL name contains spaces, endashes, or, if it ends
with a period or a comma, this function will emit a bad_hdl error message.
HDL names are case-insensitive and can incorporate any printable Unicode characters so the test for endashes and
terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely
if ever used in HDLs.
]]
local function hdl(id, access)
local handler = cfg.id_handlers['HDL'];
local text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=access})
if nil == id:match("^[^%s–]-/[^%s–]-[^%.,]$") then -- hdl must contain a fwd slash, must not contain spaces, endashes, and must not end with period or comma
text = text .. ' ' .. set_error( 'bad_hdl' );
end
return text;
end
--[[--------------------------< I S B N >----------------------------------------------------------------------
Determines whether an ISBN string is valid
]]
local function isbn( isbn_str )
if nil ~= isbn_str:match("[^%s-0-9X]") then
return false, 'invalid character'; -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
end
isbn_str = isbn_str:gsub( "-", "" ):gsub( " ", "" ); -- remove hyphens and spaces
local len = isbn_str:len();
if len ~= 10 and len ~= 13 then
return false, 'length'; -- fail if incorrect length
end
if len == 10 then
if isbn_str:match( "^%d*X?$" ) == nil then -- fail if isbn_str has 'X' anywhere but last position
return false, 'invalid form';
end
return is_valid_isxn(isbn_str, 10), 'checksum';
else
if isbn_str:match( "^%d+$" ) == nil then
return false, 'invalid character'; -- fail if isbn13 is not all digits
end
if isbn_str:match( "^97[89]%d*$" ) == nil then
return false, 'invalid prefix'; -- fail when isbn13 does not begin with 978 or 979
end
if isbn_str:match ('^9790') then
return false, 'invalid group id'; -- group identifier '0' is reserved to ismn
end
return is_valid_isxn_13 (isbn_str), 'checksum';
end
end
--[[--------------------------< A M A Z O N >------------------------------------------------------------------
Formats a link to Amazon. Do simple error checking: asin must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, asins must be 10-digit
isbn. If 10-digit isbn, add a maintenance category so a bot or awb script can replace |asin= with |isbn=.
Error message if not 10 characters, if not isbn10, if mixed and first character is a digit.
This function is positioned here because it calls isbn()
]]
local function asin(id, domain)
local err_cat = ""
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_cat = ' ' .. set_error ('bad_asin'); -- asin is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d[%dX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if isbn( id ) then -- see if asin value is isbn10
add_maint_cat ('ASIN');
elseif not is_set (err_cat) then
err_cat = ' ' .. set_error ('bad_asin'); -- asin is not isbn10
end
elseif not id:match("^%u[%d%u]+$") then
err_cat = ' ' .. set_error ('bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if not is_set(domain) then
domain = "com";
elseif in_array (domain, {'jp', 'uk'}) then -- Japan, United Kingdom
domain = "co." .. domain;
elseif in_array (domain, {'au', 'br', 'mx'}) then -- Australia, Brazil, Mexico
domain = "com." .. domain;
end
local handler = cfg.id_handlers['ASIN'];
return external_link_id({link=handler.link,
label=handler.label, q = handler.q, prefix=handler.prefix .. domain .. "/dp/",
id=id, encode=handler.encode, separator = handler.separator}) .. err_cat;
end
--[[--------------------------< I S M N >----------------------------------------------------------------------
Determines whether an ISMN string is valid. Similar to isbn-13, ismn is 13 digits begining 979-0-... and uses the
same check digit calculations. See http://www.ismn-international.org/download/Web_ISMN_Users_Manual_2008-6.pdf
section 2, pages 9–12.
]]
local function ismn (id)
local handler = cfg.id_handlers['ISMN'];
local text;
local valid_ismn = true;
local id_copy;
id_copy = id; -- save a copy because this testing is destructive
id=id:gsub( "[%s-–]", "" ); -- strip spaces, hyphens, and endashes from the ismn
if 13 ~= id:len() or id:match( "^9790%d*$" ) == nil then -- ismn must be 13 digits and begin 9790
valid_ismn = false;
else
valid_ismn=is_valid_isxn_13 (id); -- validate ismn
end
-- text = internal_link_id({link = handler.link, label = handler.label, -- use this (or external version) when there is some place to link to
-- prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
text = table.concat (
{
make_wikilink (handler.link, handler.label),
handler.separator,
id_copy
}); -- because no place to link to yet
if false == valid_ismn then
text = text .. ' ' .. set_error( 'bad_ismn' ) -- add an error message if the ismn is invalid
end
return text;
end
--[[--------------------------< I S S N >----------------------------------------------------------------------
Validate and format an issn. This code fixes the case where an editor has included an ISSN in the citation but
has separated the two groups of four digits with a space. When that condition occurred, the resulting link looked
like this:
|issn=0819 4327 gives: [http://www.worldcat.org/issn/0819 4327 0819 4327] -- can't have spaces in an external link
This code now prevents that by inserting a hyphen at the issn midpoint. It also validates the issn for length
and makes sure that the checkdigit agrees with the calculated value. Incorrect length (8 digits), characters
other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check issn error message. The
issn is always displayed with a hyphen, even if the issn was given as a single group of 8 digits.
]]
local function issn(id, e)
local issn_copy = id; -- save a copy of unadulterated issn; use this version for display if issn does not validate
local handler;
local text;
local valid_issn = true;
if e then
handler = cfg.id_handlers['EISSN'];
else
handler = cfg.id_handlers['ISSN'];
end
id=id:gsub( "[%s-–]", "" ); -- strip spaces, hyphens, and endashes from the issn
if 8 ~= id:len() or nil == id:match( "^%d*X?$" ) then -- validate the issn: 8 digits long, containing only 0-9 or X in the last position
valid_issn=false; -- wrong length or improper character
else
valid_issn=is_valid_isxn(id, 8); -- validate issn
end
if true == valid_issn then
id = string.sub( id, 1, 4 ) .. "-" .. string.sub( id, 5 ); -- if valid, display correctly formatted version
else
id = issn_copy; -- if not valid, use the show the invalid issn with error message
end
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
if false == valid_issn then
text = text .. ' ' .. set_error( 'bad_issn', e and 'e' or '' ) -- add an error message if the issn is invalid
end
return text
end
--[[--------------------------< J F M >-----------------------------------------------------------------------
A numerical identifier in the form nn.nnnn.nn
]]
local function jfm (id)
local handler = cfg.id_handlers['JFM'];
local id_num;
local err_cat = '';
id_num = id:match ('^[Jj][Ff][Mm](.*)$'); -- identifier with jfm prefix; extract identifier
if is_set (id_num) then
add_maint_cat ('jfm_format');
else -- plain number without mr prefix
id_num = id; -- if here id does not have prefix
end
if id_num and id_num:match('^%d%d%.%d%d%d%d%.%d%d$') then
id = id_num; -- jfm matches pattern
else
err_cat = ' ' .. set_error( 'bad_jfm' ); -- set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< L C C N >----------------------------------------------------------------------
Format LCCN link and do simple error checking. LCCN is a character string 8-12 characters long. The length of
the LCCN dictates the character type of the first 1-3 characters; the rightmost eight are always digits.
http://info-uri.info/registry/OAIHandler?verb=GetRecord&metadataPrefix=reg&identifier=info:lccn/
length = 8 then all digits
length = 9 then lccn[1] is lower case alpha
length = 10 then lccn[1] and lccn[2] are both lower case alpha or both digits
length = 11 then lccn[1] is lower case alpha, lccn[2] and lccn[3] are both lower case alpha or both digits
length = 12 then lccn[1] and lccn[2] are both lower case alpha
]]
local function lccn(lccn)
local handler = cfg.id_handlers['LCCN'];
local err_cat = ''; -- presume that LCCN is valid
local id = lccn; -- local copy of the lccn
id = normalize_lccn (id); -- get canonical form (no whitespace, hyphens, forward slashes)
local len = id:len(); -- get the length of the lccn
if 8 == len then
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits)
err_cat = ' ' .. set_error( 'bad_lccn' ); -- set an error message
end
elseif 9 == len then -- LCCN should be adddddddd
if nil == id:match("%l%d%d%d%d%d%d%d%d") then -- does it match our pattern?
err_cat = ' ' .. set_error( 'bad_lccn' ); -- set an error message
end
elseif 10 == len then -- LCCN should be aadddddddd or dddddddddd
if id:match("[^%d]") then -- if LCCN has anything but digits (nil if only digits) ...
if nil == id:match("^%l%l%d%d%d%d%d%d%d%d") then -- ... see if it matches our pattern
err_cat = ' ' .. set_error( 'bad_lccn' ); -- no match, set an error message
end
end
elseif 11 == len then -- LCCN should be aaadddddddd or adddddddddd
if not (id:match("^%l%l%l%d%d%d%d%d%d%d%d") or id:match("^%l%d%d%d%d%d%d%d%d%d%d")) then -- see if it matches one of our patterns
err_cat = ' ' .. set_error( 'bad_lccn' ); -- no match, set an error message
end
elseif 12 == len then -- LCCN should be aadddddddddd
if not id:match("^%l%l%d%d%d%d%d%d%d%d%d%d") then -- see if it matches our pattern
err_cat = ' ' .. set_error( 'bad_lccn' ); -- no match, set an error message
end
else
err_cat = ' ' .. set_error( 'bad_lccn' ); -- wrong length, set an error message
end
if not is_set (err_cat) and nil ~= lccn:find ('%s') then
err_cat = ' ' .. set_error( 'bad_lccn' ); -- lccn contains a space, set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=lccn,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< M R >--------------------------------------------------------------------------
A seven digit number; if not seven digits, zero-fill leading digits to make seven digits.
]]
local function mr (id)
local handler = cfg.id_handlers['MR'];
local id_num;
local id_len;
local err_cat = '';
id_num = id:match ('^[Mm][Rr](%d+)$'); -- identifier with mr prefix
if is_set (id_num) then
add_maint_cat ('mr_format');
else -- plain number without mr prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
id_len = id_num and id_num:len() or 0;
if (7 >= id_len) and (0 ~= id_len) then
id = string.rep ('0', 7-id_len ) .. id_num; -- zero-fill leading digits
else
err_cat = ' ' .. set_error( 'bad_mr' ); -- set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< O C L C >----------------------------------------------------------------------
Validate and format an oclc id. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
]]
local function oclc (id)
local handler = cfg.id_handlers['OCLC'];
local number;
local err_msg = ''; -- empty string for concatenation
if id:match('^ocm%d%d%d%d%d%d%d%d$') then -- ocm prefix and 8 digits; 001 field (12 characters)
number = id:match('ocm(%d+)'); -- get the number
elseif id:match('^ocn%d%d%d%d%d%d%d%d%d$') then -- ocn prefix and 9 digits; 001 field (12 characters)
number = id:match('ocn(%d+)'); -- get the number
elseif id:match('^on%d%d%d%d%d%d%d%d%d%d+$') then -- on prefix and 10 or more digits; 001 field (12 characters)
number = id:match('^on(%d%d%d%d%d%d%d%d%d%d+)$'); -- get the number
elseif id:match('^%(OCoLC%)[1-9]%d*$') then -- (OCoLC) prefix and variable number digits; no leading zeros; 035 field
number = id:match('%(OCoLC%)([1-9]%d*)'); -- get the number
if 9 < number:len() then
number = nil; -- contrain to 1 to 9 digits; change this when oclc issues 10-digit numbers
end
elseif id:match('^%d+$') then -- no prefix
number = id; -- get the number
if 10 < number:len() then
number = nil; -- contrain to 1 to 10 digits; change this when oclc issues 11-digit numbers
end
end
if number then -- proper format
id = number; -- exclude prefix, if any, from external link
else
err_msg = ' ' .. set_error( 'bad_oclc' ) -- add an error message if the id is malformed
end
local text = external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix, id=id, separator=handler.separator, encode=handler.encode}) .. err_msg;
return text;
end
--[[--------------------------< O P E N L I B R A R Y >--------------------------------------------------------
Formats an OpenLibrary link, and checks for associated errors.
]]
local function openlibrary(id, access)
local code;
local handler = cfg.id_handlers['OL'];
local ident;
ident, code = id:gsub('^OL', ''):match("^(%d+([AMW]))$"); -- optional OL prefix followed immediately by digits followed by 'A', 'M', or 'W'; remove OL prefix
if not is_set (ident) then -- if malformed return an error
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access}) .. ' ' .. set_error( 'bad_ol' );
end
id = ident; -- use ident without the optional OL prefix (it has been removed)
if ( code == "A" ) then
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'authors/OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access})
end
if ( code == "M" ) then
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'books/OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access})
end
if ( code == "W" ) then
return external_link_id({link=handler.link, label=handler.label, q = handler.q,
prefix=handler.prefix .. 'works/OL',
id=id, separator=handler.separator, encode = handler.encode,
access = access})
end
end
--[[--------------------------< P M C >------------------------------------------------------------------------
Format a PMC, do simple error checking, and check for embargoed articles.
The embargo parameter takes a date for a value. If the embargo date is in the future the PMC identifier will not
be linked to the article. If the embargo date is today or in the past, or if it is empty or omitted, then the
PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.
PMC embargo date testing is done in function is_embargoed () which is called earlier because when the citation
has |pmc=<value> but does not have a |url= then |title= is linked with the PMC link. Function is_embargoed ()
returns the embargo date if the PMC article is still embargoed, otherwise it returns an empty string.
PMCs are sequential numbers beginning at 1 and counting up. This code checks the PMC to see that it contains only digits and is less
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.
]]
local function pmc(id, embargo)
local test_limit = 8000000; -- update this value as PMCs approach
local handler = cfg.id_handlers['PMC'];
local err_cat = ''; -- presume that PMC is valid
local id_num;
local text;
id_num = id:match ('^[Pp][Mm][Cc](%d+)$'); -- identifier with pmc prefix
if is_set (id_num) then
add_maint_cat ('pmc_format');
else -- plain number without pmc prefix
id_num = id:match ('^%d+$'); -- if here id is all digits
end
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber(id_num); -- convert id_num to a number for range testing
if 1 > id_num or test_limit < id_num then -- if PMC is outside test limit boundaries
err_cat = ' ' .. set_error( 'bad_pmc' ); -- set an error message
else
id = tostring (id_num); -- make sure id is a string
end
else -- when id format incorrect
err_cat = ' ' .. set_error( 'bad_pmc' ); -- set an error message
end
if is_set (embargo) then -- is PMC is still embargoed?
text = table.concat ( -- still embargoed so no external link
{
make_wikilink (handler.link, handler.label),
handler.separator,
id,
err_cat
});
else
text = external_link_id({link = handler.link, label = handler.label, q = handler.q, -- no embargo date or embargo has expired, ok to link to article
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=handler.access}) .. err_cat;
end
return text;
end
--[[--------------------------< P M I D >----------------------------------------------------------------------
Format PMID and do simple error checking. PMIDs are sequential numbers beginning at 1 and counting up. This
code checks the PMID to see that it contains only digits and is less than test_limit; the value in local variable
test_limit will need to be updated periodically as more PMIDs are issued.
]]
local function pmid(id)
local test_limit = 33000000; -- update this value as PMIDs approach
local handler = cfg.id_handlers['PMID'];
local err_cat = ''; -- presume that PMID is valid
if id:match("[^%d]") then -- if PMID has anything but digits
err_cat = ' ' .. set_error( 'bad_pmid' ); -- set an error message
else -- PMID is only digits
local id_num = tonumber(id); -- convert id to a number for range testing
if 1 > id_num or test_limit < id_num then -- if PMID is outside test limit boundaries
err_cat = ' ' .. set_error( 'bad_pmid' ); -- set an error message
end
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--[[--------------------------< S S R N >----------------------------------------------------------------------
Format an ssrn, do simple error checking
SSRNs are sequential numbers beginning at 100? and counting up. This code checks the ssrn to see that it is
only digits and is greater than 99 and less than test_limit; the value in local variable test_limit will need
to be updated periodically as more SSRNs are issued.
]]
local function ssrn (id)
local test_limit = 3500000; -- update this value as SSRNs approach
local handler = cfg.id_handlers['SSRN'];
local err_cat = ''; -- presume that SSRN is valid
local id_num;
local text;
id_num = id:match ('^%d+$'); -- id must be all digits
if is_set (id_num) then -- id_num has a value so test it
id_num = tonumber(id_num); -- convert id_num to a number for range testing
if 100 > id_num or test_limit < id_num then -- if SSRN is outside test limit boundaries
err_cat = ' ' .. set_error( 'bad_ssrn' ); -- set an error message
end
else -- when id format incorrect
err_cat = ' ' .. set_error( 'bad_ssrn' ); -- set an error message
end
text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=handler.access}) .. err_cat;
return text;
end
--[[--------------------------< U S E N E T _ I D >------------------------------------------------------------
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
]]
local function usenet_id (id)
local handler = cfg.id_handlers['USENETID'];
local text = external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$')then -- doesn't have '@' or has one or first or last character is '< or '>'
text = text .. ' ' .. set_error( 'bad_usenet_id' ) -- add an error message if the message id is invalid
end
return text
end
--[[--------------------------< Z B L >-----------------------------------------------------------------------
A numerical identifier in the form nnnn.nnnnn - leading zeros in the first quartet optional
format described here: http://emis.mi.sanu.ac.rs/ZMATH/zmath/en/help/search/
temporary format is apparently eight digits. Anything else is an error
]]
local function zbl (id)
local handler = cfg.id_handlers['ZBL'];
local err_cat = '';
if id:match('^%d%d%d%d%d%d%d%d$') then -- is this identifier using temporary format?
add_maint_cat ('zbl'); -- yes, add maint cat
elseif not id:match('^%d?%d?%d?%d%.%d%d%d%d%d$') then -- not temporary, is it normal format?
err_cat = ' ' .. set_error( 'bad_zbl' ); -- no, set an error message
end
return external_link_id({link = handler.link, label = handler.label, q = handler.q,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
--============================<< I N T E R F A C E F U N C T I O N S >>==========================================
--[[--------------------------< B U I L D _ I D _ L I S T >--------------------------------------------------------
Takes a table of IDs created by extract_ids() and turns it into a table of formatted ID outputs.
inputs:
id_list – table of identifiers built by extract_ids()
options – table of various template parameter values used to modify some manually handled identifiers
]]
local function build_id_list( id_list, options )
local new_list, handler = {};
local function fallback(k) return { __index = function(t,i) return cfg.id_handlers[k][i] end } end;
for k, v in pairs( id_list ) do -- k is uc identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
-- fallback to read-only cfg
handler = setmetatable( { ['id'] = v, ['access'] = options.IdAccessLevels[k] }, fallback(k) );
if handler.mode == 'external' then
table.insert( new_list, {handler.label, external_link_id( handler ) } );
elseif handler.mode == 'internal' then
table.insert( new_list, {handler.label, internal_link_id( handler ) } );
elseif handler.mode ~= 'manual' then
error( cfg.messages['unknown_ID_mode'] );
elseif k == 'ARXIV' then
table.insert( new_list, {handler.label, arxiv( v, options.Class ) } );
elseif k == 'ASIN' then
table.insert( new_list, {handler.label, asin( v, options.ASINTLD ) } );
elseif k == 'BIBCODE' then
table.insert( new_list, {handler.label, bibcode( v, handler.access ) } );
elseif k == 'BIORXIV' then
table.insert( new_list, {handler.label, biorxiv( v ) } );
elseif k == 'CITESEERX' then
table.insert( new_list, {handler.label, citeseerx( v ) } );
elseif k == 'DOI' then
table.insert( new_list, {handler.label, doi( v, options.DoiBroken, handler.access ) } );
elseif k == 'EISSN' then
table.insert( new_list, {handler.label, issn( v, true ) } ); -- true distinguishes eissn from issn
elseif k == 'HDL' then
table.insert( new_list, {handler.label, hdl( v, handler.access ) } );
elseif k == 'ISBN' then
local ISBN = internal_link_id( handler );
local check;
local err_type = '';
check, err_type = isbn( v );
if not check then
if is_set(options.IgnoreISBN) then -- ISBN is invalid; if |ignore-isbn-error= set
add_maint_cat ('ignore_isbn_err'); -- ad a maint category
else
ISBN = ISBN .. set_error( 'bad_isbn', {err_type}, false, " ", "" ); -- else display an error message
end
elseif is_set(options.IgnoreISBN) then -- ISBN is OK; if |ignore-isbn-error= set
add_maint_cat ('ignore_isbn_err'); -- because |ignore-isbn-error= unnecessary
end
table.insert( new_list, {handler.label, ISBN } );
elseif k == 'ISMN' then
table.insert( new_list, {handler.label, ismn( v ) } );
elseif k == 'ISSN' then
table.insert( new_list, {handler.label, issn( v ) } );
elseif k == 'JFM' then
table.insert( new_list, {handler.label, jfm( v ) } );
elseif k == 'LCCN' then
table.insert( new_list, {handler.label, lccn( v ) } );
elseif k == 'MR' then
table.insert( new_list, {handler.label, mr( v ) } );
elseif k == 'OCLC' then
table.insert( new_list, {handler.label, oclc( v ) } );
elseif k == 'OL' or k == 'OLA' then
table.insert( new_list, {handler.label, openlibrary( v, handler.access ) } );
elseif k == 'PMC' then
table.insert( new_list, {handler.label, pmc( v, options.Embargo ) } );
elseif k == 'PMID' then
table.insert( new_list, {handler.label, pmid( v ) } );
elseif k == 'SSRN' then
table.insert( new_list, {handler.label, ssrn( v ) } );
elseif k == 'USENETID' then
table.insert( new_list, {handler.label, usenet_id( v ) } );
elseif k == 'ZBL' then
table.insert( new_list, {handler.label, zbl( v ) } );
else
error( cfg.messages['unknown_manual_ID'] );
end
end
local function comp( a, b ) -- used in following table.sort()
return a[1]:lower() < b[1]:lower();
end
table.sort( new_list, comp );
for k, v in ipairs( new_list ) do
new_list[k] = v[2];
end
return new_list;
end
--[[--------------------------< E X T R A C T _ I D S >------------------------------------------------------------
Populates ID table from arguments using configuration settings. Loops through cfg.id_handlers and searches args for
any of the parameters listed in each cfg.id_handlers['...'].parameters. If found, adds the parameter and value to
the identifier list. Emits redundant error message is more than one alias exists in args
]]
local function extract_ids( args )
local id_list = {}; -- list of identifiers found in args
for k, v in pairs( cfg.id_handlers ) do -- k is uc identifier name as index to cfg.id_handlers; e.g. cfg.id_handlers['ISBN'], v is a table
v = select_one( args, v.parameters, 'redundant_parameters' ); -- v.parameters is a table of aliases for k; here we pick one from args if present
if is_set(v) then id_list[k] = v; end -- if found in args, add identifier to our list
end
return id_list;
end
--[[--------------------------< E X T R A C T _ I D _ A C C E S S _ L E V E L S >--------------------------------------
Fetches custom id access levels from arguments using configuration settings.
Parameters which have a predefined access level (e.g. arxiv) do not use this
function as they are directly rendered as free without using an additional parameter.
access-level values must match the case used in cfg.keywords_lists['id-access'] (lowercase unless there is some special reason for something else)
]]
local function extract_id_access_levels( args, id_list )
local id_accesses_list = {};
for k, v in pairs( cfg.id_handlers ) do
local access_param = v.custom_access; -- name of identifier's access-level parameter
if is_set(access_param) then
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.keywords_lists['id-access']) then -- exact match required
table.insert( z.message_tail, { set_error( 'invalid_param_val', {access_param, access_level}, true ) } );
access_level = nil; -- invalid so unset
end
if not is_set(id_list[k]) then -- identifer access-level must have a matching identifier
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {k:lower()}, true ) } ); -- param name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
end
return id_accesses_list;
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table and imported functions table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr, utilities_page_ptr)
cfg = cfg_table_ptr;
is_set = utilities_page_ptr.is_set; -- import functions from select Module:Citation/CS1/Utilities module
in_array = utilities_page_ptr.in_array;
set_error = utilities_page_ptr.set_error;
select_one = utilities_page_ptr.select_one;
add_maint_cat = utilities_page_ptr.add_maint_cat;
substitute = utilities_page_ptr.substitute;
make_wikilink = utilities_page_ptr.make_wikilink;
z = utilities_page_ptr.z; -- table of tables in Module:Citation/CS1/Utilities
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
build_id_list = build_id_list,
extract_ids = extract_ids,
extract_id_access_levels = extract_id_access_levels,
is_embargoed = is_embargoed;
set_selected_modules = set_selected_modules;
}
c8f37fef539a198c6d0c5621de3fd2ef7a455f40
Module:Citation/CS1/Utilities
828
90
179
178
2024-06-03T23:43:02Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local z = {
error_categories = {}; -- for categorizing citations that contain errors
error_ids = {};
message_tail = {};
maintenance_cats = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
properties_cats = {}; -- for categorizing citations based on certain properties, language of source for instance
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array( needle, haystack )
if needle == nil then
return false;
end
for n,v in ipairs( haystack ) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table.
]]
local function substitute( msg, args )
return args and mw.message.newRawMessage( msg, args ):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with css markup according to the state of hidden.
]]
local function error_comment( content, hidden )
return substitute( hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content );
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when bot link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an
empty string.
]=]
local function make_wikilink (link, display)
if is_set (link) then
if is_set (display) then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
else
return '';
end
end
--[[--------------------------< S E T _ E R R O R >--------------------------------------------------------------
Sets an error condition and returns the appropriate error message. The actual placement of the error message in the output is
the responsibility of the calling function.
]]
local function set_error( error_id, arguments, raw, prefix, suffix )
local error_state = cfg.error_conditions[ error_id ];
prefix = prefix or "";
suffix = suffix or "";
if error_state == nil then
error( cfg.messages['undefined_error'] ); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set( error_state.category ) then
table.insert( z.error_categories, error_state.category );
end
local message = substitute( error_state.message, arguments );
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids[ error_id ] = true;
if in_array( error_id, { 'bare_url_missing_title', 'trans_missing_title' } )
and z.error_ids['citation_missing_title'] then
return '', false;
end
message = table.concat({ prefix, message, suffix });
if raw == true then
return message, error_state.hidden;
end
return error_comment( message, error_state.hidden );
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set(args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs(error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert( error_list, alias ); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maintenance_cats using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maintenance_cats.
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maintenance_cats
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert( z.maintenance_cats, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics( str )
if not is_set(str) then
return str;
else
if str:sub(1,1) == "'" then str = "<span></span>" .. str; end
if str:sub(-1,-1) == "'" then str = str .. "<span></span>"; end
-- Remove newlines as they break italics.
return str:gsub( '\n', ' ' );
end
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set( str ) then
return "";
elseif in_array( key, { 'italic-title', 'trans-italic-title' } ) then
str = safe_for_italics( str );
end
return substitute( cfg.presentation[key], {str} );
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one( args, aliases_list, error_condition, index )
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs( aliases_list ) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); --test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
local error_str = "";
for _, k in ipairs( error_list ) do
if error_str ~= "" then error_str = error_str .. cfg.messages['parameter-separator'] end
error_str = error_str .. wrap_style ('parameter', k);
end
if #error_list > 1 then
error_str = error_str .. cfg.messages['parameter-final-separator'];
else
error_str = error_str .. cfg.messages['parameter-pair-separator'];
end
error_str = error_str .. wrap_style ('parameter', selected);
table.insert( z.message_tail, { set_error( error_condition, {error_str}, true ) } );
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims white space from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub( "%[%[([^%[%]]*)%]%]", function(l)
return l:gsub( "^[^|]*|(.*)$", "%1" ):gsub("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing white space and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wililink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
-- L = L and mw.text.trim (L, '%s|');
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ( "'''''", 1, true ) then -- bold italic (5)
argument, flag=argument:gsub("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ( "''''", 1, true ) then -- italic start and end without content (4)
argument, flag=argument:gsub("%'%'%'%'", "");
elseif argument:find ( "'''", 1, true ) then -- bold (3)
argument, flag=argument:gsub("%'%'%'", "");
elseif argument:find ( "''", 1, true ) then -- italic (2)
argument, flag=argument:gsub("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
is_set = is_set, -- exported functions
in_array = in_array,
substitute = substitute,
error_comment = error_comment,
set_error = set_error,
select_one = select_one,
add_maint_cat = add_maint_cat,
wrap_style = wrap_style,
safe_for_italics = safe_for_italics,
remove_wiki_link = remove_wiki_link,
is_wikilink = is_wikilink,
make_wikilink = make_wikilink,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
z = z, -- exported table
}
31543576ae4236d5508aadd4741c7235849f105d
Module:Citation/CS1/Whitelist
828
91
181
180
2024-06-03T23:43:02Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[--------------------------< S U P P O R T E D P A R A M E T E R S >--------------------------------------
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:
true - these parameters are valid and supported parameters
false - these parameters are deprecated but still supported
nil - these parameters are no longer supported. remove entirely
]]
local whitelist = {}
local basic_arguments = {
['accessdate'] = true,
['access-date'] = true,
['agency'] = true,
['airdate'] = true,
['air-date'] = true,
['archivedate'] = true,
['archive-date'] = true,
['archive-format'] = true,
['archiveurl'] = true,
['archive-url'] = true,
['article'] = true,
['article-format'] = true,
['article-url'] = true,
['article-url-access'] = true,
['arxiv'] = true,
['asin'] = true,
['ASIN'] = true,
['asin-tld'] = true,
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-last'] = true,
['authorlink'] = true,
['author-link'] = true,
['authormask'] = true,
['author-mask'] = true,
['authors'] = true,
['bibcode'] = true,
['bibcode-access'] = true,
['biorxiv'] = true,
['booktitle'] = true,
['book-title'] = true,
['cartography'] = true,
['chapter'] = true,
['chapter-format'] = true,
['chapterurl'] = true,
['chapter-url'] = true,
['chapter-url-access'] = true,
['citeseerx'] = true,
['collaboration'] = true,
['conference'] = true,
['conference-format'] = true,
['conferenceurl'] = true,
['conference-url'] = true,
['contribution'] = true,
['contribution-format'] = true,
['contributionurl'] = true,
['contribution-url'] = true,
['contribution-url-access'] = true,
['contributor'] = true,
['contributor-first'] = true,
['contributor-last'] = true,
['contributor-given'] = true,
['contributor-surname'] = true,
['contributor-link'] = true,
['contributor-mask'] = true,
['credits'] = true, -- cite episode, cite serial
['date'] = true,
['degree'] = true,
['department'] = true,
['df'] = true,
['dictionary'] = true,
['displayauthors'] = true,
['display-authors'] = true,
['display-contributors'] = true,
['displayeditors'] = true,
['display-editors'] = true,
['display-interviewers'] = true,
['display-translators'] = true,
['docket'] = true,
['doi'] = true,
['DOI'] = true,
['doi-access'] = true,
['doi-broken'] = true,
['doi-broken-date'] = true,
['doi-inactive-date'] = true,
['edition'] = true,
['editor'] = true,
['editor-first'] = true,
['editor-given'] = true,
['editor-last'] = true,
['editorlink'] = true,
['editor-link'] = true,
['editormask'] = true,
['editor-mask'] = true,
['editors'] = true,
['editor-surname'] = true,
['eissn'] = true,
['EISSN'] = true,
['embargo'] = true,
['encyclopaedia'] = true,
['encyclopedia'] = true,
['entry'] = true,
['entry-format'] = true,
['entry-url'] = true,
['entry-url-access'] = true,
['episode'] = true, -- cite serial only TODO: make available to cite episode?
['episodelink'] = true, -- cite episode and cite serial
['episode-link'] = true, -- cite episode and cite serial
['eprint'] = true, -- cite arxiv and arxiv identifiers
['event'] = true,
['event-format'] = true,
['eventurl'] = true,
['event-url'] = true,
['first'] = true,
['format'] = true,
['given'] = true,
['hdl'] = true,
['HDL'] = true,
['hdl-access'] = true,
['host'] = true,
['id'] = true,
['ID'] = true,
['ignoreisbnerror'] = true,
['ignore-isbn-error'] = true,
['inset'] = true,
['institution'] = true,
['interviewer'] = true,
['interviewer-first'] = true,
['interviewer-last'] = true,
['interviewerlink'] = true,
['interviewer-link'] = true,
['interviewermask'] = true,
['interviewer-mask'] = true,
['isbn'] = true,
['ISBN'] = true,
['isbn13'] = true,
['ISBN13'] = true,
['ismn'] = true,
['ISMN'] = true,
['issn'] = true,
['ISSN'] = true,
['issue'] = true,
['jfm'] = true,
['JFM'] = true,
['journal'] = true,
['jstor'] = true,
['JSTOR'] = true,
['jstor-access'] = true,
['lang'] = true,
['language'] = true,
['last'] = true,
['lastauthoramp'] = true,
['last-author-amp'] = true,
['laydate'] = true,
['lay-date'] = true,
['laysource'] = true,
['lay-source'] = true,
['lay-format'] = true,
['layurl'] = true,
['lay-url'] = true,
['lccn'] = true,
['LCCN'] = true,
['location'] = true,
['magazine'] = true,
['mailinglist'] = true, -- cite mailing list only
['mailing-list'] = true, -- cite mailing list only
['map'] = true, -- cite map only
['map-format'] = true, -- cite map only
['mapurl'] = true, -- cite map only
['map-url'] = true, -- cite map only
['map-url-access'] = true, -- cite map only
['medium'] = true,
['message-id'] = true, -- cite newsgroup
['minutes'] = true,
['mode'] = true,
['mr'] = true,
['MR'] = true,
['name-list-format'] = true,
['network'] = true,
['newsgroup'] = true,
['newspaper'] = true,
['nocat'] = true,
['no-cat'] = true,
['nopp'] = true,
['no-pp'] = true,
['notracking'] = true,
['no-tracking'] = true,
['number'] = true,
['oclc'] = true,
['OCLC'] = true,
['ol'] = true,
['OL'] = true,
['ol-access'] = true,
['origyear'] = true,
['orig-year'] = true,
['osti'] = true,
['OSTI'] = true,
['osti-access'] = true,
['others'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['people'] = true,
['periodical'] = true,
['place'] = true,
['pmc'] = true,
['PMC'] = true,
['pmid'] = true,
['PMID'] = true,
['postscript'] = true,
['pp'] = true,
['publicationdate'] = true,
['publication-date'] = true,
['publicationplace'] = true,
['publication-place'] = true,
['publisher'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['rfc'] = true,
['RFC'] = true,
['scale'] = true,
['script-article'] = true,
['script-chapter'] = true,
['script-contribution'] = true,
['script-entry'] = true,
['script-journal'] = true,
['script-magazine'] = true,
['script-map'] = true,
['script-newspaper'] = true,
['script-periodical'] = true,
['script-section'] = true,
['script-title'] = true,
['script-website'] = true,
['script-work'] = true,
['season'] = true,
['section'] = true,
['section-format'] = true,
['sections'] = true, -- cite map only
['sectionurl'] = true,
['section-url'] = true,
['section-url-access'] = true,
['series'] = true,
['serieslink'] = true,
['series-link'] = true,
['seriesno'] = true,
['series-no'] = true,
['seriesnumber'] = true,
['series-number'] = true,
['series-separator'] = true,
['sheet'] = true, -- cite map only
['sheets'] = true, -- cite map only
['ssrn'] = true,
['SSRN'] = true,
['station'] = true,
['subject'] = true,
['subjectlink'] = true,
['subject-link'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['time'] = true,
['timecaption'] = true,
['time-caption'] = true,
['title'] = true,
['titlelink'] = true,
['title-link'] = true,
['trans-map'] = true,
['transcript'] = true,
['transcript-format'] = true,
['transcripturl'] = true,
['transcript-url'] = true,
['translator'] = true,
['translator-first'] = true,
['translator-last'] = true,
['translator-given'] = true,
['translator-surname'] = true,
['translator-link'] = true,
['translator-mask'] = true,
['trans-article'] = true,
['trans-chapter'] = true,
['trans-contribution'] = true,
['trans-entry'] = true,
['trans-journal'] = true,
['trans-magazine'] = true,
['trans-newspaper'] = true,
['trans-periodical'] = true,
['trans-section'] = true,
['trans-title'] = true,
['trans-website'] = true,
['trans-work'] = true,
['type'] = true,
['url'] = true,
['URL'] = true,
['url-access'] = true,
['url-status'] = true,
['vauthors'] = true,
['veditors'] = true,
['version'] = true,
['via'] = true,
['volume'] = true,
['website'] = true,
['work'] = true,
['year'] = true,
['zbl'] = true,
['ZBL'] = true,
}
local numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-link#'] = true,
['author#link'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author-mask#'] = true,
['author#mask'] = true,
['author#-mask'] = true,
['authormask#'] = true,
['contributor#'] = true,
['contributor-first#'] = true,
['contributor#-first'] = true,
['contributor-last#'] = true,
['contributor#-last'] = true,
['contributor-given#'] = true,
['contributor#-given'] = true,
['contributor-surname#'] = true,
['contributor#-surname'] = true,
['contributor-link#'] = true,
['contributor#-link'] = true,
['contributor-mask#'] = true,
['contributor#-mask'] = true,
['editor#'] = true,
['editor-first#'] = true,
['editor#-first'] = true,
['editor#-given'] = true,
['editor-given#'] = true,
['editor-last#'] = true,
['editor#-last'] = true,
['editor-link#'] = true,
['editor#link'] = true,
['editor#-link'] = true,
['editorlink#'] = true,
['editor-mask#'] = true,
['editor#mask'] = true,
['editor#-mask'] = true,
['editormask#'] = true,
['editor#-surname'] = true,
['editor-surname#'] = true,
['first#'] = true,
['given#'] = true,
['host#'] = true,
['interviewer#'] = true,
['interviewer-first#'] = true,
['interviewer#-first'] = true,
['interviewer-last#'] = true,
['interviewer#-last'] = true,
['interviewer-link#'] = true,
['interviewer#-link'] = true,
['interviewer-mask#'] = true,
['interviewer#-mask'] = true,
['last#'] = true,
['subject#'] = true,
['subject-link#'] = true,
['subject#link'] = true,
['subject#-link'] = true,
['subjectlink#'] = true,
['surname#'] = true,
['translator#'] = true,
['translator-first#'] = true,
['translator#-first'] = true,
['translator-last#'] = true,
['translator#-last'] = true,
['translator-given#'] = true,
['translator#-given'] = true,
['translator-surname#'] = true,
['translator#-surname'] = true,
['translator-link#'] = true,
['translator#-link'] = true,
['translator-mask#'] = true,
['translator#-mask'] = true,
}
--[[--------------------------< P R E P R I N T S U P P O R T E D P A R A M E T E R S >--------------------
Cite arXiv, cite biorxiv, cite citeseerx, and cite ssrn are preprint templates that use the limited set of parameters
defined in the limited_basic_arguments and limited_numbered_arguments tables. Those lists are supplemented with a
template-specific list of parameters that are required by the particular template and may be exclusive to one of the
proeprint templates. Some of these parameters may also be available to the general cs1|2 templates.
Same conventions for true/false/nil as above.
]]
--[[--------------------------< C I T E A R X I V >----------------------------------------------------------
]]
local arxiv_basic_arguments = {
['arxiv'] = true, -- cite arxiv and arxiv identifiers
['class'] = true, -- cite arxiv only
['eprint'] = true, -- cite arxiv and arxiv identifiers
}
--[[--------------------------< C I T E B I O R X I V >------------------------------------------------------
]]
local biorxiv_basic_arguments = {
['biorxiv'] = true,
}
--[[--------------------------< C I T E C I T E S E E R X >--------------------------------------------------
]]
local citeseerx_basic_arguments = {
['citeseerx'] = true,
}
--[[--------------------------< C I T E S S R N >------------------------------------------------------------
]]
local ssrn_basic_arguments = {
['ssrn'] = true,
['SSRN'] = true,
}
--[[--------------------------< L I M I T E D S U P P O R T E D P A R A M E T E R S >----------------------
This is an experiment that attempts to use validate() and a limited list of valid parameters to validate the
parameters provided in a cite arxiv, cite biorxiv, or cite citeseerx templates. These parameters are common to
all three templates
Same conventions for true/false/nil as above.
]]
local limited_basic_arguments = {
['at'] = true,
['author'] = true,
['author-first'] = true,
['author-last'] = true,
['authorlink'] = true,
['author-link'] = true,
['authormask'] = true,
['author-mask'] = true,
['authors'] = true,
['collaboration'] = true,
['date'] = true,
['df'] = true,
['displayauthors'] = true,
['display-authors'] = true,
['first'] = true,
['given'] = true,
['language'] = true,
['last'] = true,
['lastauthoramp'] = true,
['last-author-amp'] = true,
['mode'] = true,
['name-list-format'] = true,
['nocat'] = true,
['no-cat'] = true,
['notracking'] = true,
['no-tracking'] = true,
['p'] = true,
['page'] = true,
['pages'] = true,
['postscript'] = true,
['pp'] = true,
['quotation'] = true,
['quote'] = true,
['ref'] = true,
['surname'] = true,
['template-doc-demo'] = true,
['title'] = true,
['url'] = true,
['URL'] = true,
['vauthors'] = true,
['year'] = true,
}
local limited_numbered_arguments = {
['author#'] = true,
['author-first#'] = true,
['author#-first'] = true,
['author-last#'] = true,
['author#-last'] = true,
['author-link#'] = true,
['author#link'] = true,
['author#-link'] = true,
['authorlink#'] = true,
['author-mask#'] = true,
['author#mask'] = true,
['author#-mask'] = true,
['authormask#'] = true,
['first#'] = true,
['given#'] = true,
['last#'] = true,
['surname#'] = true,
}
--[[--------------------------< E X P O R T E D T A B L E S >------------------------------------------------
]]
return {
basic_arguments = basic_arguments,
numbered_arguments = numbered_arguments,
limited_basic_arguments = limited_basic_arguments,
limited_numbered_arguments = limited_numbered_arguments,
arxiv_basic_arguments = arxiv_basic_arguments,
biorxiv_basic_arguments = biorxiv_basic_arguments,
citeseerx_basic_arguments = citeseerx_basic_arguments,
ssrn_basic_arguments = ssrn_basic_arguments
};
e75739ce91241e1b4dd6525ed4358d0f20edda65
Module:Citation/CS1/styles.css
828
92
183
182
2024-06-03T23:43:03Z
Odazk9041
2
1 revision imported
text
text/plain
/*-------------------------< O V E R R I D E S >--------------------------------
cs1|2 references are wrapped in <cite>...</cite> tags. Some wikis have not
chosen to override the generic user agent italic styling as en.wiki has. This
(untested) styling should override the user agent default when cs1|2 templates
are rendered.
Similarly, some languages use different quotation punctuation so that setting
is also made available here.
*/
cite.citation {
/* Reset italic styling set by user agent (only for cs1|2 templates; the
reason for the .citation qualifier) */
font-style: inherit;
}
.citation q {
/* Straight quote marks for <q>; keep same as [[MediaWiki:Common.css]] */
quotes: '"' '"' "'" "'";
}
/* ID and URL access
Both core and Common.css have selector .mw-parser-output a[href$=".pdf"].external
for PDF pages. All TemplateStyles pages are hoisted to .mw-parser-output. We need
to have specificity equal to a[href$=".pdf"].external for locks to override PDF icon.
the .id-lock-... selectors are for use by non-citation templates like {{Catalog lookup link}}
*/
.id-lock-free a,
.citation .cs1-lock-free a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg);
background-repeat: no-repeat;
background-size: 9px;
background-position: right .1em center;
}
.id-lock-limited a,
.id-lock-registration a,
.citation .cs1-lock-limited a,
.citation .cs1-lock-registration a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg);
background-repeat: no-repeat;
background-size: 9px;
background-position: right .1em center;
}
.id-lock-subscription a,
.citation .cs1-lock-subscription a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg);
background-repeat: no-repeat;
background-size: 9px;
background-position: right .1em center;
}
.cs1-subscription,
.cs1-registration {
color: #555;
}
.cs1-subscription span,
.cs1-registration span {
border-bottom: 1px dotted;
cursor: help;
}
/* Wikisource icon
Experiment to see if it is possible/practical to add support for a wikisource
icon when |chapter= or |title= is wikilinked to a source in wikisource ala cite wikisource
*/
.cs1-ws-icon a {
background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png);
background-image: linear-gradient(transparent, transparent), url(//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg);
background-repeat: no-repeat;
background-size: 12px;
background-position: right .1em center;
}
/* Errors and maintenance */
code.cs1-code {
/* <code>...</code> style override: mediawiki's css definition is specified here:
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/69cd73811f7aadd093050dbf20ed70ef0b42a713/skins%2Fcommon%2FcommonElements.css#L199
*/
color: inherit;
background: inherit;
border: inherit; /* code editor doesn't like inherit with border?
https://www.w3.org/wiki/CSS/Properties/border
suggests that inherit is ok
the actual spec says the code editor is correct:
https://www.w3.org/TR/css-backgrounds-3/#borders
*/
padding: inherit;
}
.cs1-hidden-error {
display: none;
font-size: 100%;
}
.cs1-visible-error {
font-size: 100%;
}
.cs1-maint {
display: none;
color: #33aa33;
margin-left: 0.3em;
}
/* Small text size
Set small text size in one place. 0.95 (here) * 0.9 (from references list) is
~0.85, which is the lower bound for size for accessibility. Old styling for this
was just 0.85. We could write the rule so that when this template is inside
references/reflist, only then does it multiply by 0.95; else multiply by 0.85 */
.cs1-subscription,
.cs1-registration,
.cs1-format {
font-size: 95%;
}
/* kerning */
.cs1-kern-left,
.cs1-kern-wl-left {
padding-left: 0.2em;
}
.cs1-kern-right,
.cs1-kern-wl-right {
padding-right: 0.2em;
}
/* selflinks – avoid bold font style when cs1|2 template links to the current page */
.citation .mw-selflink {
font-weight: inherit;
}
6f79638de6f527eb5ee697056cfd51bf2ad213ae
Module:Collapsible list
828
93
185
184
2024-06-03T23:43:03Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements {{collapsible list}}
local p = {}
local function gettitlestyletracking( ts )
if not ts then return '' end
ts = mw.ustring.gsub(mw.ustring.lower(ts), '%s', '')
local tsvals = mw.text.split(ts, ';')
table.sort(tsvals)
local skey = table.concat(tsvals,';')
skey = mw.ustring.gsub(skey, '^;', '')
skey = mw.text.encode(mw.text.encode(skey),'%c%[%]=')
if (mw.ustring.match(';' .. ts, ';background:') or mw.ustring.match(';' .. ts, ';background%-color:'))
and mw.ustring.match(';' .. ts, ';text%-align:') then
return '[[Category:Pages using collapsible list with both background and text-align in titlestyle|' .. skey .. ' ]]'
end
return '[[Category:Pages using collapsible list without both background and text-align in titlestyle|' .. skey .. ' ]]'
end
local function getListItem( data )
if not type( data ) == 'string' then
return ''
end
return mw.ustring.format( '<li style="line-height: inherit; margin: 0">%s</li>', data )
end
-- Returns an array containing the keys of all positional arguments
-- that contain data (i.e. non-whitespace values).
local function getArgNums( args )
local nums = {}
for k, v in pairs( args ) do
if type( k ) == 'number' and
k >= 1 and
math.floor( k ) == k and
type( v ) == 'string' and
mw.ustring.match( v, '%S' ) then
table.insert( nums, k )
end
end
table.sort( nums )
return nums
end
-- Formats a list of classes, styles or other attributes.
local function formatAttributes( attrType, ... )
local attributes = { ... }
local nums = getArgNums( attributes )
local t = {}
for i, num in ipairs( nums ) do
table.insert( t, attributes[ num ] )
end
if #t == 0 then
return '' -- Return the blank string so concatenation will work.
end
return mw.ustring.format( ' %s="%s"', attrType, table.concat( t, ' ' ) )
end
local function buildList( args )
-- Get the list items.
local listItems = {}
local argNums = getArgNums( args )
for i, num in ipairs( argNums ) do
table.insert( listItems, getListItem( args[ num ] ) )
end
if #listItems == 0 then
return ''
end
listItems = table.concat( listItems )
-- Get class, style and title data.
local div1class = formatAttributes( 'class', 'mw-collapsible', not args.expand and 'mw-collapsed' )
local div1style = formatAttributes(
'style',
'text-align: center; font-size: 95%;',
args.frame_style,
args.framestyle
)
local div2class = '' -- no classes, just for the sake of consistency
local div2style = formatAttributes(
'style',
'line-height: 1.6em; font-weight: bold;',
'font-size: 105%;',
'text-align: left;',
args.title_style,
args.titlestyle
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', 'mw-collapsible-content', args.hlist and 'hlist' )
local ulstyle = formatAttributes(
'style',
not args.bullets and 'list-style: none none; margin-left: 0;',
args.list_style,
args.liststyle,
not ( args.list_style or args.liststyle ) and 'text-align: left;',
'font-size: 105%; margin-top: 0; margin-bottom: 0; line-height: inherit;'
)
-- Build the list.
return mw.ustring.format(
'<div%s%s>\n<div%s%s>%s</div>\n<ul%s%s>%s</ul>\n</div>',
div1class, div1style, div2class, div2style, title, ulclass, ulstyle, listItems
) .. gettitlestyletracking(args.title_style or args.titlestyle)
end
function p.main( frame )
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs( frame.args ) do
origArgs = frame.args
break
end
else
origArgs = frame
end
local args = {}
for k, v in pairs( origArgs ) do
if type( k ) == 'number' or v ~= '' then
args[ k ] = v
end
end
return buildList( args )
end
return p
67c79401452a13a78084f8a9fd57943cc8391bd8
Module:Coordinates
828
94
187
186
2024-06-03T23:43:03Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
{{#invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.
{{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.
{{#invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.
{{#invoke:Coordinates | link }} : Export the link used to reach the tools
]]
require('Module:No globals')
local math_mod = require("Module:Math")
local coordinates = {};
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = '//tools.wmflabs.org/geohack/geohack.php?pagename=' .. page_name .. '¶ms='
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(s, notes)
local l = "[[Geographic coordinate system|Coordinates]]: " .. s
local co = '<span id="coordinates">' .. l .. notes .. '</span>';
return '<span style="font-size: small;">' .. co .. '</span>';
end
--[[ Helper function, Replacement for {{coord/display/inline}} ]]
local function displayinline(s, notes)
return s .. notes
end
--[[ Helper function, used in detecting DMS formatting ]]
local function dmsTest(first, second)
if type(first) ~= 'string' or type(second) ~= 'string' then
return nil
end
local s = (first .. second):upper()
return s:find('^[NS][EW]$') or s:find('^[EW][NS]$')
end
--[[ Wrapper function to grab args, see Module:Arguments for this function's documentation. ]]
local function makeInvokeFunc(funcName)
return function (frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Coord'
})
return coordinates[funcName](args, frame)
end
end
--[[ Helper function, handle optional args. ]]
local function optionalArg(arg, supplement)
return arg and arg .. supplement or ''
end
--[[
Formats any error messages generated for display
]]
local function errorPrinter(errors)
local result = ""
for i,v in ipairs(errors) do
local errorHTML = '<strong class="error">Coordinates: ' .. v[2] .. '</strong>'
result = result .. errorHTML .. "<br />"
end
return result
end
--[[
Determine the required CSS class to display coordinates
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for
]]
local function displayDefault(default, mode)
if default == "" then
default = "dec"
end
if default == mode then
return "geo-default"
else
return "geo-nondefault"
end
end
--[[
specPrinter
Output formatter. Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
local function specPrinter(args, coordinateSpec)
local uriComponents = coordinateSpec["param"]
if uriComponents == "" then
-- RETURN error, should never be empty or nil
return "ERROR param was empty"
end
if args["name"] then
uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
end
local geodmshtml = '<span class="geo-dms" title="Maps, aerial photos, and other data for this location">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '</span>'
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
local geodeclat
if lat < 0 then
-- FIXME this breaks the pre-existing precision
geodeclat = tostring(coordinateSpec["dec-lat"]):sub(2) .. "°S"
else
geodeclat = (coordinateSpec["dec-lat"] or 0) .. "°N"
end
local long = tonumber( coordinateSpec["dec-long"] ) or 0
local geodeclong
if long < 0 then
-- FIXME does not handle unicode minus
geodeclong = tostring(coordinateSpec["dec-long"]):sub(2) .. "°W"
else
geodeclong = (coordinateSpec["dec-long"] or 0) .. "°E"
end
local geodechtml = '<span class="geo-dec" title="Maps, aerial photos, and other data for this location">'
.. geodeclat .. ' '
.. geodeclong
.. '</span>'
local geonumhtml = '<span class="geo">'
.. coordinateSpec["dec-lat"] .. '; '
.. coordinateSpec["dec-long"]
.. '</span>'
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
.. '<span class="geo-multi-punct"> / </span>'
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';
if not args["name"] then
inner = inner .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span>'
else
inner = inner .. '<span class="vcard">' .. geodechtml
.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'
.. '<span style="display:none"> (<span class="fn org">'
.. args["name"] .. '</span>)</span></span></span>'
end
return '<span class="plainlinks nourlexpansion">' ..
'[' .. coord_link .. uriComponents .. ' ' .. inner .. ']' .. '</span>'
end
--[[ Helper function, convert decimal to degrees ]]
local function convert_dec2dms_d(coordinate)
local d = math_mod._round( coordinate, 0 ) .. "°"
return d .. ""
end
--[[ Helper function, convert decimal to degrees and minutes ]]
local function convert_dec2dms_dm(coordinate)
coordinate = math_mod._round( coordinate * 60, 0 );
local m = coordinate % 60;
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m )
end
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
local function convert_dec2dms_dms(coordinate)
coordinate = math_mod._round( coordinate * 60 * 60, 0 );
local s = coordinate % 60
coordinate = math.floor( (coordinate - s) / 60 );
local m = coordinate % 60
coordinate = math.floor( (coordinate - m) / 60 );
local d = coordinate % 360 .."°"
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end
--[[
Helper function, convert decimal latitude or longitude to
degrees, minutes, and seconds format based on the specified precision.
]]
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
local coord = tonumber(coordinate)
local postfix
if coord >= 0 then
postfix = firstPostfix
else
postfix = secondPostfix
end
precision = precision:lower();
if precision == "dms" then
return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
elseif precision == "dm" then
return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
elseif precision == "d" then
return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
end
end
--[[
Convert DMS format into a N or E decimal coordinate
]]
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
local degrees = tonumber(degrees_str)
local minutes = tonumber(minutes_str) or 0
local seconds = tonumber(seconds_str) or 0
local factor = 1
if direction == "S" or direction == "W" then
factor = -1
end
local precision = 0
if seconds_str then
precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
elseif minutes_str and minutes_str ~= '' then
precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
else
precision = math.max( math_mod._precision(degrees_str), 0 );
end
local decimal = factor * (degrees+(minutes+seconds/60)/60)
return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end
--[[
Checks input values to for out of range errors.
]]
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
local errors = {};
lat_d = tonumber( lat_d ) or 0;
lat_m = tonumber( lat_m ) or 0;
lat_s = tonumber( lat_s ) or 0;
long_d = tonumber( long_d ) or 0;
long_m = tonumber( long_m ) or 0;
long_s = tonumber( long_s ) or 0;
if strong then
if lat_d < 0 then
table.insert(errors, {source, "latitude degrees < 0 with hemisphere flag"})
end
if long_d < 0 then
table.insert(errors, {source, "longitude degrees < 0 with hemisphere flag"})
end
--[[
#coordinates is inconsistent about whether this is an error. If globe: is
specified, it won't error on this condition, but otherwise it will.
For not simply disable this check.
if long_d > 180 then
table.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})
end
]]
end
if lat_d > 90 then
table.insert(errors, {source, "latitude degrees > 90"})
end
if lat_d < -90 then
table.insert(errors, {source, "latitude degrees < -90"})
end
if lat_m >= 60 then
table.insert(errors, {source, "latitude minutes >= 60"})
end
if lat_m < 0 then
table.insert(errors, {source, "latitude minutes < 0"})
end
if lat_s >= 60 then
table.insert(errors, {source, "latitude seconds >= 60"})
end
if lat_s < 0 then
table.insert(errors, {source, "latitude seconds < 0"})
end
if long_d >= 360 then
table.insert(errors, {source, "longitude degrees >= 360"})
end
if long_d <= -360 then
table.insert(errors, {source, "longitude degrees <= -360"})
end
if long_m >= 60 then
table.insert(errors, {source, "longitude minutes >= 60"})
end
if long_m < 0 then
table.insert(errors, {source, "longitude minutes < 0"})
end
if long_s >= 60 then
table.insert(errors, {source, "longitude seconds >= 60"})
end
if long_s < 0 then
table.insert(errors, {source, "longitude seconds < 0"})
end
return errors;
end
--[[
parseDec
Transforms decimal format latitude and longitude into the
structure to be used in displaying coordinates
]]
local function parseDec( lat, long, format )
local coordinateSpec = {}
local errors = {}
if not long then
return nil, {{"parseDec", "Missing longitude"}}
elseif not tonumber(long) then
return nil, {{"parseDec", "Longitude could not be parsed as a number: " .. long}}
end
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );
coordinateSpec["dec-lat"] = lat;
coordinateSpec["dec-long"] = long;
local mode = coordinates.determineMode( lat, long );
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dec"
end
return coordinateSpec, errors
end
--[[
parseDMS
Transforms degrees, minutes, seconds format latitude and longitude
into the a structure to be used in displaying coordinates
]]
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
local coordinateSpec, errors, backward = {}, {}
lat_f = lat_f:upper();
long_f = long_f:upper();
-- Check if specified backward
if lat_f == 'E' or lat_f == 'W' then
lat_d, long_d, lat_m, long_m, lat_s, long_s, lat_f, long_f, backward = long_d, lat_d, long_m, lat_m, long_s, lat_s, long_f, lat_f, true;
end
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
if not long_d then
return nil, {{"parseDMS", "Missing longitude" }}
elseif not tonumber(long_d) then
return nil, {{"parseDMS", "Longitude could not be parsed as a number:" .. long_d }}
end
if not lat_m and not lat_s and not long_m and not long_s and #errors == 0 then
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
if lat_f:upper() == 'S' then
lat_d = '-' .. lat_d;
end
if long_f:upper() == 'W' then
long_d = '-' .. long_d;
end
return parseDec( lat_d, long_d, format );
end
end
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}
if format then
coordinateSpec.default = format
else
coordinateSpec.default = "dms"
end
return coordinateSpec, errors, backward
end
--[[
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
local function formatTest(args)
local result, errors
local backward, primary = false, false
local function getParam(args, lim)
local ret = {}
for i = 1, lim do
ret[i] = args[i] or ''
end
return table.concat(ret, '_')
end
if not args[1] then
-- no lat logic
return errorPrinter( {{"formatTest", "Missing latitude"}} )
elseif not tonumber(args[1]) then
-- bad lat logic
return errorPrinter( {{"formatTest", "Unable to parse latitude as a number:" .. args[1]}} )
elseif not args[4] and not args[5] and not args[6] then
-- dec logic
result, errors = parseDec(args[1], args[2], args.format)
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
result, errors, backward = parseDMS(args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args.format)
if args[10] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 9)
elseif dmsTest(args[3], args[6]) then
-- dm logic
result, errors, backward = parseDMS(args[1], args[2], nil, args[3],
args[4], args[5], nil, args[6], args['format'])
if args[8] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 7)
elseif dmsTest(args[2], args[4]) then
-- d logic
result, errors, backward = parseDMS(args[1], nil, nil, args[2],
args[3], nil, nil, args[4], args.format)
if args[6] then
table.insert(errors, {'formatTest', 'Extra unexpected parameters'})
end
if not result then
return errorPrinter(errors)
end
result.param = getParam(args, 5)
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}})
end
result.name = args.name
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
for _, v in ipairs(extra_param) do
if args[v] then
table.insert(errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' })
end
end
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'
end
return ret, backward
end
--[[
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories()
local ret
if mw.wikibase and current_page.namespace == 0 then
local entity = mw.wikibase.getEntityObject()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1] then
local snaktype = entity.claims.P625[1].mainsnak.snaktype
if snaktype == 'value' then
-- coordinates exist both here and on Wikidata, and can be compared.
ret = 'Coordinates on Wikidata'
elseif snaktype == 'somevalue' then
ret = 'Coordinates on Wikidata set to unknown value'
elseif snaktype == 'novalue' then
ret = 'Coordinates on Wikidata set to no value'
end
else
-- We have to either import the coordinates to Wikidata or remove them here.
ret = 'Coordinates not on Wikidata'
end
end
if ret then
return string.format('[[Category:%s]]', ret)
else
return ''
end
end
--[[
link
Simple function to export the coordinates link for other uses.
Usage:
{{#invoke:Coordinates | link }}
]]
function coordinates.link(frame)
return coord_link;
end
--[[
dec2dms
Wrapper to allow templates to call dec2dms directly.
Usage:
{{#invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix |
negative_suffix | precision }}
decimal_coordinate is converted to DMS format. If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended. The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
coordinates.dec2dms = makeInvokeFunc('_dec2dms')
function coordinates._dec2dms(args)
local coordinate = args[1]
local firstPostfix = args[2] or ''
local secondPostfix = args[3] or ''
local precision = args[4] or ''
return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end
--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
if precision <= 0 then
return 'd'
elseif precision <= 2 then
return 'dm';
else
return 'dms';
end
end
--[[
dms2dec
Wrapper to allow templates to call dms2dec directly.
Usage:
{{#invoke:Coordinates | dms2dec | direction_flag | degrees |
minutes | seconds }}
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is
positive (i.e. N and E) or negative (i.e. S and W).
]]
coordinates.dms2dec = makeInvokeFunc('_dms2dec')
function coordinates._dms2dec(args)
local direction = args[1]
local degrees = args[2]
local minutes = args[3]
local seconds = args[4]
return convert_dms2dec(direction, degrees, minutes, seconds)
end
--[[
coord
Main entry point for Lua function to replace {{coord}}
Usage:
{{#invoke:Coordinates | coord }}
{{#invoke:Coordinates | coord | lat | long }}
{{#invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
...
Refer to {{coord}} documentation page for many additional parameters and
configuration options.
Note: This function provides the visual display elements of {{coord}}. In
order to load coordinates into the database, the {{#coordinates:}} parser
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
coordinates.coord = makeInvokeFunc('_coord')
function coordinates._coord(args)
if (not args[1] or not tonumber(args[1])) and not args[2] and mw.wikibase.getEntityObject() then
args[3] = args[1]; args[1] = nil
local entity = mw.wikibase.getEntityObject()
if entity
and entity.claims
and entity.claims.P625
and entity.claims.P625[1].mainsnak.snaktype == 'value'
then
local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision
args[1]=entity.claims.P625[1].mainsnak.datavalue.value.latitude
args[2]=entity.claims.P625[1].mainsnak.datavalue.value.longitude
if precision then
precision=-math_mod._round(math.log(precision)/math.log(10),0)
args[1]=math_mod._round(args[1],precision)
args[2]=math_mod._round(args[2],precision)
end
end
end
local contents, backward = formatTest(args)
local Notes = args.notes or ''
local Display = args.display and args.display:lower() or 'inline'
local function isInline(s)
-- Finds whether coordinates are displayed inline.
return s:find('inline') ~= nil or s == 'i' or s == 'it' or s == 'ti'
end
local function isInTitle(s)
-- Finds whether coordinates are displayed in the title.
return s:find('title') ~= nil or s == 't' or s == 'it' or s == 'ti'
end
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
end
local text = ''
if isInline(Display) then
text = text .. displayinline(contents, Notes)
end
if isInTitle(Display) then
text = text
.. displaytitle(contents, Notes)
.. makeWikidataCategories()
end
if not args.nosave then
local page_title, count = mw.title.getCurrentTitle(), 1
if backward then
local tmp = {}
while not string.find((args[count-1] or ''), '[EW]') do tmp[count] = (args[count] or ''); count = count+1 end
tmp.count = count; count = 2*(count-1)
while count >= tmp.count do table.insert(tmp, 1, (args[count] or '')); count = count-1 end
for i, v in ipairs(tmp) do args[i] = v end
else
while count <= 9 do args[count] = (args[count] or ''); count = count+1 end
end
if isInTitle(Display) and not page_title.isTalkPage and page_title.subpageText ~= 'doc' and page_title.subpageText ~= 'testcases' then args[10] = 'primary' end
args.notes, args.format, args.display = nil
text = text .. coord_wrapper(args)
end
return text
end
--[[
coord2text
Extracts a single value from a transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coord2text | {{Coord}} | parameter }}
Valid values for the second parameter are: lat (signed integer), long (signed integer), type, scale, dim, region, globe, source
]]
function coordinates.coord2text(frame)
if frame.args[1] == '' or frame.args[2] == '' or not frame.args[2] then return nil end
frame.args[2] = mw.text.trim(frame.args[2])
if frame.args[2] == 'lat' or frame.args[2] == 'long' then
local result, negative = mw.text.split((mw.ustring.match(frame.args[1],'[%.%d]+°[NS] [%.%d]+°[EW]') or ''), ' ')
if frame.args[2] == 'lat' then
result, negative = result[1], 'S'
else
result, negative = result[2], 'W'
end
result = mw.text.split(result, '°')
if result[2] == negative then result[1] = '-'..result[1] end
return result[1]
else
return mw.ustring.match(frame.args[1], 'params=.-_'..frame.args[2]..':(.-)[ _]')
end
end
--[[
coordinsert
Injects some text into the Geohack link of a transclusion of {{Coord}} (if that text isn't already in the transclusion). Outputs the modified transclusion of {{Coord}}.
IF THE GEOHACK LINK SYNTAX CHANGES THIS FUNCTION MUST BE MODIFIED.
Usage:
{{#invoke:Coordinates | coordinsert | {{Coord}} | parameter:value | parameter:value | … }}
Do not make Geohack unhappy by inserting something which isn't mentioned in the {{Coord}} documentation.
]]
function coordinates.coordinsert(frame)
for i, v in ipairs(frame.args) do
if i ~= 1 then
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
end
end
if frame.args.name then
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3')
frame.args[1] = mw.ustring.gsub(frame.args[1], '(¶ms=[^&"<>%[%] ]*) ', '%1&title=' .. mw.uri.encode(namestr) .. ' ')
end
end
return frame.args[1]
end
return coordinates
1c162f7517e37472db591bc25a076d91cbb416f3
Module:Country extract
828
95
189
188
2024-06-03T23:43:04Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
--
-- to enable us to replicate the current functioning of CountryAbbr and CountryAbbr2
-- We need to deal with
-- 1 alternative names ISO 3166 should do that
-- 2 {{<name>}}
-- 3 [ [<name>] ]
-- 4 [ [<name>|<junk>] ]
-- 5 [ [image:flag of <country>.[svg|gif|png|jpg]|\d+px] ]
--
function p.extractCountry(frame)
local string= mw.ustring.toNFC (frame.args[1])
local match=nil;
match = mw.ustring.match(string, "Flag of ([^\.]*)")
if (match) then
return match
end
-- () for Cocos (Keeling) Islands
-- ' For People's
-- . for U.S. etc.
match = mw.ustring.match(string, "(%u[%a\(\)\.' -]+)")
if (match == "Image") then
string = mw.ustring.gsub(string, match, "")
match = mw.ustring.match(string, "[\|\[](%u[%a\(\)\.' -]+)")
end
if (match == "20px") then
string = mw.ustring.gsub(string, match, "")
match = mw.ustring.match(string, "\[(%u[%a\(\)\.' -]+)")
end
if (match) then
return match
end
return string
end
--[[
]]
function p.extractSubdivision(frame)
local string= mw.ustring.toNFC (frame.args[1])
local match=nil;
-- Needed for {{flag|Greenland}},
match = mw.ustring.match(string, "Flag of ([^\.]*)")
if (match) then
return match
end
-- . needed for Washington D.C.
-- ' for cote d'azur
-- leading ' for 'Aden
-- ‘ and trailing ' for Şan‘ā'
match = mw.ustring.match(string, "('?[%u][%a'‘ \.\,-]+[%a\.'\d]+)")
if (match) then
return match
end
return string
end
local countries = {
["Andorra"] = "AD",
["United Arab Emirates"] = "AE",
["UAE"] = "AE",
["Afghanistan"] = "AF",
["Antigua and Barbuda"] = "AG",
["Anguilla"] = "AI",
["Albania"] = "AL",
["Armenia"] = "AM",
["Angola"] = "AO",
["Antarctica"] = "AQ",
["Argentina"] = "AR",
["American Samoa"] = "AS",
["Austria"] = "AT",
["Australia"] = "AU",
["Aruba"] = "AW",
["Åland Islands"] = "AX",
["Aland Islands"] = "AX",
["Azerbaijan"] = "AZ",
["Nagorno-Karabakh"] = "AZ", -- disputed
["Nagorno-Karabakh Republic"] = "AZ", -- disputed
["Bosnia and Herzegovina"] = "BA",
["Bosnia"] = "BA",
["Barbados"] = "BB",
["Bangladesh"] = "BD",
["Belgium"] = "BE",
["Burkina Faso"] = "BF",
["Bulgaria"] = "BG",
["Bahrain"] = "BH",
["Burundi"] = "BI",
["Benin"] = "BJ",
["Saint Barthélemy"] = "BL",
["Saint Barthelemy"] = "BL",
["St. Barthélemy"] = "BL",
["St. Barthelemy"] = "BL",
["St Barthélemy"] = "BL",
["St Barthelemy"] = "BL",
["Bermuda"] = "BM",
["Brunei"] = "BN",
["Brunei Darussalam"] = "BN",
["Bolivia"] = "BO",
["Bolivia, Plurinational State of"] = "BO",
["Bonaire, Sint Eustatius and Saba"] = "BQ",
["Brazil"] = "BR",
["Bahamas"] = "BS",
["The Bahamas"] = "BS",
["the Bahamas"] = "BS",
["Bhutan"] = "BT",
["Bouvet Island"] = "BV",
["Botswana"] = "BW",
["Belarus"] = "BY",
["Belize"] = "BZ",
["Canada"] = "CA",
["Cocos (Keeling) Islands"] = "CC",
["Cocos Islands"] = "CC",
["Keeling Islands"] = "CC",
["Congo, the Democratic Republic of the"] = "CD",
["Democratic Republic of the Congo"] = "CD",
["DR Congo"] = "CD",
["Congo-Kinshasa"] = "CD",
["DROC"] = "CD",
["DRC"] = "CD",
["Central African Republic"] = "CF",
["CAR"] = "CF",
["Congo"] = "CG",
["Republic of the Congo"] = "CG",
["Congo Republic"] = "CG",
["Congo-Brazzaville"] = "CG",
["West Congo"] = "CG",
["Switzerland"] = "CH",
["Côte d'Ivoire"] = "CI",
["Ivory Coast"] = "CI",
["Cook Islands"] = "CK",
["Chile"] = "CL",
["Cameroon"] = "CM",
["China"] = "CN",
["PRC"] = "CN",
["People's Republic of China"] = "CN",
["Colombia"] = "CO",
["Costa Rica"] = "CR",
["Cuba"] = "CU",
["Cape Verde"] = "CV",
["Curaçao"] = "CW",
["Curacao"] = "CW",
["Christmas Island"] = "CX",
["Cyprus"] = "CY",
["Republic of Cyprus"] = "CY",
["Northern Cyprus"] = "CY", -- disputed
["Turkish Republic of Northern Cyprus"] = "CY", -- disputed
["Czech Republic"] = "CZ",
["Germany"] = "DE",
["Djibouti"] = "DJ",
["Denmark"] = "DK",
["Dominica"] = "DM",
["Dominican Republic"] = "DO",
["Algeria"] = "DZ",
["Ecuador"] = "EC",
["Estonia"] = "EE",
["Egypt"] = "EG",
["Western Sahara"] = "EH",
["Eritrea"] = "ER",
["Spain"] = "ES",
["Ethiopia"] = "ET",
["Finland"] = "FI",
["Fiji"] = "FJ",
["Falkland Islands (Malvinas)"] = "FK",
["Falklands"] = "FK",
["Falkland Islands"] = "FK",
["Malvinas"] = "FK",
["Malvinas Islands"] = "FK",
["Micronesia, Federated States of"] = "FM",
["Micronesia"] = "FM",
["Faroe Islands"] = "FO",
["France"] = "FR",
["Gabon"] = "GA",
["United Kingdom"] = "GB",
["the United Kingdom"] = "GB",
["U. K."] = "GB",
["U.K."] = "GB",
["the U.K."] = "GB",
["UK"] = "GB",
["the UK"] = "GB",
["Great Britain"] = "GB",
["England"] = "GB-ENG",
["Scotland"] = "GB-SCT",
["Wales"] = "GB-WLS",
["Northern Ireland"] = "GB-NIR",
["England and Wales"] = "GB-EAW",
["Grenada"] = "GD",
["Georgia"] = "GE",
["South Ossetia"] = "GE", -- disputed
["Tskhinvali Region"] = "GE", -- disputed
["Abkhazia"] = "GE-AB", -- disputed
["Republic of Abkhazia"] = "GE-AB", -- disputed
["French Guiana"] = "GF",
["Guernsey"] = "GG",
["Ghana"] = "GH",
["Gibraltar"] = "GI",
["Greenland"] = "GL",
["Gambia"] = "GM",
["Guinea"] = "GN",
["Guadeloupe"] = "GP",
["Equatorial Guinea"] = "GQ",
["Greece"] = "GR",
["South Georgia and the South Sandwich Islands"] = "GS",
["Guatemala"] = "GT",
["Guam"] = "GU",
["Guinea-Bissau"] = "GW",
["Guyana"] = "GY",
["Hong Kong"] = "HK",
["Heard Island and McDonald Islands"] = "HM",
["Heard and McDonald Islands"] = "HM",
["Honduras"] = "HN",
["Croatia"] = "HR",
["Haiti"] = "HT",
["Hungary"] = "HU",
["Indonesia"] = "ID",
["Ireland"] = "IE",
["Israel"] = "IL",
["Isle of Man"] = "IM",
["India"] = "IN",
["British Indian Ocean Territory"] = "IO",
["Iraq"] = "IQ",
["Iran, Islamic Republic of"] = "IR",
["Iran"] = "IR",
["Iceland"] = "IS",
["Italy"] = "IT",
["Jersey"] = "JE",
["Jamaica"] = "JM",
["Jordan"] = "JO",
["Japan"] = "JP",
["Kenya"] = "KE",
["Kyrgyzstan"] = "KG",
["Cambodia"] = "KH",
["Kiribati"] = "KI",
["Comoros"] = "KM",
["The Comoros"] = "KM",
["the Comoros"] = "KM",
["Saint Kitts and Nevis"] = "KN",
["St. Kitts and Nevis"] = "KN",
["St Kitts and Nevis"] = "KN",
["Korea, Democratic People's Republic of"] = "KP",
["Democratic People's Republic of Korea"] = "KP",
["North Korea"] = "KP",
["Korea, Republic of"] = "KR",
["Republic of Korea"] = "KR",
["South Korea"] = "KR",
["Kuwait"] = "KW",
["Cayman Islands"] = "KY",
["The Cayman Islands"] = "KY",
["the Cayman Islands"] = "KY",
["Kazakhstan"] = "KZ",
["Lao People's Democratic Republic"] = "LA",
["Laos"] = "LA",
["Lao"] = "LA",
["Lebanon"] = "LB",
["Saint Lucia"] = "LC",
["St. Lucia"] = "LC",
["St Lucia"] = "LC",
["Liechtenstein"] = "LI",
["Sri Lanka"] = "LK",
["Liberia"] = "LR",
["Lesotho"] = "LS",
["Lithuania"] = "LT",
["Luxembourg"] = "LU",
["Latvia"] = "LV",
["Libyan Arab Jamahiriya"] = "LY",
["Libya"] = "LY",
["Morocco"] = "MA",
["Monaco"] = "MC",
["Moldova, Republic of"] = "MD",
["Moldova"] = "MD",
["Transnistria"] = "MD", -- disputed
["Montenegro"] = "ME",
["Saint Martin (French part)"] = "MF",
["Saint Martin (France)"] = "MF",
["Collectivity of Saint Martin"] = "MF",
["Collectivity of St. Martin"] = "MF",
["Collectivity of St Martin"] = "MF",
["Saint-Martin"] = "MF",
["Madagascar"] = "MG",
["Marshall Islands"] = "MH",
["Macedonia"] = "MK",
["Mali"] = "ML",
["Myanmar"] = "MM",
["Burma"] = "MM",
["Mongolia"] = "MN",
["Macau"] = "MO",
["Macao"] = "MO",
["Northern Mariana Islands"] = "MP",
["Martinique"] = "MQ",
["Mauritania"] = "MR",
["Montserrat"] = "MS",
["Malta"] = "MT",
["Mauritius"] = "MU",
["Maldives"] = "MV",
["Malawi"] = "MW",
["Mexico"] = "MX",
["Malaysia"] = "MY",
["Mozambique"] = "MZ",
["Namibia"] = "NA",
["New Caledonia"] = "NC",
["Niger"] = "NE",
["Norfolk Island"] = "NF",
["Nigeria"] = "NG",
["Nicaragua"] = "NI",
["Netherlands"] = "NL",
["The Netherlands"] = "NL",
["the Netherlands"] = "NL",
["Norway"] = "NO",
["Nepal"] = "NP",
["Nauru"] = "NR",
["Niue"] = "NU",
["New Zealand"] = "NZ",
["Aotearoa"] = "NZ",
["Oman"] = "OM",
["Panama"] = "PA",
["Peru"] = "PE",
["French Polynesia"] = "PF",
["Papua New Guinea"] = "PG",
["Philippines"] = "PH",
["The Philippines"] = "PH",
["the Philippines"] = "PH",
["Pakistan"] = "PK",
["Poland"] = "PL",
["Saint Pierre and Miquelon"] = "PM",
["St. Pierre and Miquelon"] = "PM",
["St Pierre and Miquelon"] = "PM",
["Pitcairn"] = "PN",
["Puerto Rico"] = "PR",
["State of Palestine"] = "PS",
["Palestine"] = "PS",
["Portugal"] = "PT",
["Palau"] = "PW",
["Paraguay"] = "PY",
["Qatar"] = "QA",
["Réunion"] = "RE",
["Reunion"] = "RE",
["Romania"] = "RO",
["Serbia"] = "RS",
["Kosovo"] = "RS", -- disputed
["Russian Federation"] = "RU",
["Russia"] = "RU",
["Rwanda"] = "RW",
["Saudi Arabia"] = "SA",
["Solomon Islands"] = "SB",
["Seychelles"] = "SC",
["Sudan"] = "SD",
["Sweden"] = "SE",
["Singapore"] = "SG",
["Saint Helena, Ascension and Tristan da Cunha"] = "SH",
["Slovenia"] = "SI",
["Svalbard and Jan Mayen"] = "SJ",
["Slovakia"] = "SK",
["Sierra Leone"] = "SL",
["San Marino"] = "SM",
["Senegal"] = "SN",
["Somalia"] = "SO",
["Somaliland"] = "SO", -- disputed
["Suriname"] = "SR",
["South Sudan"] = "SS",
["São Tomé and Príncipe"] = "ST",
["Sao Tome and Principe"] = "ST",
["El Salvador"] = "SV",
["Sint Maarten"] = "SX",
["Saint Martin (Dutch part)"] = "SX",
["Saint Martin (Netherlands)"] = "SX",
["Syrian Arab Republic"] = "SY",
["Syria"] = "SY",
["Swaziland"] = "SZ",
["Turks and Caicos Islands"] = "TC",
["Chad"] = "TD",
["French Southern Territories"] = "TF",
["Togo"] = "TG",
["Thailand"] = "TH",
["Tajikistan"] = "TJ",
["Tokelau"] = "TK",
["Timor-Leste"] = "TL",
["East Timor"] = "TL",
["Turkmenistan"] = "TM",
["Tunisia"] = "TN",
["Tonga"] = "TO",
["Turkey"] = "TR",
["Trinidad and Tobago"] = "TT",
["Tuvalu"] = "TV",
["Taiwan"] = "TW",
["Republic of China"] = "TW",
["Tanzania, United Republic of"] = "TZ",
["Tanzania"] = "TZ",
["Ukraine"] = "UA",
["The Ukraine"] = "UA",
["the Ukraine"] = "UA",
["Uganda"] = "UG",
["United States Minor Outlying Islands"] = "UM",
["United States"] = "US",
["the United States"] = "US",
["United States of America"] = "US",
["the United States of America"] = "US",
["U. S."] = "US",
["U.S."] = "US",
["the U.S."] = "US",
["US"] = "US",
["the US"] = "US",
["Uruguay"] = "UY",
["Uzbekistan"] = "UZ",
["Holy See (Vatican City State)"] = "VA",
["Holy See"] = "VA",
["Vatican City State"] = "VA",
["Vatican City"] = "VA",
["Saint Vincent and the Grenadines"] = "VC",
["St. Vincent and the Grenadines"] = "VC",
["St Vincent and the Grenadines"] = "VC",
["Venezuela, Bolivarian Republic of"] = "VE",
["Venezuela"] = "VE",
["Virgin Islands, British"] = "VG",
["British Virgin Islands"] = "VG",
["UK Virgin Islands"] = "VG",
["Virgin Islands of the United Kingdom"] = "VG",
["Virgin Islands of the UK"] = "VG",
["Virgin Islands, U. S."] = "VI",
["Virgin Islands, U.S."] = "VI",
["Virgin Islands, US"] = "VI",
["United States Virgin Islands"] = "VI",
["American Virgin Islands"] = "VI",
["U. S. Virgin Islands"] = "VI",
["U.S. Virgin Islands"] = "VI",
["US Virgin Islands"] = "VI",
["Virgin Islands of the United States"] = "VI",
["Virgin Islands of the U.S."] = "VI",
["Virgin Islands of the US"] = "VI",
["Vietnam"] = "VN",
["Viet Nam"] = "VN",
["Vanuatu"] = "VU",
["Wallis and Futuna"] = "WF",
["Samoa"] = "WS",
["Yemen"] = "YE",
["Mayotte"] = "YT",
["South Africa"] = "ZA",
["Zambia"] = "ZM",
["Zimbabwe"] = "ZW",
["ABW"] = "AW",
["AFG"] = "AF",
["AGO"] = "AO",
["AIA"] = "AI",
["ALA"] = "AX",
["ALB"] = "AL",
["AND"] = "AD",
["ARE"] = "AE",
["ARG"] = "AR",
["ARM"] = "AM",
["ASM"] = "AS",
["ATA"] = "AQ",
["ATF"] = "TF",
["ATG"] = "AG",
["AUS"] = "AU",
["AUT"] = "AT",
["AZE"] = "AZ",
["BDI"] = "BI",
["BEL"] = "BE",
["BEN"] = "BJ",
["BFA"] = "BF",
["BGD"] = "BD",
["BGR"] = "BG",
["BHR"] = "BH",
["BHS"] = "BS",
["BIH"] = "BA",
["BLM"] = "BL",
["BLR"] = "BY",
["BLZ"] = "BZ",
["BMU"] = "BM",
["BOL"] = "BO",
["BRA"] = "BR",
["BRB"] = "BB",
["BRN"] = "BN",
["BTN"] = "BT",
["BVT"] = "BV",
["BWA"] = "BW",
["CAF"] = "CF",
["CAN"] = "CA",
["CCK"] = "CC",
["CHE"] = "CH",
["CHL"] = "CL",
["CHN"] = "CN",
["CIV"] = "CI",
["CMR"] = "CM",
["COD"] = "CG",
["COG"] = "CG",
["COK"] = "CK",
["COL"] = "CO",
["COM"] = "KM",
["CRI"] = "CR",
["CUB"] = "CU",
["CUW"] = "CW",
["CXR"] = "CX",
["CYM"] = "KY",
["CYP"] = "CY",
["CZE"] = "CZ",
["DEU"] = "DE",
["DJI"] = "DJ",
["DMA"] = "DM",
["DNK"] = "DK",
["DOM"] = "DO",
["DZA"] = "DZ",
["ECU"] = "EC",
["EGY"] = "EG",
["ERI"] = "ER",
["ESH"] = "EH",
["ESP"] = "ES",
["EST"] = "EE",
["ETH"] = "ET",
["FIN"] = "FI",
["FJI"] = "FJ",
["FLK"] = "FK",
["FRA"] = "FR",
["FRO"] = "FO",
["FSM"] = "FM",
["GAB"] = "GA",
["GBR"] = "GB",
["GEO"] = "GE",
["GGY"] = "GG",
["GHA"] = "GH",
["GIB"] = "GI",
["GIN"] = "GN",
["GLP"] = "GP",
["GMB"] = "GM",
["GNB"] = "GW",
["GNQ"] = "GQ",
["GRC"] = "GR",
["GRD"] = "GD",
["GRL"] = "GL",
["GTM"] = "GT",
["GUF"] = "GF",
["GUM"] = "GU",
["GUY"] = "GY",
["HKG"] = "HK",
["HMD"] = "HM",
["HND"] = "HN",
["HRV"] = "HR",
["HTI"] = "HT",
["HUN"] = "HU",
["IDN"] = "ID",
["IMN"] = "IM",
["IND"] = "IN",
["IOT"] = "IO",
["IRL"] = "IE",
["IRN"] = "IR",
["IRQ"] = "IQ",
["ISL"] = "IS",
["ISR"] = "IL",
["ITA"] = "IT",
["JAM"] = "JM",
["JEY"] = "JE",
["JOR"] = "JO",
["JPN"] = "JP",
["KAZ"] = "KZ",
["KEN"] = "KE",
["KGZ"] = "KG",
["KHM"] = "KH",
["KIR"] = "KI",
["KNA"] = "KN",
["KWT"] = "KW",
["LAO"] = "LA",
["LBN"] = "LB",
["LBR"] = "LR",
["LBY"] = "LY",
["LCA"] = "LC",
["LIE"] = "LI",
["LKA"] = "LK",
["LSO"] = "LS",
["LTU"] = "LT",
["LUX"] = "LU",
["LVA"] = "LV",
["MAC"] = "MO",
["MAF"] = "MF",
["MAR"] = "MA",
["MCO"] = "MC",
["MDA"] = "MD",
["MDG"] = "MG",
["MDV"] = "MV",
["MEX"] = "MX",
["MHL"] = "MH",
["MKD"] = "MK",
["MLI"] = "ML",
["MLT"] = "MT",
["MMR"] = "MM",
["MNE"] = "ME",
["MNG"] = "MN",
["MNP"] = "MP",
["MOZ"] = "MZ",
["MRT"] = "MR",
["MSR"] = "MS",
["MTQ"] = "MQ",
["MUS"] = "MU",
["MWI"] = "MW",
["MYS"] = "MY",
["MYT"] = "YT",
["NAM"] = "NA",
["NCL"] = "NC",
["NER"] = "NE",
["NFK"] = "NF",
["NGA"] = "NG",
["NIC"] = "NI",
["NIU"] = "NU",
["NLD"] = "NL",
["NOR"] = "NO",
["NPL"] = "NP",
["NRU"] = "NR",
["NZL"] = "NZ",
["OMN"] = "OM",
["PAK"] = "PK",
["PAN"] = "PA",
["PCN"] = "PN",
["PER"] = "PE",
["PHL"] = "PH",
["PLW"] = "PW",
["PNG"] = "PG",
["POL"] = "PL",
["PRI"] = "PR",
["PRT"] = "PT",
["PRY"] = "PY",
["PSE"] = "PS",
["PYF"] = "PF",
["QAT"] = "QA",
["REU"] = "RE",
["ROU"] = "RO",
["RUS"] = "RU",
["RWA"] = "RW",
["SAU"] = "SA",
["SDN"] = "SD",
["SEN"] = "SN",
["SGP"] = "SG",
["SGS"] = "GS",
["SJM"] = "SJ",
["SLB"] = "SB",
["SLE"] = "SL",
["SLV"] = "SV",
["SMR"] = "SM",
["SOM"] = "SO",
["SPM"] = "PM",
["SRB"] = "RS",
["SSD"] = "SS",
["STP"] = "ST",
["SUR"] = "SR",
["SVK"] = "SK",
["SVN"] = "SI",
["SWE"] = "SE",
["SWZ"] = "SZ",
["SXM"] = "SX",
["SYC"] = "SC",
["SYR"] = "SY",
["TCA"] = "TC",
["TCD"] = "TD",
["TGO"] = "TG",
["THA"] = "TH",
["TJK"] = "TJ",
["TKL"] = "TK",
["TKM"] = "TM",
["TLS"] = "TL",
["TON"] = "TO",
["TTO"] = "TT",
["TUN"] = "TN",
["TUR"] = "TR",
["TUV"] = "TV",
["TWN"] = "TW",
["TZA"] = "TZ",
["UGA"] = "UG",
["UKR"] = "UA",
["UMI"] = "UM",
["URY"] = "UY",
["USA"] = "US",
["UZB"] = "UZ",
["VAT"] = "VA",
["VCT"] = "VC",
["VEN"] = "VE",
["VNM"] = "VN",
["VUT"] = "VU",
["WLF"] = "WF",
["WSM"] = "WS",
["YEM"] = "YE",
["ZAF"] = "ZA",
["ZMB"] = "ZM",
["ZWE"] = "ZW"
}
function p.main(frame)
local country = mw.ustring.gsub(mw.ustring.toNFC(frame.args[1] or ''), '^%s*(.-)%s*$', '%1')
local match1 = ''
if country and country ~= '' then
match1 = mw.ustring.match(country, "Flag of the ([^\.]*)") or mw.ustring.match(country, "Flag of ([^\.]*)") or mw.ustring.match(country, "^[Tt]he %A*(%u[%a%(%)%.' %-]+)") or mw.ustring.match(country, "(%u[%a%(%)%.' %-]+)") or ""
if (match1 == "Image") or (match1 == "File") then
country = mw.ustring.gsub(country, match1, "")
match1 = mw.ustring.match(country, "[%|%[](%u[%a%(%)%.' %-]+)") or ""
end
if mw.ustring.match(match1, "^%d*x?%d+px$") then
country = mw.ustring.gsub(country, match1, "")
match1 = mw.ustring.match(country, "%[(%u[%a%(%)%.' %-]+)") or ""
end
end
local code = countries[match1] or countries[mw.ustring.gsub(match1, " %(.*%)$", "")] or countries[mw.ustring.gsub(match1, ",.*$", "")] or countries[mw.ustring.gsub(match1, " %(.*$", "")]
if not code then
if match1 ~= '' and mw.title.new('Template:ISO 3166 code ' .. match1).exists then
code = frame:expandTemplate{ title = 'Template:ISO 3166 code ' .. match1 }
else
if frame.args.nocat and frame.args.nocat == 'true' then
return ''
end
local ns = mw.title.getCurrentTitle().namespace
if ns == 0 then
return '[[Category:Wikipedia page with obscure country]]'
else
return '[[Category:Wikipedia page with obscure country|'.. frame:expandTemplate{ title = 'Namespace Greek' } ..']]'
end
end
end
local subdivision = mw.ustring.gsub(mw.ustring.toNFC(frame.args[2] or ''), '^%s*(.-)%s*$', '%1')
if not subdivision or subdivision == '' then return code end
local countrytables = {
["AD"] = true,
["AE"] = true,
["AF"] = true,
["AG"] = true,
["AL"] = true,
["AM"] = true,
["AO"] = true,
["AR"] = true,
["AT"] = true,
["AU"] = true,
["AZ"] = true,
["BA"] = true,
["BB"] = true,
["BD"] = true,
["BE"] = true,
["BF"] = true,
["BG"] = true,
["BH"] = true,
["BI"] = true,
["BJ"] = true,
["BN"] = true,
["BO"] = true,
["BQ"] = true,
["BR"] = true,
["BS"] = true,
["BT"] = true,
["BW"] = true,
["BY"] = true,
["BZ"] = true,
["CA"] = true,
["CD"] = true,
["CF"] = true,
["CG"] = true,
["CH"] = true,
["CI"] = true,
["CL"] = true,
["CM"] = true,
["CN"] = true,
["CO"] = true,
["CR"] = true,
["CU"] = true,
["CV"] = true,
["CY"] = true,
["CZ"] = true,
["DE"] = true,
["DJ"] = true,
["DK"] = true,
["DM"] = true,
["DO"] = true,
["DZ"] = true,
["EC"] = true,
["EE"] = true,
["EG"] = true,
["ER"] = true,
["ES"] = true,
["ET"] = true,
["FI"] = true,
["FJ"] = true,
["FM"] = true,
["FR"] = true,
["GA"] = true,
["GB"] = true,
["GD"] = true,
["GE"] = true,
["GH"] = true,
["GL"] = true,
["GM"] = true,
["GN"] = true,
["GQ"] = true,
["GR"] = true,
["GT"] = true,
["GW"] = true,
["GY"] = true,
["HN"] = true,
["HR"] = true,
["HT"] = true,
["HU"] = true,
["ID"] = true,
["IE"] = true,
["IL"] = true,
["IN"] = true,
["IQ"] = true,
["IR"] = true,
["IS"] = true,
["IT"] = true,
["JM"] = true,
["JO"] = true,
["JP"] = true,
["KE"] = true,
["KG"] = true,
["KH"] = true,
["KI"] = true,
["KM"] = true,
["KN"] = true,
["KP"] = true,
["KR"] = true,
["KW"] = true,
["KZ"] = true,
["LA"] = true,
["LB"] = true,
["LC"] = true,
["LI"] = true,
["LK"] = true,
["LR"] = true,
["LS"] = true,
["LT"] = true,
["LU"] = true,
["LV"] = true,
["LY"] = true,
["MA"] = true,
["MC"] = true,
["MD"] = true,
["ME"] = true,
["MG"] = true,
["MH"] = true,
["MK"] = true,
["ML"] = true,
["MM"] = true,
["MN"] = true,
["MR"] = true,
["MT"] = true,
["MU"] = true,
["MV"] = true,
["MW"] = true,
["MX"] = true,
["MY"] = true,
["MZ"] = true,
["NA"] = true,
["NE"] = true,
["NG"] = true,
["NI"] = true,
["NL"] = true,
["NO"] = true,
["NP"] = true,
["NR"] = true,
["NZ"] = true,
["OM"] = true,
["PA"] = true,
["PE"] = true,
["PG"] = true,
["PH"] = true,
["PK"] = true,
["PL"] = true,
["PS"] = true,
["PT"] = true,
["PW"] = true,
["PY"] = true,
["QA"] = true,
["RO"] = true,
["RS"] = true,
["RU"] = true,
["RW"] = true,
["SA"] = true,
["SB"] = true,
["SC"] = true,
["SD"] = true,
["SE"] = true,
["SG"] = true,
["SH"] = true,
["SI"] = true,
["SK"] = true,
["SL"] = true,
["SM"] = true,
["SN"] = true,
["SO"] = true,
["SR"] = true,
["SS"] = true,
["ST"] = true,
["SV"] = true,
["SY"] = true,
["SZ"] = true,
["TD"] = true,
["TG"] = true,
["TH"] = true,
["TJ"] = true,
["TL"] = true,
["TM"] = true,
["TN"] = true,
["TO"] = true,
["TR"] = true,
["TT"] = true,
["TV"] = true,
["TW"] = true,
["TZ"] = true,
["UA"] = true,
["UG"] = true,
["UM"] = true,
["US"] = true,
["UY"] = true,
["UZ"] = true,
["VC"] = true,
["VE"] = true,
["VN"] = true,
["VU"] = true,
["WF"] = true,
["WS"] = true,
["YE"] = true,
["ZA"] = true,
["ZM"] = true,
["ZW"] = true,
}
local match2 = mw.ustring.match(subdivision, "Flag of the ([^\.]*)") or mw.ustring.match(subdivision, "Flag of ([^\.]*)") or mw.ustring.match(subdivision, "[Tt]he %A*([ǁ'‘ʻ]?%u[%aZ̧z̄'‘‘ %.%,%-]+[%a%.'%d]+)") or mw.ustring.match(subdivision, "([ǁ'‘ʻ]?%u[%aZ̧z̄'‘‘ %.%,%-]+[%a%.'%d]+)") or ""
if (match2 == "Image") or (match2 == "File") then
subdivision = mw.ustring.gsub(subdivision, match2, "")
match2 = mw.ustring.match(subdivision, "[\|\[]([ǁ'‘ʻ]?%u[%aZ̧z̄'‘ʻ %.%,%-]+[%a%.'%d]+)") or ""
end
if mw.ustring.match(match2, "^%d*x?%d+px$") then
subdivision = mw.ustring.gsub(subdivision, match2, "")
match2 = mw.ustring.match2(subdivision, "%[([ǁ'‘ʻ]?%u[%aZ̧z̄'‘ʻ %.%,%-]+[%a%.'%d]+)") or ""
end
local code1 = mw.ustring.sub(code, 1, 2)
if countrytables[code1] then
local tmp = mw.loadData('Module:Country extract/' .. code1)
local code2 = tmp[match2] or tmp[mw.ustring.gsub(match2, " %(.*%)$", "")] or tmp[mw.ustring.gsub(match2, ",.*$", "")] or tmp[mw.ustring.gsub(match2, " %(.*$", "")]
if code2 then return code2 end
local legacytemplate = 'Template:ISO 3166 code ' .. match1
if mw.title.new(legacytemplate).exists then
tmp = nil
for k, v in ipairs({
frame:expandTemplate{ title = legacytemplate, args = { mw.ustring.gsub(match2, " %(.*%)$", "") } },
frame:expandTemplate{ title = legacytemplate, args = { mw.ustring.gsub(match2, ",.*$", "") } },
frame:expandTemplate{ title = legacytemplate, args = { mw.ustring.gsub(match2, " %(.*$", "") } },
frame:expandTemplate{ title = legacytemplate, args = { match2 } }
}) do
if v ~= code and v ~= '' then
tmp = v
break
end
end
if tmp then return tmp end
end
if frame.args.nocat and frame.args.nocat == 'true' then
return code
end
local ns = mw.title.getCurrentTitle().namespace
if ns == 0 then
return code .. '[[Category:Wikipedia page with obscure country or subdivision]]'
else
return code .. '[[Category:Wikipedia page with obscure country or subdivision|'.. frame:expandTemplate{ title = 'Namespace Greek' } ..']]'
end
end
return code
end
return p
dd859aadb5c4b0f9522d484b864286fb57fa088d
Module:Country extract/US
828
96
191
190
2024-06-03T23:43:04Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
return {
["Alaska"] = "US-AK",
["Alabama"] = "US-AL",
["Arkansas"] = "US-AR",
["American Samoa"] = "US-AS",
["Arizona"] = "US-AZ",
["California"] = "US-CA",
["Colorado"] = "US-CO",
["Connecticut"] = "US-CT",
["District of Columbia"] = "US-DC",
["Washington D.C."] = "US-DC",
["Washington DC"] = "US-DC",
["Washington, D.C."] = "US-DC",
["Washington, DC"] = "US-DC",
["Delaware"] = "US-DE",
["Florida"] = "US-FL",
["Georgia (state)"] = "US-GA",
["Georgia"] = "US-GA",
["Georgia (U.S. state)"] = "US-GA",
["Guam"] = "US-GU",
["Hawaii"] = "US-HI",
["Iowa"] = "US-IA",
["Idaho"] = "US-ID",
["Illinois"] = "US-IL",
["Indiana"] = "US-IN",
["Kansas"] = "US-KS",
["Kentucky"] = "US-KY",
["Louisiana"] = "US-LA",
["Massachusetts"] = "US-MA",
["Maryland"] = "US-MD",
["Maine"] = "US-ME",
["Michigan"] = "US-MI",
["Minnesota"] = "US-MN",
["Missouri"] = "US-MO",
["Northern Mariana Islands"] = "US-MP",
["Mississippi"] = "US-MS",
["Montana"] = "US-MT",
["North Carolina"] = "US-NC",
["North Dakota"] = "US-ND",
["Nebraska"] = "US-NE",
["New Hampshire"] = "US-NH",
["New Jersey"] = "US-NJ",
["New Mexico"] = "US-NM",
["Nevada"] = "US-NV",
["New York (state)"] = "US-NY",
["New York"] = "US-NY",
["New York state"] = "US-NY",
["Ohio"] = "US-OH",
["Oklahoma"] = "US-OK",
["Oregon"] = "US-OR",
["Pennsylvania"] = "US-PA",
["Puerto Rico"] = "US-PR",
["Rhode Island"] = "US-RI",
["South Carolina"] = "US-SC",
["South Dakota"] = "US-SD",
["Tennessee"] = "US-TN",
["Texas"] = "US-TX",
["United States Minor Outlying Islands"] = "US-UM",
["Minor Outlying Islands"] = "US-UM",
["Utah"] = "US-UT",
["Virginia"] = "US-VA",
["Virgin Islands, U.S."] = "US-VI",
["Virgin Islands"] = "US-VI",
["Virgin Islands, U. S."] = "US-VI",
["Virgin Islands, US"] = "US-VI",
["United States Virgin Islands"] = "US-VI",
["American Virgin Islands"] = "US-VI",
["U. S. Virgin Islands"] = "US-VI",
["U.S. Virgin Islands"] = "US-VI",
["US Virgin Islands"] = "US-VI",
["Virgin Islands of the United States"] = "US-VI",
["Virgin Islands of the U.S."] = "US-VI",
["Virgin Islands of the US"] = "US-VI",
["Vermont"] = "US-VT",
["Washington (state)"] = "US-WA",
["Washington"] = "US-WA",
["Washington state"] = "US-WA",
["Wisconsin"] = "US-WI",
["West Virginia"] = "US-WV",
["Wyoming"] = "US-WY",
["Johnston Atoll"] = "UM-67",
["Midway Islands"] = "UM-71",
["Midway Atoll"] = "UM-71",
["Navassa Island"] = "UM-76",
["Wake Island"] = "UM-79",
["Baker Island"] = "UM-81",
["Howland Island"] = "UM-84",
["Jarvis Island"] = "UM-86",
["Kingman Reef"] = "UM-89",
["Palmyra Atoll"] = "UM-95",
}
c6b25f04b724aec4d03f3d476a47accb02d09933
Module:Lang
828
97
193
192
2024-06-03T23:43:04Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[=[
Lua support for the {{lang}}, {{lang-xx}}, and {{transl}} templates and replacement of various supporting templates.
]=]
require('Module:No globals');
local getArgs = require ('Module:Arguments').getArgs;
local unicode = require ("Module:Unicode data"); -- for is_latin() and is_rtl()
local yesno = require ('Module:Yesno');
local lang_data = mw.loadData ('Module:Lang/data'); -- language name override and transliteration tool-tip tables
local lang_name_table = lang_data.lang_name_table; -- language codes, names, regions, scripts, suppressed scripts
local lang_table = lang_data.lang_name_table.lang;
local lang_dep_table = lang_data.lang_name_table.lang_dep;
local script_table = lang_data.lang_name_table.script;
local region_table = lang_data.lang_name_table.region;
local variant_table = lang_data.lang_name_table.variant;
local suppressed_table = lang_data.lang_name_table.suppressed;
local override_table = lang_data.override;
local synonym_table = mw.loadData ('Module:Lang/ISO 639 synonyms'); -- ISO 639-2/639-2T code translation to 639-1 code
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
local this_wiki_lang = mw.language.getContentLanguage().code; -- get this wiki's language
local initial_style_state; -- set by lang_xx_normal() and lang_xx_italic()
local maint_cats = {}; -- maintenance categories go here
local maint_msgs = {}; -- and their messages go here
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '');
end
--[[--------------------------< I N V E R T _ I T A L I C S >-------------------------------------------------
This function attempts to invert the italic markup a args.text by adding/removing leading/trailing italic markup
in args.text. Like |italic=unset, |italic=invert disables automatic italic markup. Individual leading/trailing
apostrophes are converted to their html numeric entity equivalent so that the new italic markup doesn't become
bold markup inadvertently.
Leading and trailing wiki markup is extracted from args.text into separate table elements. Addition, removal,
replacement of wiki markup is handled by a string.gsub() replacement table operating only on these separate elements.
In the string.gsub() matching pattern, '.*' matches empty string as well as the three expected wiki markup patterns.
This function expects that markup in args.text is complete and correct; if it is not, oddness may result.
]]
local function invert_italics (source)
local invert_pattern_table = { -- leading/trailing markup add/remove/replace patterns
[""]="\'\'", -- empty string becomes italic markup
["\'\'"]="", -- italic markup becomes empty string
["\'\'\'"]="\'\'\'\'\'", -- bold becomes bold italic
["\'\'\'\'\'"]="\'\'\'", -- bold italic become bold
};
local seg = {};
source = source:gsub ("%f[\']\'%f[^\']", '''); -- protect single quote marks from being interpreted as bold markup
seg[1] = source:match ('^(\'\'+%f[^\']).+') or ''; -- get leading markup, if any; ignore single quote
seg[3] = source:match ('.+(%f[\']\'\'+)$') or ''; -- get trailing markup, if any; ignore single quote
if '' ~= seg[1] and '' ~= seg[3] then -- extract the 'text'
seg[2] = source:match ('^\'\'+%f[^\'](.+)%f[\']\'\'+$') -- from between leading and trailing markup
elseif '' ~= seg[1] then
seg[2] = source:match ('^\'\'+%f[^\'](.+)') -- following leading markup
elseif '' ~= seg[3] then
seg[2] = source:match ('(.+)%f[\']\'\'+$') -- preceding trailing markup
else
seg[2] = source -- when there is no markup
end
seg[1] = invert_pattern_table[seg[1]] or seg[1]; -- replace leading markup according to pattern table
seg[3] = invert_pattern_table[seg[3]] or seg[3]; -- replace leading markup according to pattern table
return table.concat (seg); -- put it all back together and done
end
--[[--------------------------< V A L I D A T E _ I T A L I C >------------------------------------------------
validates |italic= or |italics= assigned values.
When |italic= is set and has an acceptible assigned value, return the matching css font-style property value or,
for the special case 'default', return nil.
When |italic= is not set, or has an unacceptible assigned value, return nil and a nil error message.
When both |italic= and |italics= are set, returns nil and a 'conflicting' error message.
The return value nil causes the calling lang, lang_xx, or transl function to set args.italic according to the template's
defined default ('inherit' for {{lang}}, 'inherit' or 'italic' for {{lang-xx}} depending on
the individual template's requirements, 'italic' for {{transl}}) or to the value appropriate to |script=, if set ({{lang}}
and {{lang-xx}} only).
Accepted values and the values that this function returns are are:
nil - when |italic= absent or not set; returns nil
default - for completeness, should rarely if ever be used; returns nil
yes - force args.text to be rendered in italic font; returns 'italic'
no - force args.text to be rendered in normal font; returns 'normal'
unset - disables font control so that font-style applied to text is dictated by markup inside or outside the template; returns 'inherit'
invert - disables font control so that font-style applied to text is dictated by markup outside or inverted inside the template; returns 'invert'
]]
local function validate_italic (args)
local properties = {['yes'] = 'italic', ['no'] = 'normal', ['unset'] = 'inherit', ['invert'] = 'invert', ['default'] = nil};
local count = 0
for _, arg in pairs {'italic', 'italics', 'i'} do
if args[arg] then
count = count + 1
end
end
if count > 1 then -- return nil and an error message if more than one is set
return nil, 'only one of |italic=, |italics=, or |i= can be specified';
end
return properties[args.italic or args.italics or args.i], nil; -- return an appropriate value and a nil error message
end
--[=[--------------------------< V A L I D A T E _ C A T _ A R G S >----------------------------------------------------------
Default behavior of the {{lang}} and {{lang-xx}} templates is to add categorization when the templates are used in mainspace.
This default functionality may be suppressed by setting |nocat=yes or |cat=no. This function selects one of these two parameters
to control categorization.
Because having two parameters with 'opposite' names and 'opposite' values is confusing, this function accepts only affirmative
values for |nocat= and only negative values for |cat=; in both cases the 'other' sense (and non-sense) is not accepted and the
parameter is treated as if it were not set in the template.
Sets args.nocat to true if categorization is to be turned off; to nil if the default behavior should apply.
Accepted values for |nocat= are the text strings:
'yes', 'y', 'true', 't', on, '1' -- [[Module:Yesno]] returns logical true for all of these; false or nil else
for |cat=
'no', 'n', 'false', 'f', 'off', '0' -- [[Module:Yesno]] returns logical false for all of these; true or nil else
]=]
local function validate_cat_args (args)
if not (args.nocat or args.cat) then -- both are nil, so categorize
return;
end
if false == yesno (args.cat) or true == yesno (args.nocat) then
args.nocat = true; -- set to true when args.nocat is affirmative; nil else (as if the parameter were not set in the template)
else -- args.nocat is the parameter actually used.
args.nocat = nil;
end
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array ( needle, haystack )
if needle == nil then
return false;
end
for n,v in ipairs( haystack ) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< F O R M A T _ I E T F _ T A G >------------------------------------------------
prettify ietf tags to use recommended subtag formats:
code: lower case
script: sentence case
region: upper case
variant: lower case
private: lower case prefixed with -x-
]]
local function format_ietf_tag (code, script, region, variant, private)
local out = {};
if is_set (private) then
return table.concat ({code:lower(), 'x', private:lower()}, '-'); -- if private, all other tags ignored
end
table.insert (out, code:lower());
if is_set (script) then
script = script:lower():gsub ('^%a', string.upper);
table.insert (out, script);
end
if is_set (region) then
table.insert (out, region:upper());
end
if is_set (variant) then
table.insert (out, variant:lower());
end
return table.concat (out, '-');
end
--[[--------------------------< G E T _ I E T F _ P A R T S >--------------------------------------------------
extracts and returns IETF language tag parts:
primary language subtag (required) - 2 or 3 character IANA language code
script subtag - four character IANA script code
region subtag - two-letter or three digit IANA region code
variant subtag - four digit or 5-8 alnum variant code; only one variant subtag supported
private subtag - x- followed by 1-8 alnum private code; only supported with the primary language tag
in any one of these forms
lang lang-variant
lang-script lang-script-variant
lang-region lang-region-variant
lang-script-region lang-script-region-variant
lang-x-private
each of lang, script, region, variant, and private, when used, must be valid
Languages with both two- and three-character code synonyms are promoted to the two-character synonym because
the IANA registry file omits the synonymous three-character code; we cannot depend on browsers understanding
the synonymous three-character codes in the lang= attribute.
For {{lang-xx}} templates, the parameters |script=, |region=, and |variant= are supported (not supported in {{lang}}
because those parameters are superfluous to the IETF subtags in |code=)
returns six values; all lower case. Valid parts are returned as themselves; omitted parts are returned as empty strings, invalid
parts are returned as nil; the sixth returned item is an error message (if an error detected) or nil.
see http://www.rfc-editor.org/rfc/bcp/bcp47.txt section 2.1
]]
local function get_ietf_parts (source, args_script, args_region, args_variant)
local code, script, region, variant, private; -- ietf tag parts
if not is_set (source) then
return nil, nil, nil, nil, nil, 'missing language tag';
end
local pattern = { -- table of tables holding acceptibe ietf tag patterns and short names of the ietf part captured by the pattern
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 1 - ll-Ssss-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%d%d%d%d)$', 's', 'r', 'v'}, -- 2 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 3 - ll-Ssss-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'r', 'v'}, -- 4 - ll-Ssss-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d%d)$', 's', 'v'}, -- 5 - ll-Ssss-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 's', 'v'}, -- 6 - ll-Ssss-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a)%-(%d%d%d%d)$', 'r', 'v'}, -- 7 - ll-RR-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%d%d%d)%-(%d%d%d%d)$', 'r', 'v'}, -- 8 - ll-DDD-variant (where region is 3 digits; variant is 4 digits)
{'^(%a%a%a?)%-(%a%a)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 9 - ll-RR-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d)%-(%w%w%w%w%w%w?%w?%w?)$', 'r', 'v'}, -- 10 - ll-DDD-variant (where region is 3 digits; variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%d%d%d%d)$', 'v'}, -- 11 - ll-variant (where variant is 4 digits)
{'^(%a%a%a?)%-(%w%w%w%w%w%w?%w?%w?)$', 'v'}, -- 12 - ll-variant (where variant is 5-8 alnum characters)
{'^(%a%a%a?)%-(%a%a%a%a)%-(%a%a)$', 's', 'r'}, -- 13 - ll-Ssss-RR
{'^(%a%a%a?)%-(%a%a%a%a)%-(%d%d%d)$', 's', 'r'}, -- 14 - ll-Ssss-DDD (region is 3 digits)
{'^(%a%a%a?)%-(%a%a%a%a)$', 's'}, -- 15 - ll-Ssss
{'^(%a%a%a?)%-(%a%a)$', 'r'}, -- 16 - ll-RR
{'^(%a%a%a?)%-(%d%d%d)$', 'r'}, -- 17 - ll-DDD (region is 3 digits)
{'^(%a%a%a?)$'}, -- 18 - ll
{'^(%a%a%a?)%-x%-(%w%w?%w?%w?%w?%w?%w?%w?)$', 'p'}, -- 19 - ll-x-pppppppp (private is 1-8 alnum characters)
}
local t = {}; -- table of captures; serves as a translator between captured ietf tag parts and named variables
for i, v in ipairs (pattern) do -- spin through the pattern table looking for a match
local c1, c2, c3, c4; -- captures in the 'pattern' from the pattern table go here
c1, c2, c3, c4 = source:match (pattern[i][1]); -- one or more captures set if source matches pattern[i])
if c1 then -- c1 always set on match
code = c1; -- first capture is always code
t = {
[pattern[i][2] or 'x'] = c2, -- fill the table of captures with the rest of the captures
[pattern[i][3] or 'x'] = c3, -- take index names from pattern table and assign sequential captures
[pattern[i][4] or 'x'] = c4, -- index name may be nil in pattern[i] table so "or 'x'" spoofs a name for this index in this table
};
script = t.s or ''; -- translate table contents to named variables;
region = t.r or ''; -- absent table entries are nil so set named ietf parts to empty string for concatenation
variant= t.v or '';
private = t.p or '';
break; -- and done
end
end
if not code then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language tag: ', source}); -- don't know what we got but it is malformed
end
code = code:lower(); -- ensure that we use and return lower case version of this
if not (override_table[code] or lang_table[code] or synonym_table[code] or lang_dep_table[code]) then
return nil, nil, nil, nil, nil, table.concat ({'unrecognized language code: ', code}); -- invalid language code, don't know about the others (don't care?)
end
if synonym_table[code] then -- if 639-2/639-2T code has a 639-1 synonym
table.insert (maint_cats, table.concat ({'Lang and lang-xx code promoted to ISO 639-1|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' promoted to code: ', synonym_table[code]}));
code = synonym_table[code]; -- use the synonym
end
if is_set (script) then
if is_set (args_script) then
return code, nil, nil, nil, nil, 'redundant script tag'; -- both code with script and |script= not allowed
end
else
script = args_script or ''; -- use args.script if provided
end
if is_set (script) then
script = script:lower(); -- ensure that we use and return lower case version of this
if not script_table[script] then
return code, nil, nil, nil, nil, table.concat ({'unrecognized script: ', script, ' for code: ', code}); -- language code ok, invalid script, don't know about the others (don't care?)
end
end
if suppressed_table[script] then -- ensure that code-script does not use a suppressed script
if in_array (code, suppressed_table[script]) then
return code, nil, nil, nil, nil, table.concat ({'script: ', script, ' not supported for code: ', code}); -- language code ok, script is suppressed for this code
end
end
if is_set (region) then
if is_set (args_region) then
return code, nil, nil, nil, nil, 'redundant region tag'; -- both code with region and |region= not allowed
end
else
region = args_region or ''; -- use args.region if provided
end
if is_set (region) then
region = region:lower(); -- ensure that we use and return lower case version of this
if not region_table[region] then
return code, script, nil, nil, nil, table.concat ({'unrecognized region: ', region, ' for code: ', code});
end
end
if is_set (variant) then
if is_set (args_variant) then
return code, nil, nil, nil, nil, 'redundant variant tag'; -- both code with variant and |variant= not allowed
end
else
variant = args_variant or ''; -- use args.variant if provided
end
if is_set (variant) then
variant = variant:lower(); -- ensure that we use and return lower case version of this
if not variant_table[variant] then -- make sure variant is valid
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant});
end -- does this duplicate/replace tests in lang() and lang_xx()?
if is_set (script) then -- if script set it must be part of the 'prefix'
if not in_array (table.concat ({code, '-', script}), variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-script pair: ', code, '-', script});
end
elseif is_set (region) then -- if region set, there are some prefixes that require lang code and region (en-CA-newfound)
if not in_array (code, variant_table[variant]['prefixes']) then -- first see if lang code is all that's required (en-oxendict though en-GB-oxendict is preferred)
if not in_array (table.concat ({code, '-', region}), variant_table[variant]['prefixes']) then -- now try for lang code and region (en-CA-newfound)
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code-region pair: ', code, '-', region});
end
end
else -- cheap way to determine if there are prefixes; fonipa and others don't have prefixes; # operator always returns 0
if variant_table[variant]['prefixes'][1] and not in_array (code, variant_table[variant]['prefixes']) then
return code, script, region, nil, nil, table.concat ({'unrecognized variant: ', variant, ' for code: ', code});
end
end
end
if is_set (private) then
private = private:lower(); -- ensure that we use and return lower case version of this
if not override_table[table.concat ({code, '-x-', private})] then -- make sure private tag is valid; note that index
return code, script, region, nil, nil, table.concat ({'unrecognized private tag: ', private});
end
end
return code, script, region, variant, private, nil; -- return the good bits; make sure that msg is nil
end
--[[--------------------------< M A K E _ E R R O R _ M S G >--------------------------------------------------
assembles an error message from template name, message text, help link, and error category.
]]
local function make_error_msg (msg, args, template)
local out = {};
local category;
if 'Transl' == template then
category = 'Transl';
else
category = 'Lang and lang-xx'
end
table.insert (out, table.concat ({'[', args.text or 'undefined', '] '})); -- for error messages output args.text if available
table.insert (out, table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: {{', template, '}}: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[:Category:', category, ' template errors|help]])'}));
table.insert (out, '</span>');
if (0 == namespace or 10 == namespace) and not args.nocat then -- categorize in article space (and template space to take care of broken usages)
table.insert (out, table.concat ({'[[Category:', category, ' template errors]]'}));
end
return table.concat (out);
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided, returns a wikilink in the form [[L]]; if neither are provided or link is omitted, returns an
empty string.
]=]
local function make_wikilink (link, display)
if is_set (link) then
if is_set (display) then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
else
return '';
end
end
--[[--------------------------< D I V _ M A R K U P _ A D D >--------------------------------------------------
adds <i> and </i> tags to list-item text or to implied <p>..</p> text. mixed not supported
]]
local function div_markup_add (text, style)
local implied_p = {};
if text:find ('^\n[%*:;#]') then -- look for list markup; list markup must begin at start of text
if 'italic' == style then
return mw.ustring.gsub (text, '(\n[%*:;#]+)([^\n]+)', '%1<i>%2</i>'); -- insert italic markup at each list item
else
return text;
end
end
if text:find ('\n+') then -- look for any number of \n characters in text
text = text:gsub ('([^\n])\n([^\n])', '%1 %2'); -- replace single newline characters with a space character which mimics mediawiki
if 'italic' == style then
text = text:gsub('[^\n]+', '<p><i>%1</i></p>'); -- insert p and italic markup tags at each impled p (two or more consecutive '\n\n' sequences)
else
text = text:gsub ('[^\n]+', '<p>%1</p>'); -- insert p markup at each impled p
text = text:gsub ('\n', ''); -- strip newline characters
end
end
return text;
end
--[[--------------------------< M A K E _ T E X T _ H T M L >--------------------------------------------------
Add the html markup to text according to the type of content that it is: <span> or <i> tags for inline content or
<div> tags for block content
]]
local function make_text_html (code, text, tag, rtl, style, size, language)
local html = {};
local style_added = '';
if text:match ('^%*') then
table.insert (html, '*'); -- move proto language text prefix outside of italic markup if any; use numeric entity because plain splat confuses MediaWiki
text = text:gsub ('^%*', ''); -- remove the splat from the text
end
if 'span' == tag then -- default html tag for inline content
if 'italic' == style then -- but if italic
tag = 'i'; -- change to <i> tags
end
else -- must be div so go
text = div_markup_add (text, style); -- handle implied <p>, implied <p> with <i>, and list markup (*;:#) with <i>
end
table.insert (html, table.concat ({'<', tag})); -- open the <i>, <span>, or <div> html tag
code = code:gsub ('%-x%-.*', ''); -- strip private use subtag from code tag because meaningless outside of wikipedia
table.insert (html, table.concat ({' lang="', code, '\"'})); -- add language attribute
if rtl or unicode.is_rtl(text) then
table.insert (html, ' dir="rtl"'); -- add direction attribute for right to left languages
end
if 'normal' == style then -- when |italic=no
table.insert (html, ' style=\"font-style: normal;'); -- override external markup, if any
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
if is_set (size) then -- when |size=<something>
if is_set (style_added) then
table.insert (html, table.concat ({' font-size: ', size, ';'})); -- add when style attribute already inserted
else
table.insert (html, table.concat ({' style=\"font-size: ', size, ';'})); -- create style attribute
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
end
if is_set (language) then
table.insert (html, table.concat ({style_added, ' title=\"', language})); --start the title text
if language:find ('languages') then
table.insert (html, ' collective text'); -- for collective languages
else
table.insert (html, '-language text'); -- for individual languages
end
table.insert (html, '\">'); -- close the opening html tag
else
table.insert (html, table.concat ({style_added, '>'})); -- close the style attribute and close opening html tag
end
table.insert (html, text); -- insert the text
table.insert (html, table.concat ({'</', tag, '>'})); -- close the <i>, <span>, or <div> html tag
if rtl then -- legacy; shouldn't be necessary because all of the rtl text is wrapped inside an html tag with dir="rtl" attribute
table.insert (html, '‎'); -- make sure the browser knows that we're at the end of the rtl
end
return table.concat (html); -- put it all together and done
end
--[=[-------------------------< M A K E _ C A T E G O R Y >----------------------------------------------------
For individual language, <language>, returns:
[[Category:Articles containing <language>-language text]]
for English:
[[Category:Articles containing explicitly cited English-language text]]
for ISO 639-2 collective languages (and for 639-1 bh):
[[Category:Articles with text in <language> languages]]
]=]
local function make_category (code, language_name, nocat, name_get)
local cat = {};
local retval;
if ((0 ~= namespace) or nocat) and not name_get then -- only categorize in article space
return ''; -- return empty string for concatenation
end
if language_name:find ('languages') then
return table.concat ({'[[Category:Articles with text in ', language_name, ']]'});
end
table.insert (cat, '[[Category:Articles containing ');
if 'en' == code then
table.insert (cat, 'explicitly cited ' .. language_name); -- falls back to English if regional name not available
else
table.insert (cat, language_name);
end
table.insert (cat, '-language text]]');
return table.concat (cat);
end
--[[--------------------------< M A K E _ T R A N S L I T >----------------------------------------------------
return translit <i lang=xx-Latn>...</i> where xx is the language code; else return empty string
The value |script= is not used in {{transl}} for this purpose; instead it uses |code. Because language scripts
are listed in the {{transl}} switches they are included in the data tables. The script parameter is introduced
at {{Language with name and transliteration}}. If |script= is set, this function uses it in preference to code.
To avoid confusion, in this module and the templates that use it, the transliteration script parameter is renamed
to be |translit-script= (in this function, tscript)
This function is used by both lang_xx() and transl()
lang_xx() always provides code, language_name, and translit; may provide tscript; never provides style
transl() always provides language_name, translit, and one of code or tscript, never both; always provides style
For {{transl}}, style only applies when a language code is provided
]]
local function make_translit (code, language_name, translit, std, tscript, style)
local title;
local tout = {};
local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
if is_set (code) then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
if not style then -- nil for the default italic style
table.insert (tout, "<i lang=\""); -- so use <i> tag
else
table.insert (tout, table.concat ({'<span style=\"font-style: ', style, '\" lang=\"'})); -- non-standard style, construct a span tag for it
end
table.insert (tout, code);
table.insert (tout, "-Latn\" title=\""); -- transliterations are always Latin script
else
table.insert (tout, "<span title=\""); -- when no language code: no lang= attribute, not italic ({{transl}} only)
end
std = std and std:lower(); -- lower case for table indexing
if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified
table.insert (tout, language_name); -- write a generic tool tip
if not language_name:find ('languages') then -- collective language names (plural 'languages' is part of the name)
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
table.insert (tout, ' romanization'); -- finish the tool tip; use romanization when neither script nor standard supplied
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_table[std] then -- and if standard is legitimate
if title_table[std][tscript] then -- and if script for that standard is legitimate
table.insert (tout, table.concat ({title_table[std][tscript:lower()], ' (', script_table[tscript][1], ' script) transliteration'})); -- add the appropriate text to the tool tip
else
table.insert (tout, title_table[std]['default']); -- use the default if script not in std table; TODO: maint cat? error message because script not found for this standard?
end
else
return ''; -- invalid standard, setup for error message
end
elseif is_set (std) then -- translit-script not set, use language code
if not title_table[std] then return ''; end -- invalid standard, setup for error message
if title_table[std][code] then -- if language code is in the table (transl may not provide a language code)
-- table.insert (tout, table.concat ({title_table[std][code:lower()], ' (', lang_table[code][1], ' language) transliteration'})); -- add the appropriate text to the tool tip
table.insert (tout, table.concat ({title_table[std][code:lower()], ' (', language_name, ' language) transliteration'})); -- add the appropriate text to the tool tip
else -- code doesn't match
table.insert (tout, title_table[std]['default']); -- so use the standard's default
end
else -- here if translit-script set but translit-std not set
if title_table['no_std'][tscript] then
table.insert (tout, title_table['no_std'][tscript]); -- use translit-script if set
elseif title_table['no_std'][code] then
table.insert (tout, title_table['no_std'][code]); -- use language code
else
if is_set (tscript) then
table.insert (tout, table.concat ({language_name, '-script transliteration'})); -- write a script tool tip
elseif is_set (code) then
if not language_name:find ('languages') then -- collective language names (plural 'languages' is part of the name)
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
table.insert (tout, ' transliteration'); -- finish the tool tip
else
table.insert (tout, ' transliteration'); -- generic tool tip (can we ever get here?)
end
end
end
table.insert (tout, '">');
table.insert (tout, translit);
if is_set (code) and not style then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
table.insert (tout, "</i>"); -- close the italic tag
else
table.insert (tout, "</span>"); -- no language code so close the span tag
end
return table.concat (tout);
end
--[[--------------------------< V A L I D A T E _ T E X T >----------------------------------------------------
This function checks the content of args.text and returns empty string if nothing is amiss else it returns an
error message. The tests are for empty or missing text and for improper or disallowed use of apostrophe markup.
Italic rendering is controlled by the |italic= template parameter so italic markup should never appear in args.text
either as ''itself'' or as '''''bold italic''''' unless |italic=unset or |italic=invert.
]]
local function validate_text (template, args)
if not is_set (args.text) then
return make_error_msg ('no text', args, template);
end
if args.text:find ("%f[\']\'\'\'\'%f[^\']") or args.text:find ("\'\'\'\'\'[\']+") then -- because we're looking, look for 4 appostrophes or 6+ appostrophes
return make_error_msg ('text has malformed markup', args, template);
end
local style = args.italic;
if ('unset' ~= style) and ('invert' ~=style) then
if args.text:find ("%f[\']\'\'%f[^\']") or args.text:find ("%f[\']\'\'\'\'\'%f[^\']") then -- italic but not bold, or bold italic
return make_error_msg ('text has italic markup', args, template);
end
end
end
--[[--------------------------< R E N D E R _ M A I N T >------------------------------------------------------
render mainenance messages and categories
]]
local function render_maint(nocat)
local maint = {};
if 0 < #maint_msgs then -- when there are maintenance messages
table.insert (maint, table.concat ({'<span class="lang-comment" style="font-style: normal; display: none; color: #33aa33; margin-left: 0.3em;">'})); -- opening <span> tag
for _, msg in ipairs (maint_msgs) do
table.insert (maint, table.concat ({msg, ' '})); -- add message strings
end
table.insert (maint, '</span>'); -- close the span
end
if (0 < #maint_cats) and (0 == namespace) and not nocat then -- when there are maintenance categories; article namespace only
for _, cat in ipairs (maint_cats) do
table.insert (maint, table.concat ({'[[Category:', cat, ']]'})); -- format and add the categories
end
end
return table.concat (maint);
end
--[[--------------------------< P R O T O _ P R E F I X >------------------------------------------------------
for proto languages, text is prefixed with a splat. We do that here as a flag for make_text_html() so that a splat
will be rendered outside of italic markup (if used). If the first character in text here is already a splat, we
do nothing
proto_param is boolean or nil; true adds splat prefix regardless of language name; false removes and / or inhibits
regardless of language name; nil does nothing; presumes that the value in text is correct but removes extra splac
]]
local function proto_prefix (text, language_name, proto_param)
if false == proto_param then -- when forced by |proto=no
return text:gsub ('^%**', ''); -- return text without splat prefix regardless of language name or existing splat prefix in text
elseif (language_name:find ('^Proto%-') or (true == proto_param)) then -- language is a proto or forced by |proto=yes
return text:gsub ('^%**', '*'); -- prefix proto-language text with a splat; also removes duplicate prefixing splats
end
return text:gsub ('^%*+', '*'); -- return text unmolested except multiple splats reduced to one splat
end
--[[--------------------------< H A S _ P O E M _ T A G >------------------------------------------------------
looks for a poem strip marker in text; returns true when found; false else
auto-italic detection disabled when text has poem stripmarker because it is not possible for this code to know
the content that will replace the stripmarker.
]]
local function has_poem_tag (text)
return text:find ('\127[^\127]*UNIQ%-%-poem%-[%a%d]+%-QINU[^\127]*\127') and true or false;
end
--[[--------------------------< H T M L _ T A G _ S E L E C T >------------------------------------------------
Inspects content of and selectively trims text. Returns text and the name of an appropriate html tag for text.
If text contains:
\n\n text has implied <p>..</p> tags - trim leading and trailing whitespace and return
If text begins with list markup:
\n* unordered
\n; definition
\n: definition
\n# ordered
trim all leading whitespace except \n and trim all trailing whitespace
If text contains <poem>...</poem> stripmarker, return text unmodified and choose <div>..</div> tags because
the stripmarker is replaced with text wrapped in <div>..</div> tags.
]]
local function html_tag_select (text)
local tag;
if has_poem_tag (text) then -- contains poem stripmarker (we can't know the content of that)
tag = 'div'; -- poem replacement is in div tags so lang must use div tags
elseif mw.text.trim (text):find ('\n\n+') then -- contains implied p tags
text = mw.text.trim (text); -- trim leading and trailing whitespace characters
tag = 'div'; -- must be div because span may not contain p tags (added later by MediaWiki); poem replacement is in div tags
elseif text:find ('\n[%*:;%#]') then -- if text has list markup
text = text:gsub ('^[\t\r\f ]*', ''):gsub ('%s*$', ''); -- trim all whitespace except leading newline character '\n'
tag = 'div'; -- must be div because span may not contain ul, dd, dl, ol tags (added later by MediaWiki)
else
text = mw.text.trim (text); -- plain text
tag = 'span'; -- so span is fine
end
return text, tag;
end
--[[--------------------------< V A L I D A T E _ P R O T O >--------------------------------------------------
validates value assigned to |proto=; permitted values are yes and no; yes returns as true, no returns as false,
empty string (or parameter omitted) returns as nil; any other value returns as nil with a second return value of
true indicating that some other value has been assigned to |proto=
]]
local function validate_proto (proto_param)
if 'yes' == proto_param then
return true;
elseif 'no' == proto_param then
return false;
elseif is_set (proto_param) then
return nil, true; -- |proto= something other than 'yes' or 'no'
else
return nil; -- missing or empty
end
end
--[[--------------------------< L A N G U A G E _ N A M E _ G E T >--------------------------------------------
common function to return language name from the data set according to IETF tag
returns language name if found in data tables; nil else
]]
local function language_name_get (ietf, code, cat)
ietf = ietf:lower(); -- ietf:lower() because format_ietf_tag() returns mixed case
local name; -- remains nil if not found
if override_table[ietf] then -- look for whole IETF tag in override table
name = override_table[ietf][1];
elseif override_table[code] then -- not there so try basic language code
name = override_table[code][1];
elseif lang_table[code] then -- shift to iana code/name table
name = lang_table[code][1]; -- table entries sometimes have multiple names, always take the first one
elseif lang_dep_table[code] then
-- if cat then
-- table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code}));
-- table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'}));
-- end
name = lang_dep_table[code][1]; -- table entries sometimes have multiple names, always take the first one
end
if lang_dep_table[code] and cat then -- because deprecated code may have been overridden to en.wiki preferred name
table.insert (maint_cats, table.concat ({'Lang and lang-xx using deprecated ISO 639 codes|', code}));
table.insert (maint_msgs, table.concat ({'code: ', code, ' is deprecated'}));
end
return name; -- name from data tables or nil
end
--[[--------------------------< _ L A N G >--------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function _lang (args)
local out = {};
local language_name; -- used to make category names
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, variant, and private
local code; -- the language code
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang';
validate_cat_args (args); -- determine if categorization should be suppressed
if args[1] and args.code then
return make_error_msg ('conflicting: {{{1}}} and |code=', args, template);
else
args.code = args[1] or args.code; -- prefer args.code
end
if args[2] and args.text then
return make_error_msg ('conflicting: {{{2}}} and |text=', args, template);
else
args.text = args[2] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set
if is_set (msg) then -- msg is an already-formatted error message
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code); -- |script=, |region=, |variant= not supported because they should be part of args.code ({{{1}}} in {{lang}})
if msg then
return make_error_msg ( msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- nil when |italic= absent or not set or |italic=default; args.italic controls
if ('latn' == subtags.script) or -- script is latn
(this_wiki_lang ~= code and not is_set (subtags.script) and not has_poem_tag (args.text) and unicode.is_Latin (args.text)) then -- text not this wiki's language, no script specified and not in poem markup but is wholly latn script (auto-italics)
args.italic = 'italic'; -- DEFAULT for {{lang}} templates is upright; but if latn script set for font-style:italic
else
args.italic = 'inherit'; -- italic not set; script not latn; inherit current style
end
end
if is_set (subtags.script) then -- if script set, override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
if 'invert' == args.italic and 'span' == tag then -- invert only supported for in-line content
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, language_name));
table.insert (out, make_category (code, language_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G >----------------------------------------------------------------------
entry point for {{lang}}
there should be no reason to set parameters in the {{lang}} {{#invoke:}}
<includeonly>{{#invoke:lang|lang}}</includeonly>
parameters are received from the template's frame (parent frame)
]]
local function lang (frame)
local args = getArgs (frame, { -- this code so that we can detect and handle wiki list markup in text
valueFunc = function (key, value)
if 2 == key or 'text' == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return _lang (args);
end
--[[--------------------------< L A N G _ X X >----------------------------------------------------------------
For the {{lang-xx}} templates, the only parameter required to be set in the template is the language code. All
other parameters can, usually should, be written in the template call. For {{lang-xx}} templates for languages
that can have multiple writing systems, it may be appropriate to set |script= as well.
For each {{lang-xx}} template choose the appropriate entry-point function so that this function knows the default
styling that should be applied to text.
For normal, upright style:
<includeonly>{{#invoke:lang|lang_xx_inherit|code=xx}}</includeonly>
For italic style:
<includeonly>{{#invoke:lang|lang_xx_italic|code=xx}}</includeonly>
All other parameters should be received from the template's frame (parent frame)
Supported parameters are:
|code = (required) the IANA language code
|script = IANA script code; especially for use with languages that use multiple writing systems
|region = IANA region code
|variant = IANA variant code
|text = (required) the displayed text in language specified by code
|link = boolean false ('no') does not link code-spcified language name to associated language article
|rtl = boolean true ('yes') identifies the language specified by code as a right-to-left language
|nocat = boolean true ('yes') inhibits normal categorization; error categories are not affected
|cat = boolian false ('no') opposite form of |nocat=
|italic = boolean true ('yes') renders displayed text in italic font; boolean false ('no') renders displayed text in normal font; not set renders according to initial_style_state
|lit = text that is a literal translation of text
|label = 'none' to suppress all labeling (language name, 'translit.', 'lit.')
any other text replaces language-name label - automatic wikilinking disabled
for those {{lang-xx}} templates that support transliteration (those templates where |text= is not entirely latn script):
|translit = text that is a transliteration of text
|translit-std = the standard that applies to the transliteration
|translit-script = ISO 15924 script name; falls back to code
For {{lang-xx}}, the positional parameters are:
{{{1}}} text
{{{2}}} transliterated text
{{{3}}} literal translation text
no other positional parameters are allowed
]]
local function _lang_xx (args)
local out = {};
local language_name; -- used to make display text, article links
local category_name; -- same as language_name except that it retains any parenthetical disambiguators (if any) from the data set
local subtags = {}; -- IETF subtags script, region, and variant
local code; -- the language code
local translit_script_name; -- name associated with IANA (ISO 15924) script code
local translit;
local translit_title;
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or 'Lang-xx';
if args[1] and args.text then
return make_error_msg ('conflicting: {{{1}}} and |text=', args, template);
else
args.text = args[1] or args.text; -- prefer args.text
end
msg = validate_text (template, args); -- ensure that |text= is set, does not contain italic markup and is protected from improper bolding
if is_set (msg) then
return msg;
end
args.text, tag = html_tag_select (args.text); -- inspects text; returns appropriate html tag with text trimmed accordingly
if args[2] and args.translit then
return make_error_msg ('conflicting: {{{2}}} and |translit=', args, template);
else
args.translit = args[2] or args.translit -- prefer args.translit
end
if args[3] and (args.translation or args.lit) then
return make_error_msg ('conflicting: {{{3}}} and |lit= or |translation=', args, template);
elseif args.translation and args.lit then
return make_error_msg ('conflicting: |lit= and |translation=', args, template);
else
args.translation = args[3] or args.translation or args.lit; -- prefer args.translation
end
if args.links and args.link then
return make_error_msg ('conflicting: |links= and |link=', args, template);
else
args.link = args.link or args.links; -- prefer args.link
end
validate_cat_args (args); -- determine if categorization should be suppressed
args.rtl = args.rtl == 'yes'; -- convert to boolean: 'yes' -> true, other values -> false
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (args.code, args.script, args.region, args.variant); -- private omitted because private
if msg then -- if an error detected then there is an error message
return make_error_msg (msg, args, template);
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, template);
end
if nil == args.italic then -- args.italic controls
if is_set (subtags.script) then
if 'latn' == subtags.script then
args.italic = 'italic'; -- |script=Latn; set for font-style:italic
else
args.italic = initial_style_state; -- italic not set; script is not latn; set for font-style:<initial_style_state>
end
else
args.italic = initial_style_state; -- here when |italic= and |script= not set; set for font-style:<initial_style_state>
end
end
if is_set (subtags.script) then -- if script set override rtl setting
if in_array (subtags.script, lang_data.rtl_scripts) then
args.rtl = true; -- script is an rtl script
else
args.rtl = false; -- script is not an rtl script
end
end
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid |proto=: ', args.proto}), args, template);
end
args.code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles
language_name = language_name_get (args.code, code, true); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = language_name; -- category names retain IANA parenthetical diambiguators (if any)
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if args.label then
if 'none' ~= args.label then
table.insert (out, table.concat ({args.label, ': '})); -- custom label
end
else
if 'no' == args.link then
table.insert (out, language_name); -- language name without wikilink
else
if language_name:find ('languages') then
table.insert (out, make_wikilink (language_name)); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
table.insert (out, make_wikilink (lang_data.article_name[code][1], language_name)); -- language name with wikilink from override data
else
table.insert (out, make_wikilink (language_name .. ' language', language_name)); -- language name with wikilink
end
end
table.insert (out, ': '); -- separator
end
if 'invert' == args.italic then
args.text = invert_italics (args.text)
end
args.text = proto_prefix (args.text, language_name, args.proto); -- prefix proto-language text with a splat
table.insert (out, make_text_html (args.code, args.text, tag, args.rtl, args.italic, args.size, ('none' == args.label) and language_name or nil))
if is_set (args.translit) and not unicode.is_Latin (args.text) then -- transliteration (not supported in {{lang}}); not supported when args.text is wholly latn text (this is an imperfect test)
table.insert (out, ', '); -- comma to separate text from translit
if 'none' ~= args.label then
table.insert (out, '<small>');
if script_table[args['translit-script']] then -- when |translit-script= is set, try to use the script's name
translit_script_name = script_table[args['translit-script'][1]];
else
translit_script_name = language_name; -- fall back on language name
end
translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, 'romanized') .. ':'); -- make a wikilink if there is an article to link to
else
table.insert (out, 'romanized:'); -- else plain text
end
table.insert (out, ' </small>'); -- close the small tag
end
translit = make_translit (args.code, language_name, args.translit, args['translit-std'], args['translit-script'])
if is_set (translit) then
table.insert (out, translit);
else
return make_error_msg (table.concat ({'invalid translit-std: \'', args['translit-std'] or '[missing]'}), args, template);
end
end
if is_set (args.translation) then -- translation (not supported in {{lang}})
table.insert (out, ', ');
if 'none' ~= args.label then
table.insert (out, '<small>');
if 'no' == args.link then
table.insert (out, '<abbr title="literal translation">lit.</abbr>');
else
table.insert (out, make_wikilink ('Literal translation', 'lit.'));
end
table.insert (out, " </small>");
end
table.insert (out, table.concat ({''', args.translation, '''})); -- use html entities to avoid wiki markup confusion
end
table.insert (out, make_category (code, category_name, args.nocat));
table.insert (out, render_maint(args.nocat)); -- maintenance messages and categories
return table.concat (out); -- put it all together and done
end
--[[--------------------------< L A N G _ X X _ A R G S _ G E T >----------------------------------------------
common function to get args table from {{lang-??}} templates
returns table of args
]]
local function lang_xx_args_get (frame)
local args = getArgs(frame,
{
parentFirst= true, -- parameters in the template override parameters set in the {{#invoke:}}
valueFunc = function (key, value)
if 1 == key then -- the 'text' parameter; do not trim wite space
return value; -- return untrimmed 'text'
elseif value then -- all other values: if the value is not nil
value = mw.text.trim (value); -- trim whitespace
if '' ~= value then -- empty string when value was only whitespace
return value;
end
end
return nil; -- value was empty or contained only whitespace
end -- end of valueFunc
});
return args;
end
--[[--------------------------< L A N G _ X X _ I T A L I C >--------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_italic(). Sets the initial style state to italic.
]]
local function lang_xx_italic (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I T A L I C >------------------------------------------------
Entry point ffrom another module. Sets the initial style state to italic.
]]
local function _lang_xx_italic (args)
initial_style_state = 'italic';
return _lang_xx (args);
end
--[[--------------------------< L A N G _ X X _ I N H E R I T >------------------------------------------------
Entry point for those {{lang-xx}} templates that call lang_xx_inherit(). Sets the initial style state to inherit.
]]
local function lang_xx_inherit (frame)
local args = lang_xx_args_get (frame);
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ L A N G _ X X _ I N H E R I T >----------------------------------------------
Entry point from another module. Sets the initial style state to inherit.
]]
local function _lang_xx_inherit (args)
initial_style_state = 'inherit';
return _lang_xx (args);
end
--[[--------------------------< _ I S _ I E T F _ T A G >------------------------------------------------------
Returns true when a language name associated with IETF language tag exists; nil else. IETF language tag must be valid.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _is_ietf_tag (tag) -- entry point when this module is require()d into another
local c, s, r, v, p, err; -- code, script, region, variant, private, error message
c, s, r, v, p, err = get_ietf_parts (tag); -- disassemble tag into constituent part and validate
return ((c and not err) and true) or nil; -- return true when code portion has a value without error message; nil else
end
--[[--------------------------< I S _ I E T F _ T A G >--------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_ietf_tag (frame)
return _is_ietf_tag (getArgs (frame)[1]); -- args[1] is the ietf language tag to be tested; also get parent frame
end
--[[--------------------------< I S _ I E T F _ T A G _ F R A M E >--------------------------------------------
Module entry point from an {{#invoke:}}; same as is_ietf_tag() except does not get parameters from the parent
(template) frame. This function not useful when called by {{lang|fn=is_ietf_tag_frame|<tag>}} because <tag>
is in the parent frame.
]]
local function is_ietf_tag_frame (frame)
return _is_ietf_tag (getArgs (frame, {frameOnly = true,})[1]); -- args[1] is the ietf language tag to be tested; do not get parent frame
end
--[[--------------------------< _ N A M E _ F R O M _ T A G >--------------------------------------------------
Returns language name associated with IETF language tag if valid; error message else.
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Set invoke's |link= parameter to yes to get wikilinked version of the language name.
Module entry point from another module
]]
local function _name_from_tag (args)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args['link']; -- make a boolean
local label = args.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local language_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
language_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
language_name = language_name:gsub ('%s+%b()', ''); -- remove IANA parenthetical disambiguators or qualifiers from names that have them
if link then -- when |link=yes, wikilink the language name
if language_name:find ('languages') then
language_name = make_wikilink (language_name, label); -- collective language name uses simple wikilink
elseif lang_data.article_name[code] then
language_name = make_wikilink (lang_data.article_name[code][1], label or language_name); -- language name with wikilink from override data
else
language_name = make_wikilink (language_name .. ' language', label or language_name); -- language name with wikilink
end
end
return language_name;
end
--[[--------------------------< N A M E _ F R O M _ T A G >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function name_from_tag (frame) -- entry point from an {{#invoke:Lang|name_from_tag|<ietf tag>|link=<yes>|template=<template name>}}
return _name_from_tag (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< _ T A G _ F R O M _ N A M E >--------------------------------------------------
Returns the ietf language tag associated with the language name. Spelling of language name must be correct
according to the spelling in the source tables. When a standard language name has a parenthetical disambiguator,
that disambiguator must be omitted (they are not present in the data name-to-tag tables).
Module entry point from another module
]]
local function _tag_from_name (args) -- entry point from another module
local msg;
if args[1] and '' ~= args[1] then
local data = mw.loadData ('Module:Lang/tag from name'); -- get the reversed data tables TODO: change when going live
local lang = args[1]:lower(); -- allow any-case for the language name (speeling must till be correct)
local tag = data.rev_override_table[lang] or data.rev_lang_table[lang] or data.rev_lang_dep_table[lang]; -- get the code; look first in the override then in the standard
if tag then
return tag, true; -- language name found so return tag and done; second return used by is_lang_name()
else
msg = 'language: ' .. args[1] .. ' not found' -- language name not found, error message
end
else
msg = 'missing language name' -- language name not provided, error message
end
local template = '';
if args.template and '' ~= args.template then
template = table.concat ({'{{', args['template'], '}}: '}); -- make template name (if provided by the template)
end
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: ', template, msg, '</span>'});
end
--[[--------------------------< T A G _ F R O M _ N A M E >----------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function tag_from_name (frame) -- entry point from an {{#invoke:Lang|tag_from_name|<language name>|link=<yes>|template=<template name>}}
local result, _ = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by is_lang_name()
return result;
end
--[[--------------------------< I S _ L A N G _ N A M E >------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function is_lang_name (frame)
local _, result = _tag_from_name (getArgs(frame)) -- pass-on the args table, nothing else; getArgs() so we also get parent frame; supress second return used by tag_from_name()
return result and true or nil;
end
--[[--------------------------< _ T R A N S L >----------------------------------------------------------------
Module entry point from another module
]]
local function _transl (args)
local title_table = lang_data.translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
local language_name; -- language name that matches language code; used for tool tip
local translit; -- transliterated text to display
local script; -- IANA script
local msg; -- for when called functions return an error message
if is_set (args[3]) then -- [3] set when {{transl|code|standard|text}}
args.text = args[3]; -- get the transliterated text
args.translit_std = args[2] and args[2]:lower(); -- get the standard; lower case for table indexing
if not title_table[args.translit_std] then
return make_error_msg (table.concat ({'unrecognized transliteration standard: ', args.translit_std}), args, 'Transl');
end
else
if is_set (args[2]) then -- [2] set when {{transl|code|text}}
args.text = args[2]; -- get the transliterated text
else
if args[1] and args[1]:match ('^%a%a%a?%a?$') then -- args[2] missing; is args[1] a code or its it the transliterated text?
return make_error_msg ('no text', args, 'Transl'); -- args[1] is a code so we're missing text
else
args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message
return make_error_msg ('missing language / script code', args, 'Transl');
end
end
end
if is_set (args[1]) then -- IANA language code used for html lang= attribute; or ISO 15924 script code
if args[1]:match ('^%a%a%a?%a?$') then -- args[1] has correct form?
args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters); lower case because table indexes are lower case
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args[1]}), args, 'Transl'); -- invalid language / script code
end
else
return make_error_msg ('missing language / script code', args, 'Transl'); -- missing language / script code so quit
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, 'Transl');
end
if 'italic' == args.italic then -- 'italic' when |italic=yes; because that is same as absent or not set and |italic=default
args.italic = nil; -- set to nil;
end
if override_table[args.code] then -- is code a language code defined in the override table?
language_name = override_table[args.code][1];
elseif lang_table[args.code] then -- is code a language code defined in the standard language code tables?
language_name = lang_table[args.code][1];
elseif lang_dep_table[args.code] then -- is code a language code defined in the deprecated language code tables?
language_name = lang_dep_table[args.code][1];
elseif script_table[args.code] then -- if here, code is not a language code; is it a script code?
language_name = script_table[args.code][1];
script = args.code; -- code was an ISO 15924 script so use that instead
args.code = ''; -- unset because not a language code
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args.code}), args, 'Transl'); -- invalid language / script code
end
-- here only when all parameters passed to make_translit() are valid
return make_translit (args.code, language_name, args.text, args.translit_std, script, args.italic);
end
--[[--------------------------< T R A N S L >------------------------------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function transl (frame)
return _transl (getArgs(frame));
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Returns category name associated with IETF language tag if valid; error message else
All code combinations supported by {{lang}} and the {{lang-xx}} templates are supported by this function.
Module entry point from another module
]]
local function _category_from_tag (args)
local subtags = {}; -- IETF subtags script, region, variant, and private
local raw_code = args[1]; -- save a copy of the input IETF subtag
local link = 'yes' == args['link']; -- make a boolean
local label = args.label;
local code; -- the language code
local msg; -- gets an error message if IETF language tag is malformed or invalid
local category_name = '';
code, subtags.script, subtags.region, subtags.variant, subtags.private, msg = get_ietf_parts (raw_code);
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: ', template, msg, '</span>'});
end
raw_code = format_ietf_tag (code, subtags.script, subtags.region, subtags.variant, subtags.private); -- format to recommended subtag styles; private omitted because private
category_name = language_name_get (raw_code, code); -- get language name; try ietf tag first, then code w/o variant then code w/ variant
category_name = make_category (code, category_name, nil, true):gsub ('[%[%]]', '');
return category_name;
end
--[[--------------------------< C A T E G O R Y _ F R O M _ T A G >--------------------------------------------
Module entry point from an {{#invoke:}}
]]
local function category_from_tag (frame) -- entry point from an {{#invoke:Lang|category_from_tag|<ietf tag>|template=<template name>}}
return _category_from_tag (getArgs (frame)); -- pass-on the args table, nothing else; getArgs() so we also get parent frame
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
category_from_tag = category_from_tag,
lang = lang, -- entry point for {{lang}}
lang_xx_inherit = lang_xx_inherit, -- entry points for {{lang-??}}
lang_xx_italic = lang_xx_italic,
is_ietf_tag = is_ietf_tag,
is_ietf_tag_frame = is_ietf_tag_frame,
is_lang_name = is_lang_name,
tag_from_name = tag_from_name, -- returns ietf tag associated with language name
name_from_tag = name_from_tag, -- used for template documentation; possible use in ISO 639 name from code templates
transl = transl, -- entry point for {{transl}}
_category_from_tag = _category_from_tag, -- entry points when this module is require()d into other modules
_lang = _lang,
_lang_xx_inherit = _lang_xx_inherit,
_lang_xx_italic = _lang_xx_italic,
_is_ietf_tag = _is_ietf_tag,
get_ietf_parts = get_ietf_parts,
_tag_from_name = _tag_from_name,
_name_from_tag = _name_from_tag,
_transl = _transl,
};
a4bb4d6ebc01a04b34edc644613227a570fb68c9
Module:Lang/data
828
98
195
194
2024-06-03T23:43:05Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local lang_data = {};
--[[--------------------------< O V E R R I D E >--------------------------------------------------------------
Language codes and names in this table override the BCP47 names in Module:Language/name/data.
code indexes in this table shall always be lower case
]]
local override = {
-- ISO 639-1 codes
["ab"] = {"Abkhazian"}, -- IANA name is Abkhazian; override wp_languages {"Abkhaz"}; to achieve this, use |label=
["bh"] = {"Bihari languages"}, -- only ISO 639-1 collective; defined here to override improper redefinition (Bihari) in wp_languages
["cu"] = {"Church Slavonic"}, -- 2nd IANA name;
["de-at"] = {"Austrian German"}, -- these code-region and code-variant to match en.wiki article names
["de-ch"] = {"Swiss German"},
["en-au"] = {"Australian English"},
["en-ca"] = {"Canadian English"},
["en-emodeng"] = {"Early Modern English"},
["en-gb"] = {"British English"},
["en-ie"] = {"Irish English"},
["en-nz"] = {"New Zealand English"},
["en-us"] = {"American English"},
["en-za"] = {"South African English"},
["fy"] = {"West Frisian"}, -- IANA name is Western Frisian
["ps"] = {"Pashto"}, -- IANA name is Pushto
["si"] = {"Sinhala"}, -- IANA name is Sinhala, Sinhalese; override wp_languages {"Sinhalese"}; see Module talk:Language/data/wp languages#Request to undo an edit
["sr-cyrl"] = {"Serbian"}, -- override wp_languages Serbian Cyrillic; to achieve this, use |label=
-- ISO 639-2, -3 codes
["arc"] = {"Aramaic"}, -- IANA names are: Official Aramaic (700-300 BCE), Imperial Aramaic (700-300 BCE);
["ber"] = {"Berber languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["bla"] = {"Blackfoot"}, -- IANA, ISO 639-2, -3 name is Siksika; to match en.wiki article title
["bua"] = {"Buryat"}, -- IANA name Buriat; this is a macro language; these four use wp preferred transliteration;
["bxm"] = {"Mongolian Buryat"}, -- IANA name Mongolia Buriat; these three all redirect to Buryat
["bxr"] = {"Russian Buryat"}, -- IANA name Russia Buriat;
["bxu"] = {"Chinese Buryat"}, -- IANA name China Buriat;
["byr"] = {"Yipma"}, -- IANA names are Baruya and Yipma
["cel"] = {"Celtic languages"}, -- ISO 639-2 collective; defined here to override improper redefinition ('Proto-Celtic') in wp_languages; use cel-x-proto instead
["egy"] = {"Ancient Egyptian"}, -- IANA name is Egyptian (Ancient); distinguish from contemporary arz: Egyptian Arabic
["frr"] = {"North Frisian"}, -- IANA name is Northern Frisian
["frs"] = {"East Frisian Low Saxon"}, -- IANA name is Eastern Frisian
["gem"] = {"Germanic languages"}, -- ISO 639-2 collective; defined here to override improper redefinition ('Proto-Germanic') in wp_languages; use gem-x-proto instead
["ilo"] = {"Ilocano"}, -- IANA, ISO 639-2, -3 name is Iloko; to match en.wiki article title
["jam"] = {"Jamaican Patois"}, -- IANA name is Jamaican Creole English
["mhr"] = {"Meadow Mari"}, -- IANA name is Eastern Mari
["mid"] = {"Modern Mandaic"}, -- IANA name is Mandaic
["mla"] = {"Tamambo"}, -- wp_languages name is Medieval Latin; IANA and ISO 639-1 name is Malo
["myn"] = {"Mayan languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["nah"] = {"Nahuatl languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["nan-tw"] = {"Taiwanese Hokkien"}, -- make room for IANA / 639-3 nan Min Nan Chinese; match en.wiki article title
["nrf"] = {"Norman"}, -- not quite a collective - IANA name: Jèrriais; categorizes to Norman-language text
["nzi"] = {"Nzema"}, -- IANA, ISO 639-2, -3 name is Nzima; to match en.wiki article title
["orv"] = {"Old East Slavic"}, -- IANA name is Old Russian
["pms"] = {"Piedmontese"}, -- IANA / 639-3 name is Piemontese; to match en.wiki article title
["pra"] = {"Prakrit languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["roa"] = {"Romance languages"}, -- ISO 639-2 collective; defined here to override improper redefinition (Jèrriais) in wp_language; IANA name is "Romance languages"
["sal"] = {"Salishan languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["sla"] = {"Slavic languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["son"] = {"Songhai languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["stq"] = {"Saterland Frisian"}, -- IANA name is Saterfriesisch
["und"] = {"undetermined"}, -- capitalization to match existing category
["wen"] = {"Sorbian languages"}, -- ISO 639-2 collective; defined here to override redefinition in wp_languages
["wrg"] = {"Warrongo"}, -- IANA name is Warungu
["xal-ru"] = {"Kalmyk"}, -- to match en.wiki article title
-- private use codes
["cel-x-proto"] = {"Proto-Celtic"}, -- cel in IANA is Celtic languages
["gem-x-proto"] = {"Proto-Germanic"}, -- gem in IANA is Germanic languages
["grc-x-aeolic"] = {"Aeolic Greek"}, -- these grc-x-... codes are preferred alternates to the non-standard catchall code grc-gre
["grc-x-attic"] = {"Attic Greek"},
["grc-x-biblical"] = {"Biblical Greek"},
["grc-x-byzant"] = {"Byzantine Greek"},
["grc-x-classic"] = {"Classical Greek"},
["grc-x-doric"] = {"Doric Greek"},
["grc-x-hellen"] = {"Hellenistic Greek"},
["grc-x-ionic"] = {"Ionic Greek"},
["grc-x-koine"] = {"Koinē Greek"},
["grc-x-medieval"] = {"Medieval Greek"},
["grc-x-patris"] = {"Patristic Greek"},
["grk-x-proto"] = {"Proto-Greek"}, -- grk in IANA is Greek languages
["iir-x-proto"] = {"Proto-Indo-Iranian"}, -- iir in IANA is Indo-Iranian Languages
["ira-x-proto"] = {"Proto-Iranian"}, -- ira in IANA is Iranian languages
["itc-x-proto"] = {"Proto-Italic"}, -- itc in IANA is Italic languages
["ksh-x-colog"] = {"Colognian"}, -- en.wiki article is Colognian; ksh (Kölsch) redirects there
["mis-x-ripuar"] = {"Ripuarian"}, -- replaces improper use of ksh in wp_languages
["sla-x-proto"] = {"Proto-Slavic"}, -- sla in IANA is Slavic languages
["yuf-x-hav"] = {"Havasupai"}, -- IANA name for these three is Havasupai-Walapai-Yavapai
["yuf-x-wal"] = {"Walapai"},
["yuf-x-yav"] = {"Yavapai"},
}
--[[--------------------------< A R T I C L E _ L I N K >------------------------------------------------------
for those rare occasions when article titles don't fit with the normal '<language name>-language', this table
maps language code to article title. Use of this table should be avoided and the use of redirects preferred as
that is the long-standing method of handling article names that don't fit with the normal pattern
]]
local article_name = {
["lij"] = {"Ligurian (Romance language)"}, -- see Template_talk:Lang#Ligurian_dab
['mnh'] = {"Mono language (Congo)"}, -- see Template_talk:Lang#Mono_languages
['mnr'] = {"Mono language (California)"},
['mru'] = {"Mono language (Cameroon)"},
['mte'] = {"Mono-Alu language"},
["xlg"] = {"Ligurian language (ancient)"}, -- see Template_talk:Lang#Ligurian_dab
}
--[=[-------------------------< R T L _ S C R I P T S >--------------------------------------------------------
ISO 15924 scripts that are written right-to-left. Data in this table taken from [[ISO 15924#List of codes]]
last update to this list: 2017-12-24
]=]
local rtl_scripts = {
'adlm', 'arab', 'aran', 'armi', 'avst', 'cprt', 'egyd', 'egyh', 'hatr', 'hebr',
'hung', 'inds', 'khar', 'lydi', 'mand', 'mani', 'mend', 'merc', 'mero', 'narb',
'nbat', 'nkoo', 'orkh', 'palm', 'phli', 'phlp', 'phlv', 'phnx', 'prti', 'rohg',
'samr', 'sarb', 'sogd', 'sogo', 'syrc', 'syre', 'syrj', 'syrn', 'thaa', 'wole',
};
--[[--------------------------< T R A N S L I T T I T L E S >------------------------------------------------
This is a table of tables of transliteration standards and the language codes or language scripts that apply to
those standards. This table is used to create the tool-tip text associated with the transliterated text displayed
by some of the {{lang-??}} templates.
These tables are more-or-less copied directly from {{transl}}. The standard 'NO_STD' is a construct to allow for
the cases when no |std= parameter value is provided.
]]
local translit_title_table = {
['ahl'] = {
['default'] = 'Academy of the Hebrew Language transliteration',
},
['ala'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['ala-lc'] = {
['default'] = 'American Library Association – Library of Congress transliteration',
},
['batr'] = {
['default'] = 'Bikdash Arabic Transliteration Rules',
},
['bgn/pcgn'] = {
['default'] = 'Board on Geographic Names / Permanent Committee on Geographical Names transliteration',
},
['din'] = {
['ar'] = 'DIN 31635 Arabic',
['fa'] = 'DIN 31635 Arabic',
['ku'] = 'DIN 31635 Arabic',
['ps'] = 'DIN 31635 Arabic',
['tg'] = 'DIN 31635 Arabic',
['ug'] = 'DIN 31635 Arabic',
['ur'] = 'DIN 31635 Arabic',
['arab'] = 'DIN 31635 Arabic',
['default'] = 'DIN transliteration',
},
['eae'] = {
['default'] = 'Encyclopaedia Aethiopica transliteration',
},
['hepburn'] = {
['default'] = 'Hepburn transliteration',
},
['iast'] = {
['default'] = 'International Alphabet of Sanskrit transliteration',
},
['iso'] = { -- when a transliteration standard is supplied
['ab'] = 'ISO 9 Cyrillic',
['ba'] = 'ISO 9 Cyrillic',
['be'] = 'ISO 9 Cyrillic',
['bg'] = 'ISO 9 Cyrillic',
['kk'] = 'ISO 9 Cyrillic',
['ky'] = 'ISO 9 Cyrillic',
['mn'] = 'ISO 9 Cyrillic',
['ru'] = 'ISO 9 Cyrillic',
['tg'] = 'ISO 9 Cyrillic',
['uk'] = 'ISO 9 Cyrillic',
['bua'] = 'ISO 9 Cyrillic',
['sah'] = 'ISO 9 Cyrillic',
['tut'] = 'ISO 9 Cyrillic',
['xal'] = 'ISO 9 Cyrillic',
['cyrl'] = 'ISO 9 Cyrillic',
['ar'] = 'ISO 233 Arabic',
['ku'] = 'ISO 233 Arabic',
['ps'] = 'ISO 233 Arabic',
['ug'] = 'ISO 233 Arabic',
['ur'] = 'ISO 233 Arabic',
['arab'] = 'ISO 233 Arabic',
['he'] = 'ISO 259 Hebrew',
['yi'] = 'ISO 259 Hebrew',
['hebr'] = 'ISO 259 Hebrew',
['el'] = 'ISO 843 Greek',
['grc'] = 'ISO 843 Greek',
['ja'] = 'ISO 3602 Japanese',
['hira'] = 'ISO 3602 Japanese',
['hrkt'] = 'ISO 3602 Japanese',
['jpan'] = 'ISO 3602 Japanese',
['kana'] = 'ISO 3602 Japanese',
['zh'] = 'ISO 7098 Chinese',
['chi'] = 'ISO 7098 Chinese',
['pny'] = 'ISO 7098 Chinese',
['zho'] = 'ISO 7098 Chinese',
-- ['han'] = 'ISO 7098 Chinese', -- unicode alias of Hani? doesn't belong here? should be Hani?
['hans'] = 'ISO 7098 Chinese',
['hant'] = 'ISO 7098 Chinese',
['ka'] = 'ISO 9984 Georgian',
['kat'] = 'ISO 9984 Georgian',
['arm'] = 'ISO 9985 Armenian',
['hy'] = 'ISO 9985 Armenian',
['th'] = 'ISO 11940 Thai',
['tha'] = 'ISO 11940 Thai',
['ko'] = 'ISO 11941 Korean',
['kor'] = 'ISO 11941 Korean',
['bn'] = 'ISO 15919 Indic',
['dra'] = 'ISO 15919 Indic',
['gu'] = 'ISO 15919 Indic',
['hi'] = 'ISO 15919 Indic',
['inc'] = 'ISO 15919 Indic',
['kn'] = 'ISO 15919 Indic',
['ml'] = 'ISO 15919 Indic',
['mr'] = 'ISO 15919 Indic',
['sa'] = 'ISO 15919 Indic',
['ta'] = 'ISO 15919 Indic',
['te'] = 'ISO 15919 Indic',
['beng'] = 'ISO 15919 Indic',
['brah'] = 'ISO 15919 Indic',
['deva'] = 'ISO 15919 Indic',
['default'] = 'ISO transliteration',
},
['mr'] = {
['default'] = 'McCune–Reischauer transliteration',
},
['nihon-shiki'] = {
['default'] = 'Nihon-shiki transliteration',
},
['no_std'] = { -- when no transliteration standard is supplied
['akk'] = 'Semitic transliteration',
['sem'] = 'Semitic transliteration',
['phnx'] = 'Semitic transliteration',
['xsux'] = 'Cuneiform transliteration',
},
['pinyin'] = {
['default'] = 'Pinyin transliteration',
},
['rr'] = {
['default'] = 'Revised Romanization of Korean transliteration',
},
['rtgs'] = {
['default'] = 'Royal Thai General System of Transcription',
},
['satts'] = {
['default'] = 'Standard Arabic Technical Transliteration System transliteration',
},
['ungegn'] = {
['default'] = 'United Nations Group of Experts on Geographical Names transliteration',
},
['wehr'] = {
['default'] = 'Hans Wehr transliteration',
},
};
return
{
override = override,
article_name = article_name,
rtl_scripts = rtl_scripts,
is_rtl_script = is_rtl_script,
translit_title_table = translit_title_table,
};
e924d3608871be8cc6736961960ec7f51586bc33
Module:Location map
828
99
197
196
2024-06-03T23:43:05Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
require('Module:No globals')
local p = {}
local getArgs = require('Module:Arguments').getArgs
local function round(n, decimals)
local pow = 10^(decimals or 0)
return math.floor(n * pow + 0.5) / pow
end
function p.getMapParams(map, frame)
if not map then
error('The name of the location map definition to use must be specified', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q is not a valid name for a location map definition', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
return function(name, params)
if name == nil then
return 'Module:Location map/data/' .. map
elseif mapData[name] == nil then
return ''
elseif params then
return mw.message.newRawMessage(tostring(mapData[name]), unpack(params)):plain()
else
return mapData[name]
end
end
elseif mw.title.new('Template:Location map ' .. map).exists then
local cache = {}
if type(frame) ~= 'table' or type(frame.expandTemplate) ~= 'function' then
error('A frame must be provided when using a legacy location map')
end
return function(name, params)
if params then
return frame:expandTemplate{title = 'Location map ' .. map, args = { name, unpack(params) }}
else
if name == nil then
return 'Template:Location map ' .. map
elseif cache[name] == nil then
cache[name] = frame:expandTemplate{title = 'Location map ' .. map, args = { name }}
end
return cache[name]
end
end
else
error('Unable to find the specified location map definition. Neither "Module:Location map/data/' .. map .. '" nor "Template:Location map ' .. map .. '" exists', 2)
end
end
function p.data(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local params = {}
for k,v in ipairs(args) do
if k > 2 then
params[k-2] = v
end
end
return map(args[2], #params ~= 0 and params)
end
local hemisphereMultipliers = {
longitude = { W = -1, w = -1, E = 1, e = 1 },
latitude = { S = -1, s = -1, N = 1, n = 1 }
}
local function decdeg(degrees, minutes, seconds, hemisphere, decimal, direction)
if decimal then
if degrees then
error('Decimal and DMS degrees cannot both be provided for ' .. direction, 2)
elseif minutes then
error('Minutes can only be provided with DMS degrees for ' .. direction, 2)
elseif seconds then
error('Seconds can only be provided with DMS degrees for ' .. direction, 2)
elseif hemisphere then
error('A hemisphere can only be provided with DMS degrees for ' .. direction, 2)
end
local retval = tonumber(decimal)
if retval then
return retval
end
error('The value "' .. decimal .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not minutes then
error('Seconds were provided for ' .. direction .. ' without minutes also being provided', 2)
elseif not degrees then
if minutes then
error('Minutes were provided for ' .. direction .. ' without degrees also being provided', 2)
elseif hemisphere then
error('A hemisphere was provided for ' .. direction .. ' without degrees also being provided', 2)
end
return nil
end
decimal = tonumber(degrees)
if not decimal then
error('The degree value "' .. degrees .. '" provided for ' .. direction .. ' is not valid', 2)
elseif minutes and not tonumber(minutes) then
error('The minute value "' .. minutes .. '" provided for ' .. direction .. ' is not valid', 2)
elseif seconds and not tonumber(seconds) then
error('The second value "' .. seconds .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
if hemisphere then
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphere "' .. hemisphere .. '" provided for ' .. direction .. ' is not valid', 2)
end
decimal = decimal * multiplier
end
return decimal
end
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para,coord) -- this should be changed for languages which do not use Arabic numerals or the degree sign
local result = mw.text.split(mw.ustring.match(coord,'%-?[%.%d]+°[NS] %-?[%.%d]+°[EW]') or '', '[ °]')
if para == 'longitude' then result = {result[3], result[4]} end
if not tonumber(result[1]) or not result[2] then return error('Malformed coordinates value', 2) end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
end
-- effectively make removeBlanks false for caption and maplink, and true for everything else
-- if useWikidata is present but blank, convert it to false instead of nil
-- p.top, p.bottom, and their callers need to use this
function p.valueFunc(key, value)
if value then
value = mw.text.trim(value)
end
if value ~= '' or key == 'caption' or key == 'maplink' then
return value
elseif key == 'useWikidata' then
return false
end
end
local function getContainerImage(args, map)
if args.AlternativeMap then
return args.AlternativeMap
elseif args.relief and map('image1') ~= '' then
return map('image1')
else
return map('image')
end
end
function p.top(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local width
local default_as_number = tonumber(mw.ustring.match(tostring(args.default_width),"%d*"))
if not args.width then
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
elseif mw.ustring.sub(args.width, -2) == 'px' then
width = mw.ustring.sub(args.width, 1, -3)
else
width = args.width
end
local width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
if width_as_number == 0 then
-- check to see if width is junk. If it is, then use default calculation
width = round((default_as_number or 240) * (tonumber(map('defaultscale')) or 1))
width_as_number = tonumber(mw.ustring.match(tostring(width),"%d*")) or 0;
end
if args.max_width ~= "" and args.max_width ~= nil then
-- check to see if width bigger than max_width
local max_as_number = tonumber(mw.ustring.match(args.max_width,"%d*")) or 0;
if width_as_number>max_as_number and max_as_number>0 then
width = args.max_width;
end
end
local retval = args.float == 'center' and '<div class="center">' or ''
if args.caption and args.caption ~= '' and args.border ~= 'infobox' then
retval = retval .. '<div class="noviewer thumb '
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'tleft'
elseif args.float == '"center"' or args.float == 'center' or args.float == '"none"' or args.float == 'none' then
retval = retval .. 'tnone'
else
retval = retval .. 'tright'
end
retval = retval .. '"><div class="thumbinner" style="width:' .. (width + 2) .. 'px'
if args.border == 'none' then
retval = retval .. ';border:none'
elseif args.border then
retval = retval .. ';border-color:' .. args.border
end
retval = retval .. '"><div style="position:relative;width:' .. width .. 'px' .. (args.border ~= 'none' and ';border:1px solid lightgray">' or '">')
else
retval = retval .. '<div style="width:' .. width .. 'px;'
if args.float == '"left"' or args.float == 'left' then
retval = retval .. 'float:left;clear:left'
elseif args.float == '"center"' or args.float == 'center' then
retval = retval .. 'float:none;clear:both;margin-left:auto;margin-right:auto'
elseif args.float == '"none"' or args.float == 'none' then
retval = retval .. 'float:none;clear:none'
else
retval = retval .. 'float:right;clear:right'
end
retval = retval .. '"><div style="width:' .. width .. 'px;padding:0"><div style="position:relative;width:' .. width .. 'px">'
end
local image = getContainerImage(args, map)
retval = string.format(
'%s[[File:%s|%spx|%s%s]]',
retval,
image,
width,
args.alt or ((args.label or mw.title.getCurrentTitle().text) .. ' is located in ' .. map('name')),
args.maplink and ('|link=' .. args.maplink) or ''
)
if args.caption and args.caption ~= '' then
if mw.ustring.find(args.caption, '##') then
retval = retval .. '[[Category:Pages using location map with a double number sign in the caption]]'
end
end
if args.overlay_image then
return retval .. '<div style="position:absolute;top:0;left:0">[[File:' .. args.overlay_image .. '|' .. width .. 'px]]</div>'
else
return retval
end
end
function p.bottom(frame, args, map)
if not args then
args = getArgs(frame, {frameOnly = true, valueFunc = p.valueFunc})
end
if not map then
map = p.getMapParams(args[1], frame)
end
local retval = '</div>'
if not args.caption or args.border == 'infobox' then
if args.border then
retval = retval .. '<div>'
else
retval = retval .. '<div style="font-size:90%;padding-top:3px">'
end
retval = retval
.. (args.caption or (args.label or mw.title.getCurrentTitle().text) .. ' (' .. map('name') .. ')')
.. '</div>'
elseif args.caption ~= '' then
-- This is not the pipe trick. We're creating a link with no text on purpose, so that CSS can give us a nice image
retval = retval .. '<div class="thumbcaption"><div class="magnify">[[:File:' .. getContainerImage(args, map) .. '| ]]</div>' .. args.caption .. '</div>'
end
if args.switcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">Show map of ' .. map('name') .. '</span>'
end
retval = retval .. '</div></div>'
if args.caption_undefined then
mw.log('Removed parameter caption_undefined used.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
retval = retval .. '[[Category:Location maps with removed parameters|caption_undefined]]'
end
if map('skew') ~= '' or map('lat_skew') ~= '' or map('crosses180') ~= '' or map('type') ~= '' then
mw.log('Removed parameter used in map definition ' .. map())
local key = (map('skew') ~= '' and 'skew' or '') ..
(map('lat_skew') ~= '' and 'lat_skew' or '') ..
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[Category:Location maps with removed parameters|' .. key .. ' ]]'
end
if string.find(map('name'), '|', 1, true) then
mw.log('Pipe used in name of map definition ' .. map())
retval = retval .. '[[Category:Location maps with a name containing a pipe]]'
end
if args.float == 'center' then
retval = retval .. '</div>'
end
return retval
end
local function markOuterDiv(x, y, imageDiv, labelDiv)
return mw.html.create('div')
:cssText('position:absolute;top:' .. round(y, 3) .. '%;left:' .. round(x, 3) .. '%')
:node(imageDiv)
:node(labelDiv)
end
local function markImageDiv(mark, marksize, label, link, alt, title)
local builder = mw.html.create('div')
:cssText('position:absolute;left:-' .. round(marksize / 2) .. 'px;top:-' .. round(marksize / 2) .. 'px;line-height:0')
:attr('title', title)
if marksize ~= 0 then
builder:wikitext(string.format(
'[[File:%s|%dx%dpx|%s|link=%s%s]]',
mark,
marksize,
marksize,
label,
link,
alt and ('|alt=' .. alt) or ''
))
end
return builder
end
local function markLabelDiv(label, label_size, label_width, position, background, x, marksize)
if tonumber(label_size) == 0 then
return mw.html.create('div'):cssText('font-size:0%;position:absolute'):wikitext(label)
end
local builder = mw.html.create('div')
:cssText('font-size:' .. label_size .. '%;line-height:110%;position:absolute;width:' .. label_width .. 'em')
local distance = round(marksize / 2 + 1)
local spanCss
if position == 'top' then -- specified top
builder:cssText('bottom:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em;text-align:center')
elseif position == 'bottom' then -- specified bottom
builder:cssText('top:' .. distance .. 'px;left:' .. (-label_width / 2) .. 'em;text-align:center')
elseif position == 'left' or (tonumber(x) > 70 and position ~= 'right') then -- specified left or autodetected to left
builder:cssText('top:-0.75em;right:' .. distance .. 'px;text-align:right')
spanCss = 'float:right'
else -- specified right or autodetected to right
builder:cssText('top:-0.75em;left:' .. distance .. 'px;text-align:left')
spanCss = 'float:left'
end
builder = builder:tag('span')
:cssText('padding:1px')
:cssText(spanCss)
:wikitext(label)
if background then
builder:cssText('background-color:' .. background)
end
return builder:done()
end
local function getX(longitude, left, right)
local width = (right - left) % 360
if width == 0 then
width = 360
end
local distanceFromLeft = (longitude - left) % 360
-- the distance needed past the map to the right equals distanceFromLeft - width. the distance needed past the map to the left equals 360 - distanceFromLeft. to minimize page stretching, go whichever way is shorter
if distanceFromLeft - width / 2 >= 180 then
distanceFromLeft = distanceFromLeft - 360
end
return 100 * distanceFromLeft / width
end
local function getY(latitude, top, bottom)
return 100 * (top - latitude) / (top - bottom)
end
function p.mark(frame, args, map)
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map~'})
end
local mapnames = {}
if not map then
if args[1] then
map = {}
for mapname in mw.text.gsplit(args[1], '#', true) do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
mapnames[#mapnames + 1] = mapname
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
args[1] = 'World'
end
end
if type(map) == 'table' then
local outputs = {}
local oldargs = args[1]
for k,v in ipairs(map) do
args[1] = mapnames[k]
outputs[k] = tostring(p.mark(frame, args, v))
end
args[1] = oldargs
return table.concat(outputs, '#PlaceList#') .. '#PlaceList#'
end
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
latitude = decdeg(args.lat_deg, args.lat_min, args.lat_sec, args.lat_dir, args.lat, 'latitude')
if args.excludefrom then
-- If this mark is to be excluded from certain maps entirely (useful in the context of multiple maps)
for exclusionmap in mw.text.gsplit(args.excludefrom, '#', true) do
-- Check if this map is excluded. If so, return an empty string.
if args[1] == exclusionmap then
return ''
end
end
end
if args.coordinates then
-- Temporarily removed to facilitate infobox conversion. See [[Wikipedia:Coordinates in infoboxes]]
-- if longitude or latitude then
-- error('Coordinates from [[Module:Coordinates]] and individual coordinates cannot both be provided')
-- end
longitude = coord2text('longitude', args.coordinates)
latitude = coord2text('latitude', args.coordinates)
elseif not longitude and not latitude and args.useWikidata then
-- If they didn't provide either coordinate, try Wikidata. If they provided one but not the other, don't.
local entity = mw.wikibase.getEntity()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1].mainsnak.snaktype == 'value' then
local value = entity.claims.P625[1].mainsnak.datavalue.value
longitude, latitude = value.longitude, value.latitude
end
end
if not longitude then
error('No value was provided for longitude')
elseif not latitude then
error('No value was provided for latitude')
end
local builder = mw.html.create()
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Degrees]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Minutes]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Seconds]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Hemisphere]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[Category:Location maps with different longitude and latitude precisions|Decimal]]')
end
if args.skew or args.lon_shift or args.markhigh then
mw.log('Removed parameter used in invocation.')
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
local key = (args.skew and 'skew' or '') ..
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[Category:Location maps with removed parameters|' .. key ..' ]]')
end
if map('x') ~= '' then
x = tonumber(mw.ext.ParserFunctions.expr(map('x', { latitude, longitude })))
else
x = tonumber(getX(longitude, map('left'), map('right')))
end
if map('y') ~= '' then
y = tonumber(mw.ext.ParserFunctions.expr(map('y', { latitude, longitude })))
else
y = tonumber(getY(latitude, map('top'), map('bottom')))
end
if (x < 0 or x > 100 or y < 0 or y > 100) and not args.outside then
mw.log('Mark placed outside map boundaries without outside flag set. x = ' .. x .. ', y = ' .. y)
local parent = frame:getParent()
if parent then
mw.log('Parent is ' .. parent:getTitle())
end
mw.logObject(args, 'args')
local key = frame:preprocess('{{FULLPAGENAME}}')
builder:wikitext('[[Category:Location maps with marks outside map and outside parameter not set|' .. key .. ' ]]')
end
local mark = args.mark or map('mark')
if mark == '' then
mark = 'Red pog.svg'
end
local marksize = tonumber(args.marksize) or tonumber(map('marksize')) or 8
local imageDiv = markImageDiv(mark, marksize, args.label or mw.title.getCurrentTitle().text, args.link or '', args.alt, args[2])
local labelDiv
if args.label and args.position ~= 'none' then
labelDiv = markLabelDiv(args.label, args.label_size or 90, args.label_width or 6, args.position, args.background, x, marksize)
end
return builder:node(markOuterDiv(x, y, imageDiv, labelDiv))
end
local function switcherSeparate(s)
if s == nil then return {} end
local retval = {}
for i in string.gmatch(s .. '#', '([^#]*)#') do
i = mw.text.trim(i)
retval[#retval + 1] = (i ~= '' and i)
end
return retval
end
function p.main(frame, args, map)
local caption_list = {}
if not args then
args = getArgs(frame, {wrappers = 'Template:Location map', valueFunc = p.valueFunc})
end
if args.useWikidata == nil then
args.useWikidata = true
end
if not map then
if args[1] then
map = {}
for mapname in string.gmatch(args[1], '[^#]+') do
map[#map + 1] = p.getMapParams(mw.ustring.gsub(mapname, '^%s*(.-)%s*$', '%1'), frame)
end
if args['caption'] then
if args['caption'] == "" then
while #caption_list < #map do
caption_list[#caption_list + 1] = args['caption']
end
else
for caption in mw.text.gsplit(args['caption'], '##', true) do
caption_list[#caption_list + 1] = caption
end
end
end
if #map == 1 then map = map[1] end
else
map = p.getMapParams('World', frame)
end
end
if type(map) == 'table' then
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMaps were provided, but only %d maps were provided', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provided, but only %d maps were provided', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provided, but only %d maps were provided', #caption_list, #map))
end
local outputs = {}
args.autoSwitcherLabel = true
for k,v in ipairs(map) do
args.AlternativeMap = altmaps[k]
args.overlay_image = overlays[k]
args.caption = caption_list[k]
outputs[k] = p.main(frame, args, v)
end
return '<div class="switcher-container">' .. table.concat(outputs) .. '</div>'
else
return p.top(frame, args, map) .. tostring( p.mark(frame, args, map) ) .. p.bottom(frame, args, map)
end
end
return p
fc8518382f53f2a840579e90111baa688e35f872
Module:Location map/data/USA
828
100
199
198
2024-06-03T23:43:05Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
return {
name = 'the US',
x = '50.0 + 124.03149777329222 * ((1.9694462586094064-($1 * pi / 180)) * sin(0.6010514667026994 * ($2 + 96) * pi / 180))',
y = '50.0 + 1.6155950752393982 * 124.03149777329222 * ( 0.02613325650382181 - (1.3236744353715044 - (1.9694462586094064 - ($1 * pi / 180)) * cos(0.6010514667026994 * ($2 + 96) * pi / 180)))',
image = 'Usa edcp location map.svg',
image1 = 'Usa edcp relief location map.png'
}
f9ff12b9b0328d94d87db1816bb8bed69e3fd752
Module:Lua banner
828
101
201
200
2024-06-03T23:43:06Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements the {{lua}} template.
local yesno = require('Module:Yesno')
local mList = require('Module:List')
local mTableTools = require('Module:TableTools')
local mMessageBox = require('Module:Message box')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
end
function p.renderBox(modules)
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
else
local moduleLinks = {}
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('[[:%s]]', module)
local maybeSandbox = mw.title.new(module .. '/sandbox')
if maybeSandbox.exists then
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText)
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" then
title = title.basePageTitle
end
if title.contentModel == "Scribunto" then
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
boxArgs.text = 'This template uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
end
function p.renderTrackingCategories(args, modules, titleObj)
if yesno(args.nocat) then
return ''
end
local cats = {}
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'Lua templates with errors'
end
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
doc = true,
sandbox = true,
sandbox2 = true,
testcases = true
}
if not subpageBlacklist[titleObj.subpageText] then
local protCatName
if titleObj.namespace == 10 then
local category = args.category
if not category then
local categories = {
['Module:String'] = 'Lua String-based templates',
['Module:Math'] = 'Templates based on the Math Lua module',
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
['Module:Citation'] = 'Lua-based citation templates'
}
categories['Module:Citation/CS1'] = categories['Module:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
protCatName = "Templates using under-protected Lua modules"
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
if not args.noprotcat and protCatName then
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
end
return table.concat(cats)
end
return p
c2b844759e77866802cbfea71da923198539a90c
Module:Math
828
102
203
202
2024-06-03T23:43:06Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('<strong class="error">Formatting error: %s</strong>', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current "dominant" value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first <= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, "no", "n", "0" and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos <= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a > b end), ...)
if max_value then
return max_value
end
end
--[[
median
Find the median of set of numbers
Usage:
{{#invoke:Math | median | number1 | number2 | ...}}
OR
{{#invoke:Math | median }}
]]
function wrap.median(args)
return p._median(unpackNumberArgs(args))
end
function p._median(...)
local vals = makeArgArray(...)
local count = #vals
table.sort(vals)
if count == 0 then
return 0
end
if p._mod(count, 2) == 0 then
return (vals[count/2] + vals[count/2+1])/2
else
return vals[math.ceil(count/2)]
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a < b end), ...)
if min_value then
return min_value
end
end
--[[
sum
Finds the sum
Usage:
{{#invoke:Math| sum | value1 | value2 | ... }}
OR
{{#invoke:Math| sum }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.sum(args)
return p._sum(unpackNumberArgs(args))
end
function p._sum(...)
local sums, count = fold((function(a, b) return a + b end), ...)
if not sums then
return 0
else
return sums
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
log10
returns the log (base 10) of a number
Usage:
{{#invoke:Math | log10 | x }}
]]
function wrap.log10(args)
return math.log10(args[1])
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 <= ret and ret < y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr < 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision >= 14 then
orig_precision = p._precision(value_string)
if order + orig_precision >= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision < current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) >= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision < precision then
local padding
if current_precision <= 0 then
if precision > 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding > 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order < 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. order .. '</sup>'
end
return formatted_num
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match("^%s*(.-)%s*$") -- String is valid but may contain padding, clean it.
number_string = number_string:match("^%+(.*)$") or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)
dd7cebda2e11c3484347fe3cde5b36ae515187f9
Module:Side box
828
103
205
204
2024-06-03T23:43:06Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements {{side box}}.
local yesno = require('Module:Yesno')
local p = {}
function p.main(frame)
local origArgs = frame:getParent().args
local args = {}
for k, v in pairs(origArgs) do
v = v:match('%s*(.-)%s*$')
if v ~= '' then
args[k] = v
end
end
return p._main(args)
end
function p._main(args)
local data = p.makeData(args)
return p.renderSidebox(data)
end
function p.makeData(args)
local data = {}
-- Main table classes
data.classes = {}
if yesno(args.metadata) ~= false then
table.insert(data.classes, 'metadata')
end
if args.position and args.position:lower() == 'left' then
table.insert(data.classes, 'mbox-small-left')
else
table.insert(data.classes, 'mbox-small')
end
table.insert(data.classes, args.class)
-- Image
if args.image and args.image ~= 'none' then
data.image = args.image
end
-- Copy over data that doesn't need adjusting
local argsToCopy = {
-- Styles
'style',
'textstyle',
-- Above row
'above',
'abovestyle',
-- Body row
'text',
'imageright',
-- Below row
'below',
}
for i, key in ipairs(argsToCopy) do
data[key] = args[key]
end
return data
end
function p.renderSidebox(data)
-- Renders the sidebox HTML.
-- Table root
local root = mw.html.create('table')
root:attr('role', 'presentation')
for i, class in ipairs(data.classes or {}) do
root:addClass(class)
end
root:css{border = '1px solid #aaa', ['background-color'] = '#f9f9f9', color = '#000'}
if data.style then
root:cssText(data.style)
end
-- The "above" row
if data.above then
local aboveCell = root:newline():tag('tr'):tag('td')
aboveCell
:attr('colspan', data.imageright and 3 or 2)
:addClass('mbox-text')
if data.textstyle then
aboveCell:cssText(data.textstyle)
end
if data.abovestyle then
aboveCell:cssText(data.abovestyle)
end
aboveCell
:newline()
:wikitext(data.above)
end
-- The body row
local bodyRow = root:newline():tag('tr'):newline()
if data.image then
bodyRow:tag('td')
:addClass('mbox-image')
:wikitext(data.image)
else
bodyRow:tag('td'):css('width', '1px')
end
local textCell = bodyRow:newline():tag('td')
textCell:addClass('mbox-text plainlist')
if data.textstyle then
textCell:cssText(data.textstyle)
end
textCell:wikitext(data.text)
if data.imageright then
bodyRow:newline():tag('td')
:addClass('mbox-imageright')
:wikitext(data.imageright)
end
-- The below row
if data.below then
local belowCell = root:newline():tag('tr'):tag('td')
belowCell
:attr('colspan', data.imageright and 3 or 2)
:addClass('mbox-text')
if data.textstyle then
belowCell:cssText(data.textstyle)
end
belowCell:wikitext(data.below)
end
return tostring(root)
end
return p
22522e8963a362334d99823230725ff4dc3d8ece
Module:URL
828
104
207
206
2024-06-03T23:43:07Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--
-- This module implements {{URL}}
--
-- See unit tests at [[Module:URL/tests]]
local p = {}
local function safeUri(s)
local success, uri = pcall(function()
return mw.uri.new(s)
end)
if success then
return uri
end
end
function p._url(url, text)
url = mw.text.trim(url or '')
text = mw.text.trim(text or '')
if url == '' then
if text == '' then
return mw.getCurrentFrame():expandTemplate{ title = 'tlx', args = { 'URL', "''example.com''", "''optional display text''" } }
else
return text
end
end
-- If the URL contains any unencoded spaces, encode them, because MediaWiki will otherwise interpret a space as the end of the URL.
url = mw.ustring.gsub(url, '%s', function(s) return mw.uri.encode(s, 'PATH') end)
-- If there is an empty query string or fragment id, remove it as it will cause mw.uri.new to throw an error
url = mw.ustring.gsub(url, '#$', '')
url = mw.ustring.gsub(url, '%?$', '')
-- If it's an HTTP[S] URL without the double slash, fix it.
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
-- Handle URLs from Wikidata of the format http://
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?)://', 'http%1://')
local uri = safeUri(url)
-- Handle URL's without a protocol and URL's that are protocol-relative,
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = 'http://' .. url
uri = safeUri(url)
end
if text == '' then
if uri then
if uri.path == '/' then uri.path = '' end
local port = ''
if uri.port then port = ':' .. uri.port end
text = mw.ustring.lower(uri.host or '') .. port .. (uri.relativePath or '')
-- Add <wbr> before _/.-# sequences
text = mw.ustring.gsub(text,"(/+)","<wbr/>%1") -- This entry MUST be the first. "<wbr/>" has a "/" in it, you know.
text = mw.ustring.gsub(text,"(%.+)","<wbr/>%1")
-- text = mw.ustring.gsub(text,"(%-+)","<wbr/>%1") -- DISABLED for now
text = mw.ustring.gsub(text,"(%#+)","<wbr/>%1")
text = mw.ustring.gsub(text,"(_+)","<wbr/>%1")
else -- URL is badly-formed, so just display whatever was passed in
text = url
end
end
return mw.ustring.format('<span class="url">[%s %s]</span>', url, text)
end
function p.url(frame)
local templateArgs = frame.args
local parentArgs = frame:getParent().args;
local url = templateArgs[1] or parentArgs[1] or ''
local text = templateArgs[2] or parentArgs[2]
if not text then
url = url or extractUrl(templateArgs) or extractUrl(parentArgs);
end
text = text or ''
return p._url(url, text)
end
function extractUrl(args)
for name, val in pairs(args) do
local url = name .. "=" .. val;
url = mw.ustring.gsub(url, '^[Hh][Tt][Tt][Pp]([Ss]?):(/?)([^/])', 'http%1://%3')
local uri = safeUri(url);
if uri and uri.host then
return url
end
end
end
return p
2539ef10e49d4590a83b652588529e0ac2349b1d
Module:Unicode data
828
105
209
208
2024-06-03T23:43:07Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
local floor = math.floor
local function errorf(level, ...)
if type(level) == "number" then
return error(string.format(...), level + 1)
else -- level is actually the format string.
return error(string.format(level, ...), 2)
end
end
local function binary_range_search(codepoint, ranges)
local low, mid, high
low, high = 1, ranges.length or require "Module:TableTools".length(ranges)
while low <= high do
mid = floor((low + high) / 2)
local range = ranges[mid]
if codepoint < range[1] then
high = mid - 1
elseif codepoint <= range[2] then
return range, mid
else
low = mid + 1
end
end
return nil, mid
end
p.binary_range_search = binary_range_search
--[[
local function linear_range_search(codepoint, ranges)
for i, range in ipairs(ranges) do
if range[1] <= codepoint and codepoint <= range[2] then
return range
end
end
end
--]]
-- Load a module by indexing "loader" with the name of the module minus the
-- "Module:Unicode data/" part. For instance, loader.blocks returns
-- [[Module:Unicode data/blocks]]. If a module cannot be loaded, false will be
-- returned.
local loader = setmetatable({}, {
__index = function (self, key)
local success, data = pcall(mw.loadData, "Module:Unicode data/" .. key)
if not success then
data = false
end
self[key] = data
return data
end
})
-- For the algorithm used to generate Hangul Syllable names,
-- see "Hangul Syllable Name Generation" in section 3.12 of the
-- Unicode Specification:
-- https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf
local name_hooks = {
{ 0x00, 0x1F, "<control-%04X>" }, -- C0 control characters
{ 0x7F, 0x9F, "<control-%04X>" }, -- DEL and C1 control characters
{ 0x3400, 0x4DBF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension A
{ 0x4E00, 0x9FFC, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph
{ 0xAC00, 0xD7A3, function (codepoint) -- Hangul Syllables
local Hangul_data = loader.Hangul
local syllable_index = codepoint - 0xAC00
return ("HANGUL SYLLABLE %s%s%s"):format(
Hangul_data.leads[floor(syllable_index / Hangul_data.final_count)],
Hangul_data.vowels[floor((syllable_index % Hangul_data.final_count)
/ Hangul_data.trail_count)],
Hangul_data.trails[syllable_index % Hangul_data.trail_count]
)
end },
-- High Surrogates, High Private Use Surrogates, Low Surrogates
{ 0xD800, 0xDFFF, "<surrogate-%04X>" },
{ 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0x17000, 0x187F7, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph
{ 0x18800, 0x18AFF, function (codepoint)
return ("TANGUT COMPONENT-%03d"):format(codepoint - 0x187FF)
end },
{ 0x18D00, 0x18D08, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph Supplement
{ 0x1B170, 0x1B2FB, "NUSHU CHARACTER-%04X" }, -- Nushu
{ 0x20000, 0x2A6DD, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension B
{ 0x2A700, 0x2B734, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension C
{ 0x2B740, 0x2B81D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension D
{ 0x2B820, 0x2CEA1, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension E
{ 0x2CEB0, 0x2EBE0, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension F
-- CJK Compatibility Ideographs Supplement (Supplementary Ideographic Plane)
{ 0x2F800, 0x2FA1D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xE0100, 0xE01EF, function (codepoint) -- Variation Selectors Supplement
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xE0100 + 17)
end},
{ 0x30000, 0x3134A, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension G
{ 0xF0000, 0xFFFFD, "<private-use-%04X>" }, -- Plane 15 Private Use
{ 0x100000, 0x10FFFD, "<private-use-%04X>" } -- Plane 16 Private Use
}
name_hooks.length = #name_hooks
local name_range_cache
local function generate_name(data, codepoint)
if type(data) == "string" then
return data:format(codepoint)
else
return data(codepoint)
end
end
--[[
-- Checks that the code point is a number and in range.
-- Does not check whether code point is an integer.
-- Not used
local function check_codepoint(funcName, argIdx, val)
require 'libraryUtil'.checkType(funcName, argIdx, val, 'number')
if codepoint < 0 or 0x10FFFF < codepoint then
errorf("Codepoint %04X out of range", codepoint)
end
end
--]]
-- https://www.unicode.org/versions/Unicode11.0.0/ch04.pdf, section 4.8
function p.lookup_name(codepoint)
-- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned
-- (Cn) and specifically noncharacters:
-- https://www.unicode.org/faq/private_use.html#nonchar4
if 0xFDD0 <= codepoint and (codepoint <= 0xFDEF
or floor(codepoint % 0x10000) >= 0xFFFE) then
return ("<noncharacter-%04X>"):format(codepoint)
end
if name_range_cache -- Check if previously used "name hook" applies to this code point.
and codepoint >= name_range_cache[1]
and codepoint <= name_range_cache[2] then
return generate_name(name_range_cache[3], codepoint)
end
local range = binary_range_search(codepoint, name_hooks)
if range then
name_range_cache = range
return generate_name(range[3], codepoint)
end
local data = loader[('names/%03X'):format(codepoint / 0x1000)]
if data and data[codepoint] then
return data[codepoint]
-- Unassigned (Cn) consists of noncharacters and reserved characters.
-- The character has been established not to be a noncharacter,
-- and if it were assigned, its name would already been retrieved,
-- so it must be reserved.
else
return ("<reserved-%04X>"):format(codepoint)
end
end
--[[
-- No image data modules on Wikipedia yet.
function p.lookup_image(codepoint)
local data = loader[('images/%03X'):format(codepoint / 0x1000)]
if data then
return data[codepoint]
end
end
--]]
local planes = {
[ 0] = "Basic Multilingual Plane";
[ 1] = "Supplementary Multilingual Plane";
[ 2] = "Supplementary Ideographic Plane";
[ 3] = "Tertiary Ideographic Plane";
[14] = "Supplementary Special-purpose Plane";
[15] = "Supplementary Private Use Area-A";
[16] = "Supplementary Private Use Area-B";
}
-- Load [[Module:Unicode data/blocks]] if needed and assign it to this variable.
local blocks
local function block_iter(blocks, i)
i = i + 1
local data = blocks[i]
if data then
-- Unpack doesn't work on tables loaded with mw.loadData.
return i, data[1], data[2], data[3]
end
end
-- An ipairs-type iterator generator for the list of blocks.
function p.enum_blocks()
local blocks = loader.blocks
return block_iter, blocks, 0
end
function p.lookup_plane(codepoint)
local i = floor(codepoint / 0x10000)
return planes[i] or ("Plane %u"):format(i)
end
function p.lookup_block(codepoint)
local blocks = loader.blocks
local range = binary_range_search(codepoint, blocks)
if range then
return range[3]
else
return "No Block"
end
end
function p.get_block_info(name)
for i, block in ipairs(loader.blocks) do
if block[3] == name then
return block
end
end
end
function p.is_valid_pagename(pagename)
local has_nonws = false
for cp in mw.ustring.gcodepoint(pagename) do
if (cp == 0x0023) -- #
or (cp == 0x005B) -- [
or (cp == 0x005D) -- ]
or (cp == 0x007B) -- {
or (cp == 0x007C) -- |
or (cp == 0x007D) -- }
or (cp == 0x180E) -- MONGOLIAN VOWEL SEPARATOR
or ((cp >= 0x2000) and (cp <= 0x200A)) -- spaces in General Punctuation block
or (cp == 0xFFFD) -- REPLACEMENT CHARACTER
then
return false
end
local printable, result = p.is_printable(cp)
if not printable then
return false
end
if result ~= "space-separator" then
has_nonws = true
end
end
return has_nonws
end
local function manual_unpack(what, from)
if what[from + 1] == nil then
return what[from]
end
local result = {}
from = from or 1
for i, item in ipairs(what) do
if i >= from then
table.insert(result, item)
end
end
return unpack(result)
end
local function compare_ranges(range1, range2)
return range1[1] < range2[1]
end
-- Creates a function to look up data in a module that contains "singles" (a
-- code point-to-data map) and "ranges" (an array containing arrays that contain
-- the low and high code points of a range and the data associated with that
-- range).
-- "loader" loads and returns the "singles" and "ranges" tables.
-- "match_func" is passed the code point and either the data or the "dots", and
-- generates the final result of the function.
-- The varargs ("dots") describes the default data to be returned if there wasn't
-- a match.
-- In case the function is used more than once, "cache" saves ranges that have
-- already been found to match, or a range whose data is the default if there
-- was no match.
local function memo_lookup(data_module_subpage, match_func, ...)
local dots = { ... }
local cache = {}
local singles, ranges
return function (codepoint)
if not singles then
local data_module = loader[data_module_subpage]
singles, ranges = data_module.singles, data_module.ranges
end
if singles[codepoint] then
return match_func(codepoint, singles[codepoint])
end
local range = binary_range_search(codepoint, cache)
if range then
return match_func(codepoint, manual_unpack(range, 3))
end
local range, index = binary_range_search(codepoint, ranges)
if range then
table.insert(cache, range)
table.sort(cache, compare_ranges)
return match_func(codepoint, manual_unpack(range, 3))
end
if ranges[index] then
local dots_range
if codepoint > ranges[index][2] then
dots_range = {
ranges[index][2] + 1,
ranges[index + 1] and ranges[index + 1][1] - 1 or 0x10FFFF,
unpack(dots)
}
else -- codepoint < range[index][1]
dots_range = {
ranges[index - 1] and ranges[index - 1][2] + 1 or 0,
ranges[index][1] - 1,
unpack(dots)
}
end
table.sort(cache, compare_ranges)
end
return match_func(codepoint)
end
end
-- Get a code point's combining class value in [[Module:Unicode data/combining]],
-- and return whether this value is not zero. Zero is assigned as the default
-- if the combining class value is not found in this data module.
-- That is, return true if character is combining, or false if it is not.
-- See https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values for
-- more information.
p.is_combining = memo_lookup(
"combining",
function (codepoint, combining_class)
return combining_class and combining_class ~= 0 or false
end,
0)
function p.add_dotted_circle(str)
return (mw.ustring.gsub(str, ".",
function(char)
if p.is_combining(mw.ustring.codepoint(char)) then
return '◌' .. char
end
end))
end
local lookup_control = memo_lookup(
"control",
function (codepoint, ccc)
return ccc or "assigned"
end,
"assigned")
p.lookup_control = lookup_control
function p.is_assigned(codepoint)
return lookup_control(codepoint) ~= "unassigned"
end
function p.is_printable(codepoint)
local result = lookup_control(codepoint)
return (result == "assigned") or (result == "space-separator"), result
end
function p.is_whitespace(codepoint)
local result = lookup_control(codepoint)
return (result == "space-separator"), result
end
p.lookup_category = memo_lookup(
"category",
function (codepoint, category)
return category
end,
"Cn")
local lookup_script = memo_lookup(
"scripts",
function (codepoint, script_code)
return script_code or 'Zzzz'
end,
"Zzzz")
p.lookup_script = lookup_script
function p.get_best_script(str)
-- Check type of argument, because mw.text.decode coerces numbers to strings!
require "libraryUtil".checkType("get_best_script", 1, str, "string")
-- Convert HTML character references (including named character references,
-- or character entities) to characters.
str = mw.text.decode(str, true)
local scripts = {}
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
-- Ignore "Inherited", "Undetermined", or "Uncoded" scripts.
if not (script == "Zyyy" or script == "Zinh" or script == "Zzzz") then
scripts[script] = true
end
end
-- If scripts does not contain two or more keys,
-- return first and only key (script code) in table.
if not next(scripts, next(scripts)) then
return next(scripts)
end -- else return majority script, or else "Zzzz"?
end
function p.is_Latin(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0340-U+10FFFF. If they are not found and there is at least
-- one Latin-script character, the string counts as Latin, because the rest
-- of the characters can only be Zyyy, Zinh, and Zzzz.
-- The only scripts found below U+0370 (the first code point of the Greek
-- and Coptic block) are Latn, Zyyy, Zinh, and Zzzz.
-- See the codepage in the [[UTF-8]] article.
if not str:find "[\205-\244]" then
for codepoint in mw.ustring.gcodepoint(str) do
if lookup_script(codepoint) == "Latn" then
return true
end
end
end
local Latn = false
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if script == "Latn" then
Latn = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return Latn
end
-- Checks that a string contains only characters belonging to right-to-left
-- scripts, or characters of ignorable scripts.
function p.is_rtl(str)
require "libraryUtil".checkType("get_best_script", 1, str, "string")
str = mw.text.decode(str, true)
-- Search for the leading bytes that introduce the UTF-8 encoding of the
-- code points U+0580-U+10FFFF. If they are not found, the string can only
-- have characters from a left-to-right script, because the first code point
-- in a right-to-left script is U+0591, in the Hebrew block.
if not str:find "[\214-\244]" then
return false
end
local result = false
local rtl = loader.scripts.rtl
for codepoint in mw.ustring.gcodepoint(str) do
local script = lookup_script(codepoint)
if rtl[script] then
result = true
elseif not (script == "Zyyy" or script == "Zinh"
or script == "Zzzz") then
return false
end
end
return result
end
local function get_codepoint(args, arg)
local codepoint_string = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
local codepoint = tonumber(codepoint_string, 16)
or errorf(2, "Parameter %s is not a code point in hexadecimal base",
tostring(arg))
if not (0 <= codepoint and codepoint <= 0x10FFFF) then
errorf(2, "code point in parameter %s out of range", tostring(arg))
end
return codepoint
end
local function get_func(args, arg, prefix)
local suffix = args[arg]
or errorf(2, "Parameter %s is required", tostring(arg))
suffix = mw.text.trim(suffix)
local func_name = prefix .. suffix
local func = p[func_name]
or errorf(2, "There is no function '%s'", func_name)
return func
end
-- This function allows any of the "lookup" functions to be invoked. The first
-- parameter is the word after "lookup_"; the second parameter is the code point
-- in hexadecimal base.
function p.lookup(frame)
local func = get_func(frame.args, 1, "lookup_")
local codepoint = get_codepoint(frame.args, 2)
local result = func(codepoint)
if func == p.lookup_name then
-- Prevent code point labels such as <control-0000> from being
-- interpreted as HTML tags.
result = result:gsub("<", "<")
end
return result
end
function p.is(frame)
local func = get_func(frame.args, 1, "is_")
-- is_Latin and is_valid_pagename take strings.
if func == p.is_Latin or func == p.is_valid_pagename or func == p.is_rtl then
return (func(frame.args[2]))
else -- The rest take code points.
local codepoint = get_codepoint(frame.args, 2)
return (func(codepoint)) -- Adjust to one result.
end
end
return p
3834f6ce1efd8c4eb1a49828d0dbbbd18c91de73
Module:Uses Wikidata
828
106
211
210
2024-06-03T23:43:07Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
function p.usesProperty(frame)
local parent = frame.getParent(frame)
local result = ''
local ii = 1
while true do
local p_num = mw.text.trim(parent.args[ii] or '')
if p_num ~= '' then
local label = mw.wikibase.label(p_num) or "NO LABEL"
result = result .. "<ul><li><b><i>[[d:Property:" .. p_num .. "|" .. label .. " <small>(" .. string.upper(p_num) .. ")</small>]]</i></b> (see [[d:Property talk:" .. p_num .. "|talk]]; <span class='plainlinks'>[https://query.wikidata.org/embed.html#SELECT%20%3FWikiData_item_%20%3FWikiData_item_Label%20%3Fvalue%20%3FvalueLabel%20%3FEnglish_WikiPedia_article%20%23Show%20data%20in%20this%20order%0A%7B%0A%09%3FWikiData_item_%20wdt%3A" .. p_num .. "%20%3Fvalue%20.%20%23Collecting%20all%20items%20which%20have%20" .. p_num .. "%20data%2C%20from%20whole%20WikiData%20item%20pages%0A%09OPTIONAL%20%7B%3FEnglish_WikiPedia_article%20schema%3Aabout%20%3FWikiData_item_%3B%20schema%3AisPartOf%20%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%20.%7D%20%23If%20collected%20item%20has%20link%20to%20English%20WikiPedia%2C%20show%20that%0A%09SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%20%7D%20%23Show%20label%20in%20this%20language.%20%22en%22%20is%20English.%20%20%20%0A%7D%0ALIMIT%201000 uses]</span>)</li></ul>"
ii = ii + 1
else break
end
end
return result
end
return p
c9e7988e11907e8eee6b61b75b3d2089f2be151f
Template:Infobox country
10
107
213
212
2024-06-03T23:43:44Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<table class="infobox geography vcard" style="width:22em; font-size:88%;"><!--
============================================================
Names
============================================================
-->{{#if:{{{conventional_long_name|}}}{{{native_name|}}}{{{name|}}}
| <tr class="adr">
<th colspan="3" class="mergedtoprow"
style="text-align:center;padding:0.25em 0.33em 0.33em;line-height:1.2em;font-size:1.25em;"><!--
-->{{#if:{{{conventional_long_name|}}}
|<span class=" fn org country-name">{{{conventional_long_name|}}}</span><br/><!--
-->}}<!--
-->{{#if:{{{native_name|}}}{{{name|}}}
|<div style="padding-top:0.25em;"><!--
-->{{br separated entries
|{{{native_name|}}}
|{{#if:{{{name|}}}
|<span class="fn org country-name">{{{name|}}}</span><!--
-->}}}}<!--
--></div><!--
-->}}<!--
-->{{#ifeq:{{{micronation|}}}|yes
|<span class=" fn org">[[Micronation]]</span><!--
-->|}}<!--
--></th>
</tr><!--
-->}}<!--
============================================================
Flag / Coat-of-arms (or other symbol)
============================================================
-->{{#if:{{{image_flag|}}}
|<!----------------------------------------------------
Flag provided, so display it and coat-of-arms (or
other symbol) if provided:
----------------------------------------------------
--><tr class="mergedtoprow">
<td class="maptable" colspan="3" style="text-align:center;padding:0.5em 0;"><!--
------------------------------------------------
Subtable to format coat-of-arms (or symbol)
display. style="text-align:center;"s and "width:auto;"s
are for sake of Internet Explorer.
------------------------------------------------
--><table style="text-align:center;width:100%;background:none;"><!--
-----------Image/s-----------
--><tr>
<td style="text-align:center;{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| {{#if:{{{flag_width|}}} |width:{{{flag_width}}}; |width:58%;<!--(58% as flags usually wider than coats-of-arms/symbols. Also accommodates IE.)-->}}<!--
-->}} vertical-align:middle;"><!--
-->[[File:{{{image_flag}}}|125px|{{yesno |{{{flag_border|}}}|yes=border|blank=border}}|alt={{{alt_flag|}}}|Flag of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}]]<!--
-->{{#if:{{{image_flag2|}}}
| [[File:{{{image_flag2}}}|125px|{{yesno |{{{flag2_border|}}}|yes=border|blank=border}}|alt={{{alt_flag2|}}}]]}}<!--
--></td>
{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| <td style="text-align:center;width:auto;vertical-align:middle;"><!--
-->[[File:{{{image_coat|{{{image_symbol|}}}}}} |{{{symbol_width|85px}}} |alt={{{alt_coat|{{{alt_symbol|}}}}}} |{{{symbol_type|Coat of arms}}} of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}]]<!--
--></td>
}}
</tr><!--
----------Caption/s----------
--><tr>
<td style="text-align:center;font-size:85%;">{{#ifexist:Flag of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} |[[Flag of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} | {{{flag_caption|Banner}}}]] |Banner }}</td>
{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| <td style="text-align:center;font-size:85%;">{{#ifexist:{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} |[[{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} | {{{symbol_type|Coat of arms}}}]] |{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} }}</td>
}}
</tr><!--
------end subtable:------
--></table>
</td>
</tr><!--
-->|<!-----------------------------------------------------
Flag not provided, so display coat-of-arms or other
symbol (if provided):
------------------------------------------------------
-->{{#if:{{{image_coat|}}}{{{image_symbol|}}}
| <tr class="mergedtoprow">
<td class="maptable" colspan="3" style="text-align:center;padding:0.5em 0;"><!--
----------------------------------------------
Subtable to format coat-of-arms (or symbol)
display. style="text-align:center;"s and "width:auto;"s
are for sake of Internet Explorer.
----------------------------------------------
--><table style="text-align:center;width:100%;background:none;"><!--
-----------Image-----------
--><tr>
<td style="text-align:center;width:auto;vertical-align:middle;"><!--
-->[[File:{{{image_coat|{{{image_symbol|}}}}}} |{{{symbol_width|100px}}} |alt={{{alt_coat|{{{alt_symbol|}}}}}} |{{{symbol_type|Coat of arms}}} of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}]]</td>
</tr><!--
----------Caption----------
--><tr>
<td style="text-align:center;font-size:85%;"><!--
-->{{#ifexist:{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} |[[{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}} | {{{symbol_type|Coat of arms}}}]]|{{{symbol_type_article|{{{symbol_type|Coat of arms}}}}}} }}<!--
--></td>
</tr><!--
------end subtable:-------
--></table>
</td>
</tr><!--
-->}}<!--
-->}}<!--
============================================================
Motto
============================================================
-->{{#if:{{{national_motto|}}}{{{motto|}}}
| <tr>
<td colspan="3" style="text-align:center;line-height:1.2em;"><!--
-->'''Motto: '''{{{motto|{{{national_motto|}}}}}}<!--
-->{{#if:{{{englishmotto|}}}|<br/>{{small|{{{englishmotto}}} }} }}</td>
</tr><!--
-->}}<!--
============================================================
Anthem/s
============================================================
-->{{#if:{{{national_anthem|}}}{{{anthem|}}}{{{royal_anthem|}}}
| <tr>
<td class="anthem" colspan="3" style="text-align:center;line-height:1.2em;"><!--
-->{{#if:{{{national_anthem|}}}{{{anthem|}}}
|'''Anthem: '''{{{national_anthem|{{{anthem|}}}}}}
}}<!--
-->{{#if:{{{royal_anthem|}}}
| {{#if:{{{national_anthem|}}}{{{anthem|}}} |<br/>}}<!--
-->'''[[Royal anthem]]: '''{{{royal_anthem}}}<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
Other symbol/s
============================================================
-->{{#if:{{{other_symbol|}}}{{{text_symbol|}}}
| <tr>
<td colspan="3" style="text-align:center;line-height:1.2em;"><!--
-->{{#if:{{{other_symbol_type|}}}{{{text_symbol_type|}}}
| '''{{{other_symbol_type|{{{text_symbol_type|}}}}}}'''<br/>}}<!--
-->{{{other_symbol|}}}{{{text_symbol|}}}</td>
</tr><!--
-->}}<!--
============================================================
Maps
============================================================
-->{{#if:{{{image_map|}}}
| <tr>
<td colspan="3" style="padding:0.6em 0 0.3em;text-align:center;"><!--
-->[[File:{{{image_map}}}|center<!--
-->|{{{map_width|250px}}}<!--
-->|alt={{{alt_map|{{{map_caption|}}}}}}<!--
-->|{{{alt_map|{{{map_caption|Location of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}} }}}}}}}}}}}}}}}<!--
-->]]<!--
--><div style="padding:0.3em;line-height:1.2em;font-size:85%;">{{{map_caption|}}}</div>
</td>
</tr><!--
-->}}<!--
-->{{#if:{{{image_map2|}}}
| <tr class="mergedtoprow">
<td colspan="3" style="padding:0.6em 0 0.3em;text-align:center;"><!--
-->[[File:{{{image_map2}}}|center<!--
-->|{{{map2_width|250px}}}<!--
-->|alt={{{alt_map2|{{{map_caption2|}}}}}}<!--
-->|{{{alt_map2|{{{map_caption2|Location of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}} }}}}}}}}}}}}}}}<!--
-->]]<!--
--><div style="position:relative;top:0.3em;line-height:1.2em;font-size:85%;">{{{map_caption2|}}}</div>
</td>
</tr><!--
-->}}<!--
============================================================
Status
============================================================
-->{{#if:{{{status|}}}
| <tr>
<td colspan="2">'''Status''' </td>
<td>{{{status}}}</td>
</tr><!--
-->}}<!--
============================================================
Location
============================================================
-->{{#if:{{{loctext|}}}
| <tr>
<td colspan="2">'''Location''' </td>
<td>{{{loctext}}}</td>
</tr><!--
-->}}<!--
============================================================
Capital/Admin center; Largest city/ies or settlement/s
============================================================
-->{{#if:{{{capital|}}}{{{admin_center|}}}{{{largest_city|}}}{{{largest_settlement|}}}
| <tr class="mergedtoprow"><!--
-->{{#if:{{{capital|}}}{{{admin_center|}}}
| <td colspan="2"><!--
-->{{#if:{{{capital|}}}
| {{#if:{{{capital_type|}}} |'''{{{capital_type}}}''' |'''Capital'''}}
| {{#if:{{{admin_center_type|}}}|'''{{{admin_center_type|}}}'''|Administrative center}}
}}<!--
-------------------------------------------------
If capital provided, check whether largest_city
or largest_settlement (if provided) equals
"capital", capital or [[capital]]:
-------------------------------------------------
-->{{#ifeq: {{#ifeq:{{{largest_city|}}}{{{largest_settlement|}}}|capital
|capital<!--
-->|{{#switch:{{{capital}}}
| [[{{{largest_city|}}}{{{largest_settlement|}}}]] = capital
| {{{largest_city|}}}{{{largest_settlement|}}} = capital
| not capital
}}<!--
-->}}|capital <!--
(#ifeq:)-->|<!------------------------------------------
capital is largest_city/_settlement:
-------------------------------------------
--><br/>and {{{largest_settlement_type|largest city}}}<!--
--></td><!--
--------Add capital:--------
--><td>{{{capital}}}<!--
---------Add capital's lat/longitude
(if provided):---------
-->{{#if:{{{latd|}}}
|<br/><span style="white-space:nowrap;font-size:85%;"><!--
-->{{coord|{{{latd}}}|{{{latm}}}|{{{latNS}}}<!--
-->|{{{longd}}}|{{{longm}}}|{{{longEW}}}<!--
-->|type:city<!--
-->}}<!--
--></span><!--
-->}}<!--
--></td><!--
(#ifeq:)-->|<!------------------------------------------
capital isn't largest_city/_settlement:
------------------------------------------
--></td><!--
--------Add capital/admin center:--------
--><td>{{#if:{{{capital|}}}|{{{capital|}}}|{{{admin_center|}}}}}<!--
----Add capital/admin center's lat/longitude
(if provided):----
-->{{#if:{{{latd|}}}
|<br/><span style="white-space:nowrap;font-size:85%;"><!--
-->{{coord|{{{latd}}}|{{{latm}}}|{{{latNS}}}<!--
-->|{{{longd}}}|{{{longm}}}|{{{longEW}}}<!--
-->|type:city<!--
-->}}<!--
--></span><!--
-->}}<!--
--></td><!--
--------Add largest_city/_settlement
(if provided):--------
-->{{#if:{{{largest_city|}}}{{{largest_settlement|}}}
| </tr>
<tr class="mergedbottomrow">
<th colspan="2">Largest {{{largest_settlement_type|city}}}</th>
<td>{{{largest_city|{{{largest_settlement|}}}}}}</td><!--
-->}}<!--
(#ifeq:)-->}}<!--
-->|<!-------------------------------------------------
Capital not provided,
so add largest_city/_settlement (if provided):
--------------------------------------------------
-->{{#if:{{{largest_city|}}}{{{largest_settlement|}}}
| <th colspan="2">Largest {{{largest_settlement_type|city}}}</th>
<td>{{{largest_city|{{{largest_settlement|}}}}}}</td><!--
-->}}<!--
-->}}<!--
--></tr><!--
-->}}<!--
============================================================
Languages
============================================================
-->{{#if:{{{official_languages|}}}
| <tr>
<th colspan="2" style="white-space:nowrap;">Official languages</th>
<td>{{{official_languages}}}</td>
</tr><!--
-->{{#if:{{{recognized_languages|{{{recognised_languages|}}}}}}
| <tr class="mergedbottomrow">
<td colspan="2">{{#if:{{{recognized_languages|}}}|Recognized|Recognised}} languages</td>
<td style="vertical-align:middle;">{{{recognized_languages|{{{recognised_languages}}}}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{recognized_national_languages|{{{recognised_national_languages|{{{national_languages|}}}}}}}}}
| <tr>
<td colspan="2">{{#if:{{{recognized_national_languages|}}}|Recognized|Recognised}} national languages</td>
<td style="vertical-align:middle;">{{{recognized_national_languages|{{{recognised_national_languages|{{{national_languages}}}}}}}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{recognized_regional_languages|{{{recognised_regional_languages|{{{regional_languages|}}}}}}}}}
| <tr class="mergedbottomrow">
<td colspan="2">{{#if:{{{recognized_regional_languages|}}}|Recognized|Recognised}} regional languages</td>
<td style="vertical-align:middle;">{{{recognized_regional_languages|{{{recognised_regional_languages|{{{regional_languages}}}}}}}}}</td>
</tr><!--
-->}}<!--
-->}}<!--
-------- Customizable language entries: --------
-->{{#if:{{{languages|}}}
| <tr {{#ifeq:{{{languages2_sub|}}}|yes
|{{#ifeq:{{{languages_sub|}}}|yes |class="mergedrow"|}}
|{{#ifeq:{{{languages_sub|}}}|yes |class="mergedbottomrow"|}}<!--
-->}}>
<{{#ifeq:{{{languages_sub|}}}|yes |td |th}} colspan="2" style="white-space:nowrap;"><!--
-->{{{languages_type}}}<!--
--></{{#ifeq:{{{languages_sub|}}}|yes |td |th}}>
<td>{{{languages}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{languages2|}}}
| <tr {{#ifeq:{{{languages2_sub|}}}|yes |class="mergedbottomrow"|}}>
<{{#ifeq:{{{languages2_sub|}}}|yes |td |th}} colspan="2" style="white-space:nowrap;"><!--
-->{{{languages2_type}}}<!--
--></{{#ifeq:{{{languages2_sub|}}}|yes |td |th}}>
<td>{{{languages2}}}</td>
</tr><!--
-->}}<!--
============================================================
Ethnic groups
============================================================
-->{{#if:{{{ethnic_groups|}}}
| <tr>
<td colspan="2">'''[[Ethnic groups|Ethnic groups]]''' <!--
-->{{#if:{{{ethnic_groups_year|}}} |({{{ethnic_groups_year}}})}}</td>
<td>{{{ethnic_groups}}}</td>
</tr><!--
-->}}<!--
============================================================
Religion
============================================================
-->{{#if:{{{religion|}}}
| <tr>
<th colspan="2">Religion</th>
<td style="vertical-align:middle;">{{{religion}}}</td>
</tr><!--
-->}}<!--
============================================================
Demonym
============================================================
-->{{#if:{{{demonym|}}}
| <tr>
<th colspan="2">Demonym</th>
<td>{{#ifexist:{{{demonym}}} people
| [[{{{demonym}}} people|{{{demonym}}}]]
| {{{demonym}}}<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
Organization type / Membership (geopolitical org)
============================================================
-->{{#if:{{{org_type|}}}
| <tr>
<td colspan="2">'''Type'''</td>
<td>{{{org_type}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{membership|}}}
| <tr>
<td colspan="2"
style="vertical-align:middle;">'''{{{membership_type|Membership}}}'''</td>
<td>{{{membership}}}</td>
</tr><!--
-->}}<!--
============================================================
Government heading(country/territory)
Leaders heading (geopolitical organization)
============================================================
-->{{#if:{{{government_type|}}}
| <tr>
<th colspan="2"><!--
-->{{#if:{{{politics_link|}}}
| [[{{{politics_link}}}|{{#ifeq:{{{micronation|}}}|yes|Organizational structure|Government}}]]<!--
-->| {{#ifexist:Politics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Politics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|{{#ifeq:{{{micronation|}}}|yes|Organizational structure|Government}}]]<!--
-->| {{#ifeq:{{{micronation|}}}|yes|Organizational structure|Government}}<!--
-->}}<!--
-->}}<!--
--></th>
<td>{{{government_type}}}</td>
</tr><!--
-->|<!----------------------------------------------------
No government_type provided, so, if at least one
leader provided, use "Leaders" (geopolitical org)
or "Government" (country/territory):
-----------------------------------------------------
-->{{#if:{{{leader_title1|}}}{{{leader_name1|}}}
| {{#if:{{{name|}}}{{{membership|}}}
<!--template being used for geopolitical org:-->
| <tr><th colspan="3">Leaders</th></tr><!--
<!--template being used for country/territory:
-->| <tr><th colspan="3">Government</th></tr><!--
-->}}<!--
-->}}<!--
-->}}<!--
============================================================
Leaders
============================================================
-->{{#if:{{{leader_title1|}}}
| <tr class="{{#if:{{{leader_title2|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title1}}}</td>
<td>{{{leader_name1}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title2|}}}
| <tr class="{{#if:{{{leader_title3|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title2}}}</td>
<td>{{{leader_name2}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title3|}}}
| <tr class="{{#if:{{{leader_title4|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title3}}}</td>
<td>{{{leader_name3}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title4|}}}
| <tr class="{{#if:{{{leader_title5|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title4}}}</td>
<td>{{{leader_name4}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title5|}}}
| <tr class="{{#if:{{{leader_title6|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title5}}}</td>
<td>{{{leader_name5}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title6|}}}
| <tr class="{{#if:{{{leader_title7|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title6}}}</td>
<td>{{{leader_name6}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title7|}}}
| <tr class="{{#if:{{{leader_title8|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title7}}}</td>
<td>{{{leader_name7}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title8|}}}
| <tr class="{{#if:{{{leader_title9|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title8}}}</td>
<td>{{{leader_name8}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title9|}}}
| <tr class="{{#if:{{{leader_title10|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title9}}}</td>
<td>{{{leader_name9}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title10|}}}
| <tr class="{{#if:{{{leader_title11|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title10}}}</td>
<td>{{{leader_name10}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title11|}}}
| <tr class="{{#if:{{{leader_title12|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title11}}}</td>
<td>{{{leader_name11}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title12|}}}
| <tr class="{{#if:{{{leader_title13|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title12}}}</td>
<td>{{{leader_name12}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title13|}}}
| <tr class="{{#if:{{{leader_title14|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title13}}}</td>
<td>{{{leader_name13}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{leader_title14|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{leader_title14}}}</td>
<td>{{{leader_name14}}}</td>
</tr><!--
-->}}<!--
============================================================
Legislature
============================================================
-->{{#if:{{{legislature|}}}
| <tr>
<th colspan="2">Legislature</th>
<td>{{{legislature}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{upper_house|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">[[Upper house]]</td>
<td>{{{upper_house}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{lower_house|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">[[Lower house]]</td>
<td>{{{lower_house}}}</td>
</tr><!--
-->}}<!--
============================================================
Sovereignty (country/territory)
Establishment (geopolitical organization)
============================================================
-->{{#if:{{{established_event1|}}}{{{sovereignty_type|}}}{{{established|}}}
| <tr {{#if:{{{established_event1|}}} |class="mergedtoprow"}}><!--
----------Sovereignty----------
-->{{#if:{{{sovereignty_type|}}}
| <th colspan="3">{{{sovereignty_type}}}<!--
-->{{#if:{{{sovereignty_note|}}} | {{nobold|{{{sovereignty_note}}} }}}}<!--
--></th><!--
---------Establishment----------
-->| {{#if:{{{established|}}}
| <th colspan="2">Establishment</th>
<td>{{{established}}}</td><!--
-->| <th colspan="3">Establishment</th><!--
-->}}<!--
-->}}<!--
--></tr><!--
-->}}<!--
============================================================
Significant events in country/territory
or organization's establishment
============================================================
-->{{#if:{{{established_event1|}}}
| <tr class="{{#if:{{{established_event2|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event1}}}</td>
<td>{{{established_date1|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event2|}}}
| <tr class="{{#if:{{{established_event3|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event2}}}</td>
<td>{{{established_date2|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event3|}}}
| <tr class="{{#if:{{{established_event4|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event3}}}</td>
<td>{{{established_date3|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event4|}}}
| <tr class="{{#if:{{{established_event5|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event4}}}</td>
<td>{{{established_date4|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event5|}}}
| <tr class="{{#if:{{{established_event6|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event5}}}</td>
<td>{{{established_date5|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event6|}}}
| <tr class="{{#if:{{{established_event7|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event6}}}</td>
<td>{{{established_date6|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event7|}}}
| <tr class="{{#if:{{{established_event8|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event7}}}</td>
<td>{{{established_date7|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event8|}}}
| <tr class="{{#if:{{{established_event9|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event8}}}</td>
<td>{{{established_date8|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event9|}}}
| <tr class="{{#if:{{{established_event10|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event9}}}</td>
<td>{{{established_date9|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event10|}}}
| <tr class="{{#if:{{{established_event11|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event10}}}</td>
<td>{{{established_date10|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event11|}}}
| <tr class="{{#if:{{{established_event12|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event11}}}</td>
<td>{{{established_date11|}}} </td>
</tr><!--
-->}}<!--
-->{{#if:{{{established_event12|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{established_event12}}}</td>
<td>{{{established_date12|}}} </td>
</tr><!--
-->}}<!--
============================================================
Area
(area_label, area_km2, area_label2, area_data2, ...)
============================================================
-->{{#if:{{{area_km2|{{{area_ha|}}}}}}
| <tr class="mergedtoprow">
<th colspan="3"><!--
-->{{#if:{{{area_link|}}}
| [[{{{area_link}}}|Area {{#ifeq:{{{micronation|}}}|yes|claimed|}}]]
| {{#ifexist:Geography of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Geography of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|Area {{#ifeq:{{{micronation|}}}|yes|claimed|}}]]
| Area {{#ifeq:{{{micronation|}}}|yes|claimed|}}<!--
-->}}<!--
-->}}<!--
--></th>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;"><!--
-->{{{area_label|Total}}}<!--
---France-related footnote:-->{{#if:{{{FR_foot4|}}} |{{{FR_foot4}}}}}</td>
<td>{{formatnum:{{{area_km2|{{{area_ha|}}}}}}}} {{#if:{{{area_km2|}}}
|km{{smallsup|2}}
|ha
}}<!--
-->{{#if:{{{area_footnote|}}} |{{{area_footnote}}} }}<!--
-->{{#if:{{{area_rank|}}} | ([[List of countries and dependencies by area|{{{area_rank}}}]]) }}<!--
-->{{#if:{{{area_sq_mi|}}}
|<br/>{{formatnum:{{{area_sq_mi}}}}} sq mi<!--
-->|<br/>{{#if:{{{area_acre|}}}
|{{formatnum:{{{area_acre}}}}} acre{{#ifexpr:{{{area_acre}}}=1||s}}
|{{#if:{{{area_km2|}}}
|{{formatnum:<!--
-->{{#expr:{{{area_km2|}}} div 2.589988110336 round 0}}}} sq mi
|{{formatnum:<!--
-->{{#expr:{{{area_ha|}}} div 0.4046856422 round 0}}}} acres
}}
}}<!--
-->}}</td>
</tr><!--
-->}}<!--
-------------------Percentage water--------------------
-->{{#if:{{{percent_water|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Water (%)</td>
<td>{{{percent_water}}}</td>
</tr><!--
-->}}<!--
------------------Area 2 (customized)-------------------
-->{{#if:{{{area_label2|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{area_label2|}}}</td>
<td>{{{area_data2|}}}</td>
</tr><!--
-->}}<!--
------------------Area 3 (customized)-------------------
-->{{#if:{{{area_label3|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{area_label3|}}}</td>
<td>{{{area_data3|}}}</td>
</tr><!--
-->}}<!--
-----------Areas of France-----------
-->{{#if:{{{FR_metropole|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td colspan="2" style="padding-left:0;">{{{FR_metropole}}}</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> </td>
<td style="padding-left:0;"> • [[Institut Géographique National|IGN]]{{{FR_foot2|}}}</td>
<td>{{formatnum:{{{FR_IGN_area_km2|}}}}} km{{smallsup|2}} ([[List of countries and dependencies by area|{{{FR_IGN_area_rank|}}}]])<!--
-->{{#if:{{{FR_IGN_area_sq_mi|}}}
|<br/>{{formatnum:{{{FR_IGN_area_sq_mi|}}}}}<!--
-->|<br/>{{formatnum:{{#expr:{{{FR_IGN_area_km2|}}} div 2.589988110336 round 0}}}}<!--
-->}} sq mi</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> </td>
<td style="padding-left:0;"> • [[Cadastre]]{{{FR_foot3|}}}</td>
<td>{{formatnum:{{{FR_cadastre_area_km2|}}}}} km{{smallsup|2}} ([[List of countries and dependencies by area|{{{FR_cadastre_area_rank|}}}]])<!--
-->{{#if:{{{FR_cadastre_area_sq_mi|}}}
|<br/>{{formatnum:{{{FR_cadastre_area_sq_mi|}}}}}
|<br/>{{formatnum:{{#expr:{{{FR_cadastre_area_km2|}}} div 2.589988110336 round 0}}}}<!--
-->}} sq mi</td>
</tr><!--
-->}}<!--
============================================================
Population
============================================================
-->{{#if:{{{population_estimate|}}}{{{population_census|}}}{{{FR_metropole_population|}}}
| <tr class="mergedtoprow">
<th colspan="3"><!--
-->{{#if:{{{population_link|}}}
| [[{{{population_link}}}|Population]]<!--
-->| {{#ifexist:Demographics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Demographics of {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|Population]]<!--
-->| Population<!--
-->}}<!--
-->}}<!--
--></th>
</tr><!--
---------------Estimate---------------
-->{{#if:{{{population_estimate|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;"><!--
-->{{#if:{{{population_estimate_year|}}} |{{{population_estimate_year}}} }}<!--
-->estimate</td>
<td>{{{population_estimate}}}<!--
-->{{#if:{{{population_estimate_rank|}}} | ([[List of countries by population|{{{population_estimate_rank}}}]])}}</td>
</tr><!--
-->}}<!--
------------------Population 2 (customized)-------------------
-->{{#if:{{{population_label2|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{population_label2|}}}</td>
<td>{{{population_data2|}}}</td>
</tr><!--
-->}}<!--
------------------Population 3 (customized)-------------------
-->{{#if:{{{population_label3|}}}
| <tr class="mergedrow">
<td> • </td>
<td style="padding-left:0;">{{{population_label3|}}}</td>
<td>{{{population_data3|}}}</td>
</tr><!--
-->}}<!--
----------------Census----------------
-->{{#if:{{{population_census|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;"><!--
-->{{#if:{{{population_census_year|}}} |{{{population_census_year}}} }}<!--
-->census</td>
<td>{{{population_census|}}}<!--
-->{{#if:{{{population_census_rank|}}} | ([[List of countries by population|{{{population_census_rank}}}]])}}</td>
</tr><!--
-->}}<!--
-->}}<!--
-------(France)-------
-->{{#if:{{{FR_metropole_population|}}}
| <tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> </td>
<td colspan="2" style="padding-left:0;">({{{FR_total_population_estimate_year}}})</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Total{{{FR_foot}}}</td>
<td>{{{FR_total_population_estimate}}} ([[List of countries by population in 2005|{{{FR_total_population_estimate_rank}}}]])</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">{{{FR_metropole}}}</td>
<td>{{{FR_metropole_population}}} ([[List of countries by population in 2005|{{{FR_metropole_population_estimate_rank}}}]])</td>
</tr><!--
-->}}<!--
---------------Density----------------
-->{{#if:{{{population_density_km2|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Density<!--
---France-related footnote:-->{{#if:{{{FR_foot5|}}} |{{{FR_foot5}}}}}</td>
<td>{{{population_density_km2|}}}/km{{smallsup|2}}<!--
-->{{#if:{{{pop_den_footnote|}}} |{{{pop_den_footnote|}}}}}<!--
-->{{#if:{{{population_density_rank|}}} | ([[List of sovereign states and dependent territories by population density|{{{population_density_rank}}}]])}}<!--
-->{{#if:{{{population_density_sq_mi|}}}
|<br/>{{formatnum:{{{population_density_sq_mi|}}}}}
|<br/>{{formatnum:{{#expr:{{{population_density_km2|}}} * 2.589988110336 round 1}}}}<!--
-->}}/sq mi</td>
</tr><!--
-->}}<!--
-->{{#if:{{{nummembers|}}}<!--
-->| {{#if:{{{population_estimate|}}}{{{population_census|}}}{{{FR_metropole_population|}}}
| <tr class="mergedbottomrow"> | <tr class="mergedtoprow">}}
<th colspan="2">Population</th>
<td style="vertical-align:middle;">{{{nummembers}}}</td>
</tr><!--
-->}}<!--
============================================================
GDP
============================================================
-----------------PPP-----------------
-->{{#if:{{{GDP_PPP|}}}
| <tr class="mergedtoprow">
<td colspan="2">'''{{#ifeq:{{{micronation|}}}|yes|Claimed|}} [[Gross domestic product|GDP]]''' ([[Purchasing power parity|PPP]])</td>
<td>{{#if:{{{GDP_PPP_year|}}} |{{{GDP_PPP_year}}} }}estimate</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Total</td>
<td>{{{GDP_PPP}}}<!--
-->{{#if:{{{GDP_PPP_rank|}}} | ([[List of countries by GDP (PPP)|{{{GDP_PPP_rank}}}]])}}</td>
</tr><!--
-------(PPP per capita)-------
-->{{#if:{{{GDP_PPP_per_capita|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Per capita</td>
<td>{{{GDP_PPP_per_capita}}}<!--
-->{{#if:{{{GDP_PPP_per_capita_rank|}}} | ([[List of countries by GDP (PPP) per capita|{{{GDP_PPP_per_capita_rank}}}]])}}</td>
</tr><!--
-->}}<!--
-->}}<!--
---------------Nominal---------------
-->{{#if:{{{GDP_nominal|}}}
| <tr class="mergedtoprow">
<td colspan="2">'''{{#ifeq:{{{micronation|}}}|yes|Claimed|}} [[Gross domestic product|GDP]]''' (nominal)</td>
<td>{{#if:{{{GDP_nominal_year|}}} |{{{GDP_nominal_year}}} }}estimate</td>
</tr>
<tr class="mergedrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Total</td>
<td>{{{GDP_nominal}}}<!--
-->{{#if:{{{GDP_nominal_rank|}}} | ([[List of countries by GDP (nominal)|{{{GDP_nominal_rank}}}]])}}</td>
</tr><!--
-------(Nominal per capita)-------
-->{{#if:{{{GDP_nominal_per_capita|}}}
| <tr class="mergedbottomrow">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Per capita</td>
<td>{{{GDP_nominal_per_capita}}}<!--
-->{{#if:{{{GDP_nominal_per_capita_rank|}}} | ([[List of countries by GDP (nominal) per capita|{{{GDP_nominal_per_capita_rank}}}]])}}</td>
</tr><!--
-->}}<!--
-->}}<!--
============================================================
Gini
============================================================
-->{{#if:{{{Gini|}}}
| <tr>
<td colspan="2">'''[[Gini_coefficient|Gini]]'''<!--
-->{{#if:{{{Gini_year|}}} | ({{{Gini_year}}})}}</td><!--
-----Include increase/decrease/steady icon
(if Gini_change provided):-----
--><td>{{#switch:{{{Gini_change|}}}
|increase = {{increaseNegative}} <!--
-->|decrease = {{decreasePositive}} <!--
-->|steady = {{steady}} <!--
-->}}<!--
-------Add Gini (and Gini_ref if supplied):-------
-->{{{Gini}}}{{{Gini_ref|}}}<br/><!--
---------Evaluate and add Gini category:----------
--><span style="white-space:nowrap;"><!--
-->{{#iferror:<!--
-->{{#ifexpr:{{{Gini}}}>100 <!--
-->| {{error|Error: Gini value above 100}}<!--Handled by outer #iferror, not visible to users--><!--
-->| {{#ifexpr:{{{Gini}}}>=60 |{{color|red|very high}}<!--
-->| {{#ifexpr:{{{Gini}}}>=46 <!--
-->| {{color|darkred|high}}<!--
-->| {{#ifexpr:{{{Gini}}}>=30 <!--
-->| {{color|orange|medium}}<!--
-->| {{#ifexpr:{{{Gini}}}>=0 <!--
-->| {{color|forestgreen|low}}<!--
-->| {{error|Error:Gini value below 0}}<!--Handled by outer #iferror, not visible to users--><!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->| {{error|Error: Invalid Gini value}}{{#ifeq: {{NAMESPACE}} | {{ns:0}} | [[Category:Country articles requiring maintenance]] }}<!--
-->}}<!--
--></span><!--
-----------Add Gini_rank (if supplied):----------
-->{{#if:{{{Gini_rank|}}}
|{{·}}[[List of countries by income equality|{{{Gini_rank}}}]]<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
HDI
============================================================
-->{{#if:{{{HDI|}}}
| <tr>
<td colspan="2"><!--
-->'''[[Human Development Index|HDI]]''' <!--
-->{{#if:{{{HDI_year|}}} |({{{HDI_year}}})}}</td><!--
-----Include increase/decrease/steady icon
(if HDI_change provided):-----
--><td>{{#switch:{{{HDI_change|}}}
|increase = {{increase}} <!--
-->|decrease = {{decrease}} <!--
-->|steady = {{steady}} <!--
-->}}<!--
-------Add HDI (and HDI_ref if supplied):-------
-->{{{HDI}}}{{{HDI_ref|}}}<br/><!--
---------Evaluate and add HDI category:---------
--><span style="white-space:nowrap;"><!--
-->{{#iferror:<!--
-->{{#ifexpr:{{{HDI}}}>1 <!--
-->| {{error|Error: HDI value greater than 1}}<!--Handled by outer #iferror, not visible to users--><!--
-->| {{#ifexpr:{{{HDI}}}>0.799 <!--
-->| {{color|darkgreen|very high}}<!--
-->| {{#ifexpr:{{{HDI}}}>0.699 <!--
-->| {{color|forestgreen|high}}<!--
-->| {{#ifexpr:{{{HDI}}}>0.549 <!--
-->| {{color|orange|medium}}<!--
-->| {{#ifexpr:{{{HDI}}}>=0.000<!--
-->| {{color|red|low}}<!--
-->| {{error|Error: HDI value less than 0}}<!--Handled by outer #iferror, not visible to users--><!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
-->| {{error|Error: Invalid HDI value}}{{#ifeq: {{NAMESPACE}} | {{ns:0}} | [[Category:Country articles requiring maintenance]] }}<!--
-->}}<!--
--></span><!--
----------Add HDI_rank (if supplied):-----------
-->{{#if:{{{HDI_rank|}}}
|{{·}}[[List of countries by Human Development Index|{{{HDI_rank}}}]]<!--
-->}}<!--
--></td>
</tr><!--
-->}}<!--
============================================================
Currency
============================================================
-->{{#if:{{{currency|}}}
| <tr>
<th colspan="2" style="vertical-align:middle;">{{#ifeq:{{{micronation|}}}|yes|Purported currency|Currency}}</th>
<td>{{{currency}}} {{#if:{{{currency_code|}}} |([[ISO 4217|{{{currency_code}}}]])}}</td>
</tr><!--
-->}}<!--
============================================================
Time zone
============================================================
-->{{#if:{{{time_zone|}}}{{{utc_offset|}}}
| <tr {{#if:{{{utc_offset_DST|}}}{{{DST_note|}}} |class="mergedtoprow"}}>
<th colspan="2">Time zone</th>
<td>{{{time_zone|}}} <!--
-->{{#if:{{{utc_offset|}}}
|{{nowrap|([[Coordinated Universal Time|UTC]]{{{utc_offset}}})}}<!--
-->}}</td>
</tr><!--
-->{{#if:{{{time_zone_DST|}}}{{{utc_offset_DST|}}}
| <tr class="{{#if:{{{DST_note|}}} |mergedrow |mergedbottomrow}}">
<td style="width:1.0em;padding:0 0 0 0.6em;"> • </td>
<td style="padding-left:0;">Summer ([[Daylight saving time|DST]])</td>
<td>{{{DST|{{{time_zone_DST|}}}}}} ([[Coordinated Universal Time|UTC]]{{{utc_offset_DST}}})</td>
</tr><!--
-->}}<!--
-->}}<!--
-->{{#if:{{{DST_note|}}}
| <tr class="mergedbottomrow">
<td colspan="2"></td>
<td>{{{DST_note}}}</td>
</tr><!--
-->}}<!--
============================================================
Antipodes
============================================================
-->{{#if:{{{antipodes|}}}
| <tr>
<th colspan="2">[[Antipodes]]</th>
<td>{{{antipodes}}}</td>
</tr><!--
-->}}<!--
============================================================
Date format
============================================================
-->{{#if:{{{date_format|}}}
| <tr>
<th colspan="2">Date format</th>
<td>{{{date_format}}}</td>
</tr><!--
-->}}<!--
============================================================
Rule of the road
============================================================
-->{{#if:{{{drives_on|}}}
| <tr>
<th colspan="2">[[Right- and left-hand traffic|Drives on the]]</th>
<td>{{lcfirst:{{{drives_on}}}}}</td>
</tr><!--
-->}}<!--
============================================================
Calling code
============================================================
-->{{#if:{{{calling_code|}}}
| <tr>
<th colspan="2"><!--
-->{{#ifexist:Telephone numbers in {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}
| [[Telephone numbers in {{{linking_name|{{{common_name|{{{name|{{PAGENAME}}}}}}}}}}}|Calling code]]
| Calling code
}}</th>
<td>{{{calling_code}}}</td>
</tr><!--
-->}}<!--
============================================================
Patron saint/s
============================================================
-->{{#if:{{{patron_saint|{{{patron_saints|}}}}}}
| <tr>
<th colspan="2" >[[Patron saint]]{{#if:{{{patron_saints|}}}|s}}</th>
<td>{{{patron_saint|{{{patron_saints}}}}}}</td>
</tr><!--
-->}}<!--
============================================================
ISO 3166 code
============================================================
-->{{#switch:{{{iso3166code|}}}
|omit = <!--(do nothing)-->
| = <!--if iso3166code is not supplied:
-->{{#if:{{{common_name|}}}
| {{#ifexist:Template:ISO 3166 code {{{common_name|}}}
| <tr class="mergedtoprow">
<th colspan="2" style="white-space:nowrap;">[[ISO 3166|ISO 3166 code]]</th>
<td>[[ISO 3166-2:{{ISO 3166 code {{{common_name}}}}}|{{ISO 3166 code {{{common_name}}}}}]]</td>
</tr>
}}
}}
|#default = <tr>
<th colspan="2" style="white-space:nowrap;">[[ISO 3166|ISO 3166 code]]</th>
<td>[[ISO 3166-2:{{uc:{{{iso3166code}}}}}|{{uc:{{{iso3166code}}}}}]]</td>
</tr>
}}<!--
============================================================
Internet TLD
============================================================
-->{{#if:{{{cctld|}}}
| <tr>
<th colspan="2">[[Country code top-level domain|Internet TLD]]</th>
<td>{{{cctld}}}</td>
</tr><!--
-->}}<!--
============================================================
Official website (geopolitical organization)
============================================================
-->{{#if:{{{official_website|}}}
| <tr>
<td colspan="3" style="text-align:center;line-height:11pt;"><!--
-->'''Website'''<br/>{{{official_website}}}</td>
</tr><!--
-->}}<!--
============================================================
Bottom map
============================================================
-->{{#if:{{{image_map3|}}}
| <tr class="mergedtoprow">
<td colspan="3" style="padding:0.6em 0 0.3em;text-align:center;"><!--
-->[[File:{{{image_map3}}}|center<!--
-->|{{{map3_width|250px}}}<!--
-->|alt={{{alt_map3|}}}<!--
-->|Location of {{{common_name|{{{name|{{{linking_name|{{PAGENAME}}}}}}}}}}}<!--
-->]]<!--
--><div style="position:relative;top:0.3em;font-size:85%;">{{{map_caption3|}}}</div>
</td>
</tr><!--
-->}}<!--
================================================================
Footnotes
================================================================
--------------------------------
Lettered
--------------------------------
-->{{#if:{{{footnote_a|}}}
| <tr style="font-size:85%;">
<td style="text-align:right;">{{lower|0.3em|<sup>a.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_a}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_b|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_c|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>b.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_b}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_c|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_d|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>c.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_c}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_d|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_e|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>d.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_d}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_e|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_f|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>e.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_e}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_f|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_g|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup><big>f.</big></sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_f}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_g|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote_h|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>g.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_g}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote_h|}}}
| <tr style="font-size:85%;" class="mergedbottomrow">
<td style="text-align:right;">{{lower|0.3em|<sup><big>h.</big></sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote_h}}}</td>
</tr><!--
-->}}<!--
--------------------------------
Numbered
--------------------------------
-->{{#if:{{{footnote1|}}}
| <tr style="font-size:85%;">
<td style="text-align:right;">{{lower|0.3em|<sup>1.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote1}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote2|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote3|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>2.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote2}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote3|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote4|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>3.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote3}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote4|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote5|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>4.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote4}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote5|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote6|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>5.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote5}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote6|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote7|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>6.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote6}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote7|}}}
| <tr style="font-size:85%;" class="{{#if:{{{footnote8|}}} |mergedrow |mergedbottomrow}}">
<td style="text-align:right;">{{lower|0.3em|<sup>7.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote7}}}</td>
</tr><!--
-->}}<!--
-->{{#if:{{{footnote8|}}}
| <tr style="font-size:85%;" class="mergedbottomrow">
<td style="text-align:right;">{{lower|0.3em|<sup>8.</sup>}}</td>
<td colspan="2" style="padding-left:0;">{{{footnote8}}}</td>
</tr><!--
-->}}<!--
--------------------------------
Non-specific
--------------------------------
-->{{#if:{{{footnotes|}}}
| <tr>
<td colspan="3" style="font-size:85%;">{{{footnotes}}}</td>
</tr><!--
-->}}<!--
============================================================
Navbar
============================================================
-->{{#if:{{{navbar|}}}
| <tr class="mergedtoprow noprint">
<td colspan="3" style="text-align:center;">{{navbar|{{{navbar|}}}}}</td>
</tr><!--
-->}}<!--
--></table><noinclude>
{{documentation}}
</noinclude>
7befd87413bc2404be605b7053b2cc7ce12fc16d
Template:Plainlist
10
108
215
214
2024-06-03T23:43:45Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div class="plainlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
cd6b6a5ffb75fb4f0a5b0f4e3a9aabbbf2213353
Template:Br separated entries
10
109
217
216
2024-06-03T23:43:48Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
{{documentation}}
</noinclude>
2019f7fc383259e70d66e43cbd97a43d20889f1b
Module:Separated entries
828
110
219
218
2024-06-03T23:43:48Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux". The starting parameter can also be specified.
local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}
function p._main(args)
local separator = args.separator
-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
and mw.text.decode(args.separator) or ''
local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
-- Discard values before the starting parameter.
local start = tonumber(args.start)
if start then
for i = 1, start - 1 do args[i] = nil end
end
-- Discard named parameters.
local values = compressSparseArray(args)
return mw.text.listToText(values, separator, conjunction)
end
local function makeInvokeFunction(separator, conjunction, first)
return function (frame)
local args = require('Module:Arguments').getArgs(frame)
args.separator = separator or args.separator
args.conjunction = conjunction or args.conjunction
args.first = first or args.first
return p._main(args)
end
end
p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
return p
e80231ff3de01afd7f62a94e0a34dc1e67504085
Template:Hatnote
10
111
221
220
2024-06-03T23:43:48Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote|hatnote}}</includeonly><noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
4a1d1028d07c9056022807a96051e1c82cf2a1c7
Module:Hatnote
828
112
223
222
2024-06-03T23:43:49Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote --
-- --
-- This module produces hatnote links and links to related articles. It --
-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local yesno -- lazily initialise [[Module:Yesno]]
local formatLink -- lazily initialise [[Module:Format link]] ._formatLink
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
function p.defaultClasses(inline)
-- Provides the default hatnote classes as a space-separated string; useful
-- for hatnote-manipulation modules like [[Module:Hatnote group]].
return
(inline == 1 and 'hatnote-inline' or 'hatnote') .. ' ' ..
'navigation-not-searchable'
end
function p.disambiguate(page, disambiguator)
-- Formats a page title with a disambiguation parenthetical,
-- i.e. "Example" → "Example (disambiguation)".
checkType('disambiguate', 1, page, 'string')
checkType('disambiguate', 2, disambiguator, 'string', true)
disambiguator = disambiguator or 'disambiguation'
return mw.ustring.format('%s (%s)', page, disambiguator)
end
function p.findNamespaceId(link, removeColon)
-- Finds the namespace id (namespace number) of a link or a pagename. This
-- function will not work if the link is enclosed in double brackets. Colons
-- are trimmed from the start of the link by default. To skip colon
-- trimming, set the removeColon parameter to false.
checkType('findNamespaceId', 1, link, 'string')
checkType('findNamespaceId', 2, removeColon, 'boolean', true)
if removeColon ~= false then
link = removeInitialColon(link)
end
local namespace = link:match('^(.-):')
if namespace then
local nsTable = mw.site.namespaces[namespace]
if nsTable then
return nsTable.id
end
end
return 0
end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
-- Formats an error message to be returned to wikitext. If
-- addTrackingCategory is not false after being returned from
-- [[Module:Yesno]], and if we are not on a talk page, a tracking category
-- is added.
checkType('makeWikitextError', 1, msg, 'string')
checkType('makeWikitextError', 2, helpLink, 'string', true)
yesno = require('Module:Yesno')
title = title or mw.title.getCurrentTitle()
-- Make the help link text.
local helpText
if helpLink then
helpText = ' ([[' .. helpLink .. '|help]])'
else
helpText = ''
end
-- Make the category text.
local category
if not title.isTalkPage -- Don't categorise talk pages
and title.namespace ~= 2 -- Don't categorise userspace
and yesno(addTrackingCategory) ~= false -- Allow opting out
then
category = 'Hatnote templates with errors'
category = mw.ustring.format(
'[[%s:%s]]',
mw.site.namespaces[14].name,
category
)
else
category = ''
end
return mw.ustring.format(
'<strong class="error">Error: %s%s.</strong>%s',
msg,
helpText,
category
)
end
local curNs = mw.title.getCurrentTitle().namespace
p.missingTargetCat =
--Default missing target category, exported for use in related modules
((curNs == 0) or (curNs == 14)) and
'Articles with hatnote templates targeting a nonexistent page' or nil
function p.quote(title)
--Wraps titles in quotation marks. If the title starts/ends with a quotation
--mark, kerns that side as with {{-'}}
local quotationMarks = {
["'"]=true, ['"']=true, ['“']=true, ["‘"]=true, ['”']=true, ["’"]=true
}
local quoteLeft, quoteRight = -- Test if start/end are quotation marks
quotationMarks[string.sub(title, 1, 1)],
quotationMarks[string.sub(title, -1, -1)]
if quoteLeft or quoteRight then
title = mw.html.create("span"):wikitext(title)
end
if quoteLeft then title:css("padding-left", "0.15em") end
if quoteRight then title:css("padding-right", "0.15em") end
return '"' .. tostring(title) .. '"'
end
--------------------------------------------------------------------------------
-- Hatnote
--
-- Produces standard hatnote text. Implements the {{hatnote}} template.
--------------------------------------------------------------------------------
function p.hatnote(frame)
local args = getArgs(frame)
local s = args[1]
if not s then
return p.makeWikitextError(
'no text specified',
'Template:Hatnote#Errors',
args.category
)
end
return p._hatnote(s, {
extraclasses = args.extraclasses,
selfref = args.selfref
})
end
function p._hatnote(s, options)
checkType('_hatnote', 1, s, 'string')
checkType('_hatnote', 2, options, 'table', true)
options = options or {}
local inline = options.inline
local hatnote = mw.html.create(inline == 1 and 'span' or 'div')
local extraclasses
if type(options.extraclasses) == 'string' then
extraclasses = options.extraclasses
end
hatnote
:attr('role', 'note')
:addClass(p.defaultClasses(inline))
:addClass(extraclasses)
:addClass(options.selfref and 'selfref' or nil)
:wikitext(s)
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Module:Hatnote/styles.css' }
} .. tostring(hatnote)
end
return p
3ae1ed7094c5005ca0896395ec9a587287a0bef1
Module:Hatnote/styles.css
828
113
225
224
2024-06-03T23:43:49Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp|small=y}} */
.hatnote {
font-style: italic;
}
/* Limit structure CSS to divs because of [[Module:Hatnote inline]] */
div.hatnote {
/* @noflip */
padding-left: 1.6em;
margin-bottom: 0.5em;
}
.hatnote i {
font-style: normal;
}
/* The templatestyles element inserts a link element before hatnotes.
* TODO: Remove link if/when WMF resolves T200206 */
.hatnote + link + .hatnote {
margin-top: -0.5em;
}
44680ffd6e888866df2cdfa0341af9c7b97da94c
Template:Unbulleted list
10
114
227
226
2024-06-03T23:43:49Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|unbulleted}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
89815a491d3e05b20af446e34cda13f13c25fb4f
Template:Small
10
115
229
228
2024-06-03T23:43:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="font-size:85%;">{{{1}}}</span><includeonly>{{SAFESUBST:#if:{{{1|}}}||[[Category:Pages using small with an empty input parameter]]}}</includeonly><noinclude>
{{Documentation}}<!--Categories and interwikis go in the /doc sub-page.-->
</noinclude>
76d3535c2917cc3bfb1b032506073faa15e1a480
Template:Smaller
10
116
231
230
2024-06-03T23:43:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="font-size:90%;">{{{1}}}</span><noinclude>
{{Documentation|Template:Resize/doc}}
{{/TemplateData}}
</noinclude>
80dc8a92243bfd5e11e2a27670f9d10384234809
Template:Infobox former country
10
117
233
232
2024-06-03T23:43:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox country]]
{{r from merger}}
d1a087676a1c1fbf80c00fb58bf83cff967f7de4
Template:Nobold
10
118
235
234
2024-06-03T23:43:57Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<templatestyles src="Nobold/styles.css"/><span class="nobold">{{{1}}}</span><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
9c92b5951772bb26ca0fbe9256418b65e47700dd
Template:Nobold/styles.css
10
119
237
236
2024-06-03T23:43:57Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp-template}} */
/* Styling for Template:Nobold */
.nobold {
font-weight: normal;
}
83e5f0adacf8c7984251f1fd9d11ed82ebaadf03
Template:Cob
10
120
239
238
2024-06-03T23:43:57Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Collapse bottom]]
414179c04bb216d1df3d18596af4673de10bb273
Template:Color
10
121
241
240
2024-06-03T23:43:57Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="color:{{{1|}}}">{{{2|{{{1|}}}}}}</span><noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude>
f12cd387c0d5c11494a7182b7538cc3292eb3a4a
Template:Country data Austria
10
122
243
242
2024-06-03T23:43:58Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Austria
| flag alias = Flag of Austria.svg
| flag alias-empire = Flag of the Habsburg Monarchy.svg
| flag alias-state = Flag of Austria (state).svg
| flag alias-war = Austria-Hungary-flag-1869-1914-naval-1786-1869-merchant.svg
| flag alias-army = Flag of Austria (state).svg
| flag alias-air force = Flag of Austria (state).svg
| link alias-army = Austrian Land Forces
| flag alias-naval = Flag of Austria (state).svg
| link alias-naval = Austrian Federal Police
| link alias-air force = Austrian Air Force
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = empire
| var2 = state
| var3 = war
| redir1 = AUT
| redir2 = Archduchy of Austria
| related1 = Austria-Hungary
</noinclude>
}}
213d34b9a00caf4938ae1326ee6c9131597e56a5
Template:Country data Belgium
10
123
245
244
2024-06-03T23:43:58Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Belgium
| flag alias = Flag of Belgium (civil).svg <!-- Not the official flag of Belgium, but see talk page for objections to using the state flag as the default -->
| flag alias-government = Government Ensign of Belgium.svg
| flag alias-state = Flag of Belgium.svg<!-- The official flag of Belgium. See talk page for why it is not the default. -->
| flag alias-1830 = Flag of Belgium (1830).svg
| flag alias-1858 = Royal ensign of Belgium (1858).svg
| flag alias-army = Flag of the Belgian Land Component.svg
| link alias-army = Belgian Land Component
| flag alias-naval = Naval Ensign of Belgium.svg
| link alias-naval = Belgian Navy
| flag alias-air force = Air Force Ensign of Belgium.svg
| link alias-air force = Belgian Air Component
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = state
| var2 = government
| var3 = 1830
| var4 = 1858
| redir1 = BEL
</noinclude>
}}
cc537c026b20572666d6ff4ef53ec8e87b409f1a
Template:Country data Bulgaria
10
124
247
246
2024-06-03T23:43:58Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Bulgaria
| flag alias = Flag of Bulgaria.svg
| flag alias-1878 = Flag of Bulgaria.svg
| flag alias-1944 = Flag of the Bulgarian Homeland Front.svg
| flag alias-1946 = Flag of Bulgaria (1948-1967).svg
| flag alias-1967 = Flag of Bulgaria (1967-1971).svg
| flag alias-1971 = Flag of Bulgaria (1971 – 1990).svg
| flag alias-naval = Naval Ensign of Bulgaria.svg
| link alias-naval = Bulgarian Navy
| flag alias-army = War flag of Bulgaria.svg
| link alias-army = Bulgarian Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1878
| var2 = 1944
| var3 = 1946
| var4 = 1967
| var5 = 1971
| redir1 = BGR
| redir2 = BUL
| related1 = Kingdom of Bulgaria
</noinclude>
}}
d15d83d7bdbe6d98649ded54ef78ea43f02de8b1
Template:Country data Croatia
10
125
249
248
2024-06-03T23:43:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Croatia
| flag alias = Flag of Croatia.svg
| flag alias-civil = Civil Ensign of Croatia.svg
| flag alias-1990 = Flag of Croatia (1990).svg
| flag alias-naval = Naval ensign of Croatia.svg
| link alias-naval = Croatian Navy
| flag alias-air force = Flag of the Croatian Air Force.svg
| link alias-air force = Croatian Air Force
| link alias-military = Republic of Croatia Armed Forces
| link alias-army = Croatian Army
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = civil
| var2 = 1990
| redir1 = HRV
| redir2 = CRO
| related1 = Independent State of Croatia
| related2 = SR Croatia
| related3 = PR Croatia
| related4 = Kingdom of Croatia (Habsburg)
</noinclude>
}}
3991eb420481f822c83d7800b9243b97de54fda3
Template:Country data Cyprus
10
126
251
250
2024-06-03T23:43:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Cyprus
| flag alias = Flag of Cyprus.svg
| flag alias-1878 = Flag of United Kingdom.svg
| flag alias-1881 = Flag of Cyprus (1881–1922).svg
| flag alias-colonial = Blue Ensign of Cyprus (1922).svg
| flag alias-April 1960 = Flag of Cyprus (1960).svg
| flag alias-1960 = Flag of Cyprus (1960–2006).svg
| link alias-army = Cypriot Ground Forces
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
| altlink = {{{altlink|}}}
<noinclude>
| redir1 = CYP
| var1 = 1878
| var2 = 1881
| var3 = colonial
| var4 = April 1960
| var5 = 1960
</noinclude>
}}
8c0f70f8f83686528fce061c39e2cbf1e3188056
Template:Country data Czech Republic
10
127
253
252
2024-06-03T23:43:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Czech Republic
| flag alias = Flag of the Czech Republic.svg
| link alias-air force = Czech Air Force
| link alias-army = Czech Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
<noinclude>
| redir1 = CZE
| redir2 = Czechia
| related1 = Czechoslovakia
| related2 = Bohemia
| related3 = Slovakia
</noinclude>
}}
3e070640007888ede5f8b7b2816f45c0a46556ae
Template:Country data Denmark
10
128
255
254
2024-06-03T23:43:59Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Denmark
| flag alias = Flag of Denmark.svg
| flag alias-state = Flag of Denmark (state).svg
| border-state =
| flag alias-naval = Naval Ensign of Denmark.svg
| border-naval =
| link alias-naval = Royal Danish Navy
| link alias-army = Royal Danish Army
| flag alias-army = Flag of Denmark (state).svg
| link alias-air force = Royal Danish Air Force
| flag alias-air force = Flag of Denmark (state).svg
| border-army =
| border-air force =
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = state
| redir1 = DNK
| redir2 = DEN
| redir3 = Kingdom of Denmark
</noinclude>
}}
f2c26342f0ba6e7d828ef884f57d88da1e297710
Template:Country data EU
10
129
257
256
2024-06-03T23:44:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Country data European Union]]<noinclude>[[Category: Country data redirects|EU]]</noinclude>
2267fd165f54795dc23946ea44a5a5f233a3d041
Template:Country data Estonia
10
130
259
258
2024-06-03T23:44:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Estonia
| flag alias = Flag of Estonia.svg
| flag alias-naval = Naval Ensign of Estonia.svg
| link alias-naval = Estonian Navy
| flag alias-army=Flag of Estonian Land Forces.svg
| link alias-army=Estonian Land Forces
| flag alias-air force =Flag of the Estonia Air Force.png
| link alias-air force = Estonian Air Force
| border-naval =
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| redir1 = EST
| related1 = Estonian SSR
</noinclude>
}}
3726e0a4c43e691ee6f87ca6788f620f6eeb8733
Template:Country data European Union
10
131
261
260
2024-06-03T23:44:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = European Union
| flag alias = Flag of Europe.svg
| shortname alias = EU
| size = {{{size|}}}
| name = {{{name|}}}
<noinclude>
| redir1 = EU
| related1 = Europe
</noinclude>
}}
e20448f1167e7e5bfebd941a507b6ef6c3a4650e
Template:Country data Finland
10
132
263
262
2024-06-03T23:44:01Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Finland
| flag alias = Flag of Finland.svg
| flag alias-grand duchy = Flag of Russia.svg
| flag alias-1809 = Flag of Russia.svg
| flag alias-1917 = Flag of Finland 1918 (state).svg
| flag alias-1918 = Flag of Finland (1918-1920).svg
| flag alias-1920 = Flag of Finland.svg
| flag alias-state = Flag of Finland (state).svg
| flag alias-state-1918 = Flag of Finland 1918-1920 (State).svg
| flag alias-state-1920 = Flag of Finland 1920-1978 (State).svg
| flag alias-naval = Military Flag of Finland.svg
| border-naval =
| flag alias-naval-1918 = Flag of Finland 1918-1920 (Military).svg
| border-naval-1918 =
| flag alias-naval-1920 = Flag of Finland 1920-1978 (Military).svg
| border-naval-1920 =
| link alias-naval = Finnish Navy
| flag alias-navy = Naval Jack of Finland.svg
| link alias-navy = Finnish Navy
| link alias-air force = Finnish Air Force
| link alias-army = Finnish Army
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = grand duchy
| var2 = 1809
| var3 = 1917
| var4 = 1918
| var5 = 1920
| var6 = state
| var7 = state-1918
| var8 = state-1920
| var9 = naval-1918
| var10 = naval-1920
| redir1 = FIN
| related1 = Åland
</noinclude>
}}
2b032fd45283601b72bcda96d62ac73a3218f5ec
Template:Country data France
10
133
265
264
2024-06-03T23:44:01Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = France
| flag alias = Flag of France.svg
| flag alias-1790 = Flag of France (1790–1794).svg
| flag alias-1794 = Flag of France (1794–1815, 1830–1958).svg
| flag alias-1814 = Flag of the Kingdom of France (1814-1830).svg
| flag alias-1830 = Flag of France (1794–1815, 1830–1958).svg
| flag alias-1848 = Drapeau france 1848.svg
| flag alias-1848a = Drapeau france 1848.svg
| flag alias-1848b = Flag of France (1794–1815, 1830–1958).svg
| flag alias-naval = Civil and Naval Ensign of France.svg
| flag alias-naval-1790 = Flag of French-Navy-Revolution.svg
| link alias-air force = French Air and Space Force
| flag alias-coast guard = French Maritime Gendarmerie racing stripe.svg
| border-coast guard =
| link alias-coast guard = French Maritime Gendarmerie
| link alias-army = French Army
| link alias-naval = French Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1790
| var2 = 1794
| var3 = 1814
| var4 = 1830
| var5 = 1848a
| var6 = 1848b
| var7 = naval-1790
| redir1 = FRA
| related1 = Kingdom of France
| related2 = Free France
</noinclude>
}}
3cd3f88394128ba48bd5b03e9c8ef76c96a5580a
Template:Country data Germany
10
134
267
266
2024-06-03T23:44:01Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{safesubst<noinclude />: {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Germany
| flag alias = Flag of Germany.svg
| flag alias-1866 = Flag of the German Empire.svg
| link alias-1866 = German Empire
| flag alias-empire = Flag of the German Empire.svg
| link alias-empire = German Empire
| flag alias-1919 = Flag of Germany (3-2 aspect ratio).svg
| link alias-1919 = Weimar Republic
| flag alias-Weimar = Flag of Germany (3-2 aspect ratio).svg
| link alias-Weimar = Weimar Republic
| flag alias-1933 = Flag of Germany (1933-1935).svg
| flag alias-1935 = Flag of Germany (1935–1945).svg
| link alias-1935 = Nazi Germany
| flag alias-Nazi = Flag of Germany (1935–1945).svg
| link alias-Nazi = Nazi Germany
| flag alias-1946 = Merchant flag of Germany (1946–1949).svg
| border-1946 =
| flag alias-1949 = Flag of Germany.svg
| flag alias-EUA = German Olympic flag (1959-1968).svg
| flag alias-gold = Flag of West Germany; Flag of Germany (1990–1996).svg
| flag alias-state = Flag of Germany (state).svg
| flag alias-naval = Naval Ensign of Germany.svg
| border-naval =
| link alias-naval = German Navy
| flag alias-coast guard=German Federal Coast Guard racing stripe.svg
| border-coast guard=
| link alias-coast guard=German Federal Coast Guard
| flag alias-army = Colour of Germany.svg
| flag alias-air force =Flag of Germany (state).svg
| link alias-air force = German Air Force
| link alias-army = German Army
| border-army=
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1866
| var2 = empire
| var3 = 1919
| var4 = Weimar
| var5 = 1933
| var6 = 1935
| var7 = Nazi
| var8 = 1946
| var9 = 1949
| var10 = EUA
| var11 = gold
| var12 = state
| redir1 = DEU
| redir2 = GER
| related1 = German Empire
| related2 = Weimar Republic
| related3 = Nazi Germany
| related4 = Allied-occupied Germany
| related5 = East Germany
| related6 = West Germany
</noinclude>
}}
695461d74d0879d3c7c0a36011cd79fc74bc1a79
Template:Country data Gibraltar
10
135
269
268
2024-06-03T23:44:02Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Gibraltar
| flag alias = Flag of Gibraltar.svg
| flag alias-ensign = Government Ensign of Gibraltar.svg
| flag alias-ensign1875 = Government Ensign of Gibraltar (1875–1921).svg
| flag alias-ensign1921 = Government Ensign of Gibraltar (1921–1939).svg
| flag alias-ensign1939 = Government Ensign of Gibraltar (1939–1999).svg
| flag alias-civil = Civil Ensign of Gibraltar.svg
| flag alias-governor = Flag of the Governor of Gibraltar.svg
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = ensign
| var2 = ensign1875
| var3 = ensign1921
| var4 = ensign1939
| var5 = civil
| var6 = governor
| redir1 = GIB
</noinclude>
}}
22381d7b7d5e72ccc3cc576015bd5ca1fd5643aa
Template:Country data Greece
10
136
271
270
2024-06-03T23:44:02Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Greece
| flag alias = Flag of Greece.svg
| flag alias-old = Flag of Greece (1822-1978).svg
| flag alias-1970 = Flag of Greece (1970-1975).svg
| flag alias-royal = State flag of Greece (1863–1924;1935–73).svg
| flag alias-otto = Flag of Greece (1822-1978).svg
| flag alias-army = Hellenic Army War Flag.svg
| link alias-army = Hellenic Army
| border-army=
| flag alias-air force=Fin Flash of Greece.svg
| link alias-air force=Hellenic Air Force
| flag alias-royalnavy = Naval Ensign of Kingdom of Greece.svg
| link alias-naval = Hellenic Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = old
| var2 = 1970
| var3 = royal
| var4 = otto
| var5 = royalnavy
| redir1 = GRC
| redir2 = GRE
</noinclude>
}}
88865b55fb862298e0dd45ac49300af78799eef9
Template:Country data Hungary
10
137
273
272
2024-06-03T23:44:02Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Hungary
| flag alias = Flag of Hungary.svg
| flag alias-1848 = Flag of Hungary (1848-1849, 1867-1869).svg
| flag alias-1849 = Flag of the Habsburg Monarchy.svg
| flag alias-1867 = Flag of Hungary (1848-1849, 1867-1869).svg
| flag alias-1869 = Flag of Hungary (1869-1874).svg
| flag alias-1874 = Flag of Hungary (1874-1896).svg
| flag alias-1896 = Flag of Hungary (1896-1915; angels).svg
| flag alias-1915 = Flag of Hungary (1915-1918; angels).svg
| flag alias-1918 = Flag of Hungary (1918-1919).svg
| flag alias-1919 = Flag of Hungary (1919).svg
| flag alias-1920 = Flag of Hungary (1915-1918, 1919-1946).svg
| flag alias-1946 = Flag of Hungary (1946-1949, 1956-1957; 1-2 aspect ratio).svg
| flag alias-1949 = Flag of Hungary (1949-1956; 1-2 aspect ratio).svg
| flag alias-1956 = Flag of Hungary (1946-1949, 1956-1957; 1-2 aspect ratio).svg
| flag alias-1957 = Flag of Hungary.svg
| flag alias-state = Flag of Hungary with arms (state).svg
| flag alias-civil = Civil Ensign of Hungary.svg
| flag alias-naval = Naval Ensign of Hungary.svg
| link alias-naval = Hungarian Defence Forces
| flag alias-military = Flag of the Hungarian Defence Forces.svg
| link alias-military = Hungarian Defence Forces
| flag alias-army = War Flag of Hungary.svg
| link alias-army = Hungarian Ground Forces
| link alias-air force = Hungarian Air Force
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1848
| var2 = 1849
| var3 = 1867
| var4 = 1869
| var5 = 1874
| var6 = 1896
| var7 = 1915
| var8 = 1918
| var9 = 1919
| var10 = 1920
| var11 = 1946
| var12 = 1949
| var13 = 1956
| var14 = 1957
| var15 = state
| var16 = civil
| redir1 = HUN
| related1 = Austria-Hungary
</noinclude>
}}
1854fdb5575461006dfcc628d241ee1fa2e46524
Template:Country data Ireland
10
138
275
274
2024-06-03T23:44:03Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = {{#if:{{{altvar|}}}|Ireland|{{#if:{{{variant|}}}|Ireland|Republic of Ireland}}}}
| shortname alias = Ireland
| flag alias = Flag of Ireland.svg
| flag alias-1783 = Saint Patrick's Saltire.svg
| flag alias-4prov = Four Provinces Flag.svg
| flag alias-green = Green harp flag of Ireland.svg
| flag alias-football = Saint Patrick's Saltire.svg
| link alias-football = Ireland national football team (1882–1950)
| flag alias-hockey = Flag of Ireland hockey team.svg
| flag alias-field hockey = Flag of Ireland hockey team.svg
| {{#ifeq:{{{altlink}}}|A national rugby union team|link alias-rugby union|empty}} = Ireland Wolfhounds
| flag alias-rugby union = IRFU flag.svg
| flag alias-rugby sevens = IRFU flag.svg
| flag alias-rugby league = Four Provinces Flag.svg
| flag alias-cricket = Cricket Ireland flag.svg
| link alias-cricket = Ireland {{{mw|}}} {{{age|}}} cricket team
| flag alias-quidditch = Flag of Quidditch Ireland.svg
| flag alias-air force=Flag of the Irish Air Corps.svg
| link alias-air force=Irish Air Corps
| link alias-naval=Irish Naval Service
| flag alias-military=Flag_of_the_Irish_Defence_Forces.svg
| link alias-military=Irish Defence Forces
| flag alias-army=Flag of the Irish Defence Forces.svg
| link alias-army=Irish Army
| flag alias-navy=Irish Naval Service Colour.svg
| link alias-navy=Irish Naval Service
| flag alias-coast guard=Coast Guard Flag (Ireland).svg
| link alias-coast guard=Irish Coast Guard
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1783
| var2 = green
| var3 = 4prov
| var4 = football
| var5 = rugby union
| var6 = hockey
| var7 = cricket
| redir1 = IRE
| redir2 = EIR
| related1 = Republic of Ireland
| related2 = Southern Ireland
| related3 = Kingdom of Ireland
| related4 = Lordship of Ireland
| related5 = Irish Free State
</noinclude>
}}
b01702e783a55449392d3f0a58bf81be9c0d65a3
Template:Country data Italy
10
139
277
276
2024-06-03T23:44:03Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Italy
| flag alias = Flag of Italy.svg
| flag alias-1861 = Flag of Italy (1861–1946).svg
| flag alias-1943 = War flag of the Italian Social Republic.svg
| flag alias-2003 = Flag of Italy (2003–2006).svg
| flag alias-civil = Civil Ensign of Italy.svg
| flag alias-naval = Naval Ensign of Italy.svg
| link alias-naval = Italian Navy
| link alias-air force = Italian Air Force
| link alias-army = Italian Army
| link alias-roller hockey = Italy {{{mw}}} national roller hockey team
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
<noinclude>
| var1 = 1861
| var2 = 1943
| var4 = 2003
| var5 = civil
| redir1 = ITA
| related1 = Kingdom of Italy
| related2 = Italian Social Republic
| related3 = Napoleonic Italy
</noinclude>
}}
7535bd036cd745a55e39b2641ada76af06ed1c74
Template:Country data Latvia
10
140
279
278
2024-06-03T23:44:03Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Latvia
| flag alias = Flag of Latvia.svg
| flag alias-naval = Naval Ensign of Latvia.svg
| link alias-naval = Latvian Naval Forces
| link alias-army = Latvian Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| redir1 = LVA
| redir2 = LAT
| related1 = Latvian SSR
</noinclude>
}}
27faf443f0aadbad015306331fc0b6b2d24b4f3d
Template:Country data Lithuania
10
141
281
280
2024-06-03T23:44:04Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Lithuania
| flag alias = Flag of Lithuania.svg
| flag alias-1918 = Flag of Lithuania 1918-1940.svg
| flag alias-1988 = Flag of Lithuania (1988-2004).svg
| flag alias-naval = Naval Ensign of Lithuania.svg
| link alias-naval = Lithuanian Naval Force
| flag alias-military=Flag of the Lithuanian Armed Forces.png
| link alias-military=Lithuanian Armed Forces
| flag alias-army = Flag of the Lithuanian Army.svg
| link alias-army = Lithuanian Land Force
| flag alias-navy=Flag of Lithuania (state).svg
| link alias-navy = Lithuanian Naval Force
| flag alias-air force=Air Force Ensign of Lithuania.svg
| link alias-air force=Lithuanian Air Force
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1918
| var2 = 1988
| redir1 = LTU
| related1 = Lithuanian SSR
</noinclude>
}}
ff73a63b7cb85165f1f72854a062d92b4a488078
Template:Country data Luxembourg
10
142
283
282
2024-06-03T23:44:04Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Luxembourg
| flag alias = Flag of Luxembourg.svg
| flag alias-civil = Civil Ensign of Luxembourg.svg
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| redir1 = LUX
| var1 = civil
</noinclude>
}}
9c76f01b95d0d97baea7583cf7d8cad58336978b
Template:Country data Malta
10
143
285
284
2024-06-03T23:44:04Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Malta
| flag alias = Flag of Malta.svg
| flag alias-1875 = Flag of Malta (1875–1898).svg
| flag alias-1898 = Flag of Malta (1898–1923).svg
| flag alias-1923 = Flag of Malta (1923–1943).svg
| flag alias-1943 = Flag of Malta (1943–1964).svg
| flag alias-colonial = Flag of Malta (1943-1964).svg <!-- deprecated, but in use -->
| flag alias-civil = Civil Ensign of Malta.svg
| link alias-naval = Maritime Squadron of the Armed Forces of Malta
| link alias-navy = Maritime Squadron of the Armed Forces of Malta
| flag alias-navy =Naval Jack of Malta.svg
| flag alias-1814 = 19th Century Flag of Malta.svg
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1875
| var2 = 1898
| var3 = 1923
| var4 = 1943
| var5 = civil
| var6 = 1814
| redir1 = MLT
| related1 = Sovereign Military Order of Malta
</noinclude>
}}
b6af438432589b7057b3ad7df55d465baaee1f7e
Template:Country data Netherlands
10
144
287
286
2024-06-03T23:44:05Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Netherlands
| flag alias = Flag of the Netherlands.svg
| flag alias-prinsengeus = Naval Jack of the Netherlands.svg
| flag alias-army =Flag of the Royal Netherlands Army.svg
| flag alias-air force=Flag of the Royal Netherlands Air Force.svg
| link alias-air force= Royal Netherlands Air Force
| link alias-army= Royal Netherlands Army
| link alias-naval = Royal Netherlands Navy
| flag alias-navy = Naval Jack of the Netherlands.svg
| link alias-navy=Royal Netherlands Navy
| flag alias-marines = Naval Jack of the Netherlands.svg
| link alias-marines = Netherlands Marine Corps
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = prinsengeus
| redir1 = NLD
| redir2 = NED
| redir3 = The Netherlands
| related1 = Kingdom of the Netherlands
| related2 = Dutch Republic
| related3 = Batavian Republic
</noinclude>
}}
1c723f169b6e9824c190beea044f0bdf8852db76
Template:Country data Poland
10
145
289
288
2024-06-03T23:44:05Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Poland
| flag alias = Flag of Poland.svg
| flag alias-state = State Flag of Poland.svg
| flag alias-1815 = Flag of the Congress of Poland.svg
| flag alias-1919 = Flag of Poland (1919-1928).svg
| flag alias-1928 = Flag of Poland (1928–1980).svg
| flag alias-1955 = Flag of Poland (with coat of arms, 1955-1980).svg
| flag alias-1980 = Flag of Poland (with coat of arms, 1980-1990).svg
| flag alias-1990 = Flag of Poland (with coat of arms).svg
| flag alias-naval = Naval Ensign of Poland.svg
| border-naval =
| flag alias-naval-1919 = Naval Ensign of IIRP v1.svg
| border-naval-1919 =
| flag alias-naval-1946 = Naval Ensign of PRL v1.svg
| border-naval-1946 =
| flag alias-naval-auxiliary = Flaga pomocniczych jednostek pływających Polskiej Marynarki Wojennej.svg
| flag alias-naval-auxiliary-1955 = POL Bandera pjp PRL v1.svg
| link alias-naval = Polish Navy
| flag alias-marines = Flag of the Polish Land Forces.svg
| border-marines =
| link alias-marines = Polish 7th Coastal Defense Brigade
| flag alias-air force = PL air force flag IIIRP.svg
| border-air force =
| link alias-air force = Polish Air Force
| flag alias-army = Flag of the Polish Land Forces.svg
| border-army =
| link alias-army = Polish Land Forces
| size = {{{size|}}}
| size flag alias-naval = 25px
| size flag alias-naval-1919 = 25px
| size flag alias-naval-1946 = 25px
| size flag alias-air force = 25px
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = state
| var2 = 1815
| var3 = 1919
| var4 = 1928
| var5 = 1955
| var6 = 1980
| var7 = 1990
| var10 = naval-1919
| var11 = naval-1946
| var12 = naval-auxiliary
| var13 = naval-auxiliary-1955
| redir1 = POL
</noinclude>
}}
a16d1a4e3a8508f5a6de25926082743251e3d2c9
Template:Country data Portugal
10
146
291
290
2024-06-03T23:44:05Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Portugal
| flag alias = Flag of Portugal.svg
| flag alias-1248 = PortugueseFlag1248.svg
| flag alias-1385 = PortugueseFlag1385.svg
| flag alias-1495 = Flag Portugal (1495).svg
| flag alias-1578 = Flag Portugal (1578).svg
| flag alias-1640 = Flag Portugal (1640).svg
| flag alias-1707 = Flag Portugal (1707).svg
| flag alias-1750 = Flag of Portugal (1750).svg
| flag alias-1816 = Flag of the United Kingdom of Portugal, Brazil, and the Algarves.svg
| flag alias-1830 = Flag Portugal (1830).svg
| flag alias-civil = Flag Portugal sea (1830).svg
| flag alias-air force=Portugal Air force fin flash.svg
| flag alias-army = Military flag of Portugal.svg
| link alias-air force = Portuguese Air Force
| link alias-army = Portuguese Army
| link alias-naval = Portuguese Navy
| flag alias-navy=Naval Jack of Portugal.svg
| link alias-navy = Portuguese Navy
| flag alias-marines=Naval Jack of Portugal.svg
| link alias-marines=Portuguese Marine Corps
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1248
| var2 = 1385
| var3 = 1495
| var4 = 1578
| var5 = 1640
| var6 = 1707
| var7 = 1750
| var8 = 1816
| var9 = 1830
| var13 = civil
| redir1 = PRT
| redir2 = POR
| related1 = Portuguese Empire
</noinclude>
}}
208ba0708db45e46bb27b8b9f46d8c0b7b4bb9ed
Template:Country data Romania
10
147
293
292
2024-06-03T23:44:06Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Romania
| flag alias = Flag of Romania.svg
| flag alias-1859 = Flag of the United Principalities of Wallachia and Moldavia (1859 - 1862).svg
| flag alias-1862 = Flag of the United Principalities of Romania (1862–1866).svg
| flag alias-1866 = Flag of Romania.svg
| flag alias-1948 = Flag of Romania (1948-1952).svg
| flag alias-1952 = Flag of Romania (1952-1965).svg
| flag alias-1965 = Flag of Romania (1965-1989).svg
| link alias-naval = Romanian Naval Forces
| flag alias-naval = Flag of the Romanian Naval Forces (Obverse).svg
| flag alias-air force = Flag of the Romanian Air Force (obverse).svg
| link alias-air force = Romanian Air Force
| flag alias-army = Flag of the Romanian Land Forces (Obverse).svg
| link alias-army = Romanian Land Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1859
| var2 = 1862
| var3 = 1866
| var4 = 1948
| var5 = 1952
| var6 = 1965
| redir1 = ROU
| redir2 = ROM
| related1 = Kingdom of Romania
</noinclude>
}}
5bf99c82ac26e215940efeab11d1dcc923a024bb
Template:Country data Slovakia
10
148
295
294
2024-06-03T23:44:06Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Slovakia
| flag alias = Flag of Slovakia.svg
| flag alias-1939 = Flag of Slovakia (1939–1945).svg
| flag alias-1938 = Flag of Slovakia (1939–1945).svg
| link alias-army = Ground Forces of the Slovak Republic{{!}}Slovak Ground Forces
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1939
| redir1 = SVK
| related1 = Czechoslovakia
</noinclude>
}}
4168cd2bbdeddd074275b89e8ec936288edb3960
Template:Country data Slovenia
10
149
297
296
2024-06-03T23:44:06Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Slovenia
| flag alias = Flag of Slovenia.svg
| link alias-army = Slovenian Ground Force
| link alias-military=Slovenian Armed Forces
| flag alias-military=Flag of the Slovenian Armed Forces.svg
| flag alias-naval=Naval Jack of Slovenia.svg
| link alias-naval=Slovenian Navy
| link-alias-navy=Slovenian Navy
| size = {{{size|}}}
| variant = {{{variant|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
<noinclude>
| redir1 = SVN
| redir2 = SLO
| related1 = SR Slovenia
</noinclude>
}}
68574d7f8429700e25b2100ce323c396d0954025
Template:Country data Spain
10
150
299
298
2024-06-03T23:44:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Spain
| flag alias = Flag of Spain.svg
| flag alias-1506 = Flag of Cross of Burgundy.svg
| flag alias-1701 = Bandera de España 1701-1748.svg
| flag alias-1748 = Bandera de España 1748-1785.svg
| flag alias-1785 = Flag of Spain (1785–1873, 1875–1931).svg
| flag alias-1873 = Flag of the First Spanish Republic.svg
| flag alias-1874 = Flag of Spain (1785–1873, 1875–1931).svg
| flag alias-1931 = Flag of Spain (1931–1939).svg
| flag alias-1936 = Bandera del bando nacional 1936-1938.svg
| flag alias-1938 = Flag of Spain (1938–1945).svg
| flag alias-1945 = Flag of Spain (1945–1977).svg
| flag alias-1977 = Flag of Spain (1977–1981).svg
| flag alias-civil = Flag of Spain (Civil).svg
| flag alias-civil-1785 = BandMercante1785.svg
| flag alias-navy=Naval Jack of Spain.svg
| link alias-navy=Spanish Navy
| flag alias-marines=Naval Jack of Spain.svg
| link alias-marines=Spanish Navy Marines
| link alias-army = Spanish Army
| link alias-naval = Spanish Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1506
| var2 = 1701
| var3 = 1748
| var4 = 1785
| var5 = 1873
| var6 = 1874
| var7 = 1931
| var8 = 1936
| var9 = 1938
| var10 = 1945
| var11 = 1977
| var12 = civil
| var13 = civil-1785
| redir1 = ESP
| redir2 = SPA
| related1 = Spanish Republic
| related2 = Spanish State
| related3=Francoist Spain
</noinclude>
}}
16bb8834fbab635236c00b6308d1ae53ba87a122
Template:Country data Sweden
10
151
301
300
2024-06-03T23:44:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Sweden
| flag alias = Flag of Sweden.svg
| flag alias-army = Naval Ensign of Sweden.svg
| flag alias-air force =Naval Ensign of Sweden.svg
| flag alias-1562 = Sweden-Flag-1562.svg
| border-1562 =
| flag alias-1818 = Swedish and Norwegian merchant flag 1818-1844.svg
| flag alias-1844 = Swedish civil ensign (1844–1905).svg
| flag alias-naval = Naval Ensign of Sweden.svg
| flag alias-naval-1844 = Naval Ensign of Sweden (1844-1905).svg
| flag alias-naval-1815 = Swedish and Norwegian naval ensign (1815-1844).svg
| link alias-army = Swedish Army
| border-army=
| border-air force=
| link alias-air force = Swedish Air Force
| border-naval =
| link alias-naval = Swedish Navy
| size = {{{size|}}}
| name = {{{name|}}}
| altlink = {{{altlink|}}}
| altvar = {{{altvar|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1562
| var2 = 1818
| var3 = 1844
| var4 = naval-1844
| var5 = naval-1815
| redir1 = SWE
</noinclude>
}}
e5a616c0b56047a0767d5a0f26e072dc89214911
Template:Country data United Kingdom
10
152
303
302
2024-06-03T23:44:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = United Kingdom
| flag alias = Flag of the United Kingdom.svg
| flag alias-civil = Civil Ensign of the United Kingdom.svg
| flag alias-civil-air = Civil Air Ensign of the United Kingdom.svg
| flag alias-government = Government Ensign of the United Kingdom.svg
| flag alias-naval = Naval Ensign of the United Kingdom.svg
| flag alias-naval-RFA = British-Royal-Fleet-Auxiliary-Ensign.svg
| flag alias-naval-RMAS = British Royal Maritime Auxiliary Ensign.svg
| flag alias-naval-GS = Government Service Ensign.svg
| flag alias-naval-RNLI = Flag of the Royal National Lifeboat Institution.svg
| link alias-naval-RNLI = Royal National Lifeboat Institution
| flag alias-1707 = Flag of Great Britain (1707–1800).svg
| link alias-naval-1707 = Royal Navy
| flag alias-naval-reserve = Naval Ensign of the United Kingdom.svg
| flag alias-naval-merchant = Civil Ensign of the United Kingdom.svg
| link alias-naval = {{#switch:{{{variant|}}}|naval-RFA|RFA=Royal Fleet Auxiliary|naval-RMAS|RMAS=Royal Maritime Auxiliary Service|naval-RNLI|RNLI=Royal National Lifeboat Institution|naval-reserve|reserve=Royal Naval Reserve|naval-merchant|merchant=Merchant Navy (United Kingdom){{!}}Merchant Navy|#default=Royal Navy}}
| flag alias-naval-1707 = Naval ensign of Great Britain (1707–1800).svg
| flag alias-air force = Ensign of the Royal Air Force.svg
| link alias-air force = Royal Air Force
| flag alias-army = Flag of the British Army.svg
| link alias-army = British Army
| flag alias-military = Flag of the United Kingdom (3-5).svg
| link alias-military = British Armed Forces
| flag alias-marines = Flag of the Royal Marines.svg
| link alias-marines = Corps of Royal Marines
| flag alias-coast guard = Flag of Her Majesty's Coastguard.svg
| link alias-coast guard = Her Majesty's Coastguard
| size = {{{size|}}}
| name = {{#ifeq:{{{name|}}}|Britain|United Kingdom|{{{name|}}}}}
| altlink = {{{altlink|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = civil
| var2 = government
| var3 = naval-RFA
| var4 = naval-RMAS
| var5 = naval-RNLI
| var6 = 1707
| var7 = civil-air
| redir1 = UK
| redir2 = U.K.
| redir3 = the United Kingdom
| related1 = Great Britain
| related2 = Kingdom of Great Britain
| related3 = British Empire
| related4 = United Kingdom of Great Britain and Ireland
| related5 = Kingdom of England
| related6 = Kingdom of Scotland
</noinclude>
}}
d86d62f4e23882357d8b0cfe71f84472ec148f3f
Template:Flagcountry
10
153
305
304
2024-06-03T23:44:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{country data {{{1}}}|flagcountry/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}|name={{{name|}}}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flagcountry template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flagcountry]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | name | size | variant }}<noinclude>{{documentation}}</noinclude>
8e77099d5f28ae1a07d27fb07c9fac8684bd56cf
Template:Flagcountry/core
10
154
307
306
2024-06-03T23:44:08Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="datasortkey" data-sort-value="{{{sortkey|{{{shortname alias|{{{alias}}}}}}}}}"><!--
--><span class="flagicon"><!--
-->[[File:{{{flag alias-{{{variant}}}|{{{flag alias}}}}}}|<!--
-->{{#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|<!--
-->{{{border-{{{variant}}}|{{{border|border}}}}}} |<!--
-->alt=|<!--
-->link=]] <!--
-->{{#switch:{{{flag alias}}}|Flag of Switzerland.svg|Flag of the Vatican City.svg= }}<!--
-->{{#ifeq:{{{alias}}}|Nepal| }}<!--
--></span>[[{{{link alias-{{{variant}}}|{{{alias}}}}}}|<!--
-->{{#if:{{{name|}}}|{{{name}}}|{{{shortname alias|{{{alias}}}}}}}}]]<!--
--></span><noinclude>{{documentation}}</noinclude>
824af0b0d24c27a4f8444a4c761fda2d6a68ff4f
Template:Flagicon
10
155
309
308
2024-06-03T23:44:08Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{safesubst<noinclude />:#ifeq: {{Yesno-no|{{{noredlink|}}}}}|yes<noinclude><!--
--></noinclude>|<noinclude><!--
#Check for existence of Template: Country data foo before invoking it
--></noinclude>{{safesubst<noinclude />:#ifexist: Template: Country data {{{1|}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It exists, so proceed
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
--></noinclude>|<noinclude><!--
# It doesn't exist, so do nothing
--></noinclude>}}<noinclude><!--
--></noinclude>|<noinclude><!--
# DEFAULT call Template: Country data {{{1|}}}
# with no prior checks
--></noinclude>{{country data {{{1|}}}|flagicon/core|variant={{{variant|{{{2|}}}}}}|size={{{size|}}}}}<noinclude><!--
# Track use where "Template:Country data Foo" does not exist
--></noinclude>{{safesubst<noinclude />:#ifexist: Template:Country data {{{1|}}}||{{safesubst<noinclude />:namespace detect showall
| 1 =
| 2 = [[Category:Flagicons with missing country data templates]]
| user = 1
| talk = 1
| other = 2
}}}}<noinclude><!--
--></noinclude>}}</includeonly>{{safesubst<noinclude />:#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flagicon template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flagicon]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | noredlink | size | variant }}<noinclude>
{{Documentation}}
</noinclude>
4ba00e607bb28194908c631e424736dd64374684
Template:Flagicon/core
10
156
311
310
2024-06-03T23:44:09Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="flagicon">[[File:{{{flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{flag alias|}}}|{{{flag alias}}}|Flag placeholder.svg}}}}}|{{safesubst<noinclude />:#if:{{{size|}}}|{{{size}}}|{{{size flag alias-{{{variant}}}|{{safesubst<noinclude />:#if:{{{variant|}}}|23x15px|{{{size flag alias|23x15px}}}}}}}}}}|{{{border-{{{variant}}}|{{{border|border}}}}}} |alt={{{alias}}}|link={{{alias}}}]]</span><noinclude>{{documentation}}</noinclude>
14677aa18a0f6a866112637a51ba28adf4dd4bbe
Template:Hidden begin
10
157
313
312
2024-06-03T23:44:09Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><div class="mw-collapsible {{#ifeq:{{{showhide|}}}{{{toggle|}}}|left|mw-collapsible-leftside-toggle}} {{#if:{{{expanded|}}} | |mw-collapsed}} {{{class|}}}" style="box-sizing:border-box;width:{{{width|100%}}};font-size:95%;padding:4px;border:{{{border|none}}};{{{style|}}}"><!--
--><div style="font-size:100%;line-height:1.6;font-weight:bold;background:{{{bg1|transparent}}};text-align:{{{ta1|left}}};{{{extra1|}}};{{{titlestyle|{{{headercss|}}}}}}">{{{header|}}}{{{title|}}}</div><!--
--><div class="mw-collapsible-content" style="background:{{{bg2|transparent}}};text-align:{{{ta2|left}}};{{{extra2|}}};{{{bodystyle|{{{contentstyle|{{{contentcss|}}}}}}}}}"></includeonly><noinclude>
{{hatnote|Templates {{noredirect|Template:Begin hidden|Begin hidden}}, {{noredirect|Template:Start hidden|Start hidden}} and {{noredirect|Template:Start hidden section|Start hidden section}} redirect here.}}
{{Documentation}}
</noinclude>
d2b26de163bb16c4fb6f3768180b0fc8e894343e
Template:Hidden end
10
158
315
314
2024-06-03T23:44:09Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<noinclude>{{hatnote|Templates {{noredirect|Template:End hidden|End hidden}} and {{noredirect|Template:End hidden section|End hidden section}} redirect here.}}<div><div></noinclude><!--
--></div></div><!--
--><noinclude>{{Documentation|Template:Hidden begin/doc}}</noinclude>
2f3def935d96317afd11ab0e072d64fd91d9c575
Template:Hlist
10
159
317
316
2024-06-03T23:44:10Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:list|horizontal}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
9e3824c2e3c0e0dbef2f37556ac0b994987fecf9
Template:Increase
10
160
319
318
2024-06-03T23:44:10Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
[[File:Increase2.svg|{{{size|11px}}}|alt={{{1|Increase}}}|link=|{{{1|Increase}}}]]<noinclude>
{{documentation}}
</noinclude>
dac0cb099f2bf8616e0649249f7e4593a2bf54bd
Template:Infobox country/doc
10
161
321
320
2024-06-03T23:44:12Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{{nested|no}}}|no|{{documentation subpage}}{{hatnote|{{tl|Infobox geopolitical organisation}} and {{tl|Infobox former country}} redirect here; related parameters and examples are included below.}}}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Coordinates|Module:Check for unknown parameters}}
This infobox template is used to generate an infobox for the right-hand side of two specific types of article: on a country or territory, or on a geopolitical organisation. Parameter syntax and examples are detailed in the collapsed sections immediately below.
__FORCETOC__
== Syntax ==
<!---------------------- Country/territory use ---------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Country or territory}}
<pre style="overflow:auto;">
{{Infobox country
|micronation = <!--yes if a micronation-->
|conventional_long_name = <!--Formal or official full name of the country in English-->
|native_name = <!--Country's name (usually full name) in its native language, hence in italics (double quotemarks)-->
|common_name = <!--Common name in English (used for wikilinks, captions, and to produce a default iso3166 code)-->
|status = <!--Status of country, especially useful for micronations-->
|image_flag = <!--e.g. Flag of country.svg-->
|alt_flag = <!--alt text for flag (text shown when pointer hovers over flag)-->
|flag_border = <!--set to no to disable border around the flag-->
|image_flag2 = <!--e.g. Second-flag of country.svg-->
|alt_flag2 = <!--alt text for second flag-->
|flag2_border = <!--set to no to disable border around the flag-->
|image_coat = <!--e.g. Coat of arms of country.svg-->
|alt_coat = <!--alt text for coat of arms-->
|symbol_type = <!--emblem, seal, etc (if not a coat of arms)-->
|national_motto = <!--in inverted commas and wikilinked if link exists-->
|englishmotto = <!--English language version of motto-->
|national_anthem = <!--in inverted commas and wikilinked if link exists-->
|royal_anthem = <!--in inverted commas and wikilinked if link exists-->
|other_symbol_type = <!--Use if a further symbol exists, e.g. hymn-->
|other_symbol =
|image_map = <!--e.g. LocationCountry.svg-->
|loctext = <!--text description of location of country-->
|alt_map = <!--alt text for map-->
|map_caption = <!--Caption to place below map-->
|image_map2 = <!--Another map, if required-->
|alt_map2 = <!--alt text for second map-->
|map_caption2 = <!--Caption to place below second map-->
|capital = <!--Name of country/territory's capital, wikilinked if link exists-->
|coordinates = <!-- Coordinates for capital, using {{tl|coord}} -->
|largest_city = <!--Name of country/territory's largest city. Use "capital" (without quotation marks) if it's the capital.-->
|largest_settlement_type = <!--Type of settlement if largest settlement not a city-->
|largest_settlement = <!--Name of largest settlement-->
|official_languages = <!--Languages recognised in legislation, constitution, etc-->
|national_languages = <!--Country/territory-wide languages recognised but not necessarily in country/territory-wide law, etc-->
|regional_languages = <!--Languages recognised or associated with particular regions within the country/territory-->
|languages_type = <!--Use to specify a further type of language, if not official, national or regional-->
|languages = <!--Languages of the further type-->
|languages_sub = <!--Is this further type of language a sub-item of the previous non-sub type? ("yes" or "no")-->
|languages2_type = <!--Another further type of language-->
|languages2 = <!--Languages of this second further type-->
|languages2_sub = <!--Is the second alternative type of languages a sub-item of the previous non-sub type? ("yes" or "no")-->
|ethnic_groups = <!--List/breakdown of ethnic groups within the country/territory-->
|ethnic_groups_year = <!--Year of ethnic groups data (if provided)-->
|ethnic_groups_ref = <!--(for any ref/s to associate with ethnic groups data)-->
|religion = <!--Religion-->
|religion_year = <!--Year of religion data (if provided)-->
|religion_ref = <!--(for any ref/s to associate with religion data)-->
|demonym = <!--Term/s describing those associated with the country/territory (e.g. "Belgian" for the country Belgium)-->
|government_type = <!--(often a compound multi-wikilinked term, e.g. "Federal semi-presidential constitutional republic", etc)-->
|leader_title1 = <!--(for a country, usually the head of state's (wikilinked) title, e.g. "President", "Monarch")-->
|leader_name1 =
|leader_title2 = <!--(could be "Vice President", otherwise "Prime Minster", etc, etc)-->
|leader_name2 =
|leader_title14 = <!--(up to 14 distinct leaders may be included)-->
|leader_name14 =
|legislature = <!--Name of the country/territory's governing body, e.g. "Parliament", "Congress", etc-->
|upper_house = <!--Name of governing body's upper house, if given (e.g. "Senate")-->
|lower_house = <!--Name of governing body's lower house, if given (e.g. "Chamber of Deputies")-->
|sovereignty_type = <!--Brief description of country/territory's status ("Independence [from...]", "Autonomous province [of...]", etc)-->
|sovereignty_note =
|established_event1 = <!--First key event in history of country/territory's status or formation-->
|established_date1 = <!--Date of first key event-->
|established_event2 = <!--Second key event-->
|established_date2 = <!--Date of second key event-->
|established_event13 = <!--(up to 13 distinct events may be included)-->
|established_date13 =
|area_rank =
|area = <!--Major area size (in [[Template:convert]] either km2 or sqmi first)-->
|area_km2 = <!--Major area size (in square km)-->
|area_sq_mi = <!--Area in square mi (requires area_km2)-->
|area_footnote = <!--Optional footnote for area-->
|percent_water =
|area_label = <!--Label under "Area" (default is "Total")-->
|area_label2 = <!--Label below area_label (optional)-->
|area_data2 = <!--Text after area_label2 (optional)-->
|population_estimate =
|population_estimate_rank =
|population_estimate_year =
|population_census =
|population_census_year =
|population_density_km2 =
|population_density_sq_mi =
|population_density_rank =
|nummembers = <!--An alternative to population for micronation-->
|GDP_PPP = <!--(Gross Domestic Product from Purchasing Power Parity)-->
|GDP_PPP_rank =
|GDP_PPP_year =
|GDP_PPP_per_capita =
|GDP_PPP_per_capita_rank =
|GDP_nominal =
|GDP_nominal_rank =
|GDP_nominal_year =
|GDP_nominal_per_capita =
|GDP_nominal_per_capita_rank =
|Gini = <!--(Gini measure of income inequality; input number only; valid values are between 0 and 100)-->
|Gini_ref = <!--(for any ref/s to associate with Gini number)-->
|Gini_rank =
|Gini_year =
|HDI_year = <!-- Please use the year to which the data refers, not the publication year-->
|HDI = <!--(Human Development Index; input number only; valid values are between 0 and 1)-->
|HDI_change = <!--increase/decrease/steady; rank change from previous year-->
|HDI_rank =
|HDI_ref = <!--(for any ref/s to associate with HDI number)-->
|currency = <!--Name/s of currency/ies used in country/territory-->
|currency_code = <!--ISO 4217 code/s for currency/ies (each usually three capital letters)-->
|time_zone = <!--e.g. GMT, PST, AST, etc, etc (wikilinked if possible)-->
|utc_offset = <!--in the form "+N", where N is number of hours offset-->
|time_zone_DST = <!--Link to DST (Daylight Saving Time) used, otherwise leave empty-->
|utc_offset_DST = <!--in the form "+N", where N is number of hours offset-->
|DST_note = <!--Optional note regarding DST use-->
|antipodes = <!--Place/s exactly on the opposite side of the world to country/territory-->
|date_format = <!--all-numeric date format and era, such as [[Common Era|CE]], [[Anno Domini|AD]], [[Hijri year|AH]], etc.; e.g. {{abbr|yyyy|year}}-{{abbr|mm|month}}-{{abbr|dd|day}} ([[Anno Domini|AD]]) -->
|electricity = <!--e.g. "230 V–50 Hz"-->
|drives_on = <!--"right" or "left" (side of road)-->
|cctld = <!--Internet country code top-level domain identifier (e.g. [[.br]], [[.de]], etc)
|iso3166code = <!--ISO code only; no extra text. Use to override default from common_name parameter above; omit using "omit".-->
|calling_code = <!--e.g. [[+1]], [[+531]], [[+44]], etc-->
|patron_saint = <!--Use patron_saints for multiple-->
|image_map3 = <!--Optional third map position, e.g. for use with reference to footnotes below it-->
|alt_map3 = <!--alt text for third map position-->
|footnote_a = <!--For any footnote <sup>a</sup> used above-->
|footnote_b = <!--For any footnote <sup>b</sup> used above-->
|footnote_h = <!--For any footnote <sup>h</sup> used above-->
|footnotes = <!--For any generic non-numbered footnotes-->
}}
</pre>
{{hidden begin |toggle=leftlink |title=France-specific parameters}}
Note: Now redundant.
<pre>
|metropole =
|metropole_area =
|metropole_area_rank =
|metropole_area_magnitude =
|metropole_areami² =
|metropole_population =
|metropole_population_estimate_rank =
|foot =
|foot2 =
|foot3 =
|foot4 =
|foot5 =
</pre>
{{hidden end}}<!--(France-specific parameters)-->
{{smaller|* If, on a particular page, the default widths provided for the flag and coat-of-arms/symbol images produce an unsatisfactory result, use ''flag_width'' (as % or px) to specify the width to be used for the flag image; the remaining width is then assigned to the coat-of-arms/symbol (if included).}}
{{hidden end}}
<!------------------------- Geopolitical use -------------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Geopolitical organization}}
<pre style="overflow:auto;">
{{Infobox geopolitical organization
|name = <!-- (in English) -->
|native_name = <!-- Long-form name in native or any/all non-English languages -->
|linking_name = <!-- For wikilinks, if diff from name -->
|image_flag = <!-- Flag image's filename -->
|alt_flag = <!-- alt text for flag-->
|flag_border = <!--set to no to disable border around the flag-->
|symbol_type = <!-- Symbol, Emblem, Logo, etc. -->
|image_symbol = <!-- Symbol image's filename -->
|alt_symbol = <!-- alt text for symbol -->
|symbol_width = <!-- Symbol image's width (default 85px) -->
|motto = <!-- "[motto]" -->
|englishmotto = <!--English language version of motto-->
|anthem = <!-- ''[anthem name]'' -->
|text_symbol_type = <!-- for other types of text symbol -->
|text_symbol = <!-- e.g. ''[hymn name]'' -->
|image_map = <!-- Map image's filename -->
|loctext = <!--text description of location of organization-->
|alt_map = <!-- alt text for map image -->
|map_width = <!-- Map image's width (default 250px) -->
|map_caption =
|org_type = <!-- e.g. Trade bloc -->
|membership_type = <!-- (default "Membership") -->
|membership = <!-- Type/s and/or number/s of members -->
|admin_center_type = <!-- e.g. "Administrative center" (default) -->
|admin_center = <!-- Location/s of administrative center/s -->
|languages_type = <!-- e.g. "[[Official language]]s" (default) -->
|languages =
|leader_title1 = <!-- e.g. "Chair", "President", etc. -->
|leader_name1 =
|leader_title2 = <!-- e.g. "Deputy chair", etc. -->
|leader_name2 =
|leader_title14 =
|leader_name14 =
|established = <!-- Usually a date, in lieu of event/s hereafter -->
|established_event1 =
|established_date1 =
|established_event2 =
|established_date2 =
|established_event9 =
|established_date9 =
|official_website =
|area_km2 = <!-- major area size (in sq_km) -->
|area_sq_mi = <!-- area in square mi (requires area_km2) -->
|area_footnote = <!-- optional footnote for area -->
|percent_water =
|area_label = <!-- label under "Area" (default is "Total") -->
|area_label2 = <!-- label below area_label (optional) -->
|area_dabodyalign = <!-- text after area_label2 (optional) -->
|population_estimate =
|population_estimate_year =
|population_density_km2 =
|population_density_sq_mi =
|GDP_PPP =
|GDP_PPP_rank =
|GDP_PPP_year =
|GDP_PPP_per_capita =
|GDP_nominal =
|GDP_nominal_year =
|GDP_nominal_per_capita =
|Gini = <!-- number only, 0-100 -->
|Gini_ref = <!-- for any ref/s to associate with Gini number -->
|Gini_year =
|HDI = <!-- number only, 0-1 -->
|HDI_ref = <!-- for any ref/s to associate with HDI number -->
|HDI_year =
|currency =
|currency_code =
|time_zone =
|utc_offset = <!-- +N, where N is number of hours -->
|footnote1 =
|footnote2 =
|footnote7 =
|footnotes = <!-- For generic non-numbered footnotes -->
}}
</pre>
{{hidden end}}
<!-------------------- Former country use ---------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Former country}}
<pre style="overflow:auto;">
{{Infobox former country
|native_name = <!-- Name in a modern syntax of native language(s). Leave blank if name is only in English.
Separate with line breaks<br/> or use Template:Plainlist. If language uses Latin characters, place name(s) in italics. -->
|conventional_long_name = <!-- Full name in English -->
|common_name = <!-- Name to be used in constructing links and category names; not for display -->
|iso3166code = omit <!-- For a country or geopolitical version of a country that ceased to exist prior to the introduction of iso3166-->
|era = <!-- Use: "Napoleonic Wars", "Cold War", etc. -->
|status = <!-- Status: see Category list on template page -->
|status_text = <!-- A free text to describe status at the top of the infobox. Use sparingly. -->
|empire = <!-- The empire or country to which the entity was in a state of dependency -->
|government_type = <!-- To generate categories: "Monarchy", "Republic", etc. to generate categories -->
<!-- Rise and fall, events, years and dates -->
<!-- only fill in the start/end event entry if a specific article exists. Don't just say "abolition" or "declaration" -->
|event_start = <!-- Default: "Established" -->
|date_start = <!-- Optional: Date of establishment, in format 1 January (no year) -->
|year_start = <!-- Year of establishment -->
|event_end = <!-- Default: "Disestablished" -->
|date_end = <!-- Optional: Date of disestablishment, in format 1 January (no year) -->
|year_end = <!-- Year of disestablishment -->
|year_exile_start = <!-- Year of start of exile (if dealing with exiled government: status="Exile") -->
|year_exile_end = <!-- Year of end of exile (leave blank if still in exile) -->
|event1 = <!-- Optional: other events between "start" and "end" -->
|date_event1 =
|event2 =
|date_event2 =
|event3 =
|date_event3 =
|event4 =
|date_event4 =
|event5 =
|date_event5 =
|event6 =
|date_event6 =
|event_pre = <!-- Optional: A crucial event that took place before "event_start" -->
|date_pre =
|event_post = <!-- Optional: A crucial event that took place after "event_end" -->
|date_post =
<!-- Flag navigation: Preceding and succeeding entities p1 to p5 and s1 to s5 -->
|p1 = <!-- Name of the article for preceding entity, numbered 1-5 -->
|flag_p1 = <!-- Default: "Flag of {{{p1}}}.svg" (size 30) -->
|image_p1 = <!-- Use: [[File:Sin escudo.svg|20px|Image missing]] -->
|p2 =
|flag_p2 =
|p3 =
|flag_p3 =
|p4 =
|flag_p4 =
|p5 =
|flag_p5 =
|s1 = <!-- Name of the article for succeeding entity, numbered 1-5 -->
|flag_s1 = <!-- Default: "Flag of {{{s1}}}.svg" (size 30) -->
|image_s1 = <!-- Use: [[File:Sin escudo.svg|20px|Image missing]] -->
|s2 =
|flag_s2 =
|s3 =
|flag_s3 =
|s4 =
|flag_s4 =
|s5 =
|flag_s5 =
|image_flag = <!-- Default: Flag of {{{common_name}}}.svg -->
|flag_alt = <!-- Alt text for flag -->
|image_flag2 = <!-- Second flag -->
|flag_alt2 = <!-- Alt text for second flag -->
|flag = <!-- Link target under flag image. Default: Flag of {{{common_name}}} -->
|flag2 = <!-- Link target under flag2 image. Default: Flag of {{{common_name}}} -->
|flag_type = <!-- Displayed text for link under flag. Default "Flag" -->
|flag2_type = <!-- Displayed text for link under flag2. Default "Flag" -->
|image_coat = <!-- Default: Coat of arms of {{{common_name}}}.svg -->
|coa_size = <!-- Size of coat of arms -->
|coat_alt = <!-- Alt text for coat of arms -->
|symbol_type = <!-- Displayed text for link under symbol. Default "Coat of arms" -->
|symbol_type_article = <!-- Link target under symbol image. Default: Coat of arms of {{{common_name}}} -->
|image_map =
|image_map_alt =
|image_map_caption =
|image_map2 = <!-- If second map is needed; does not appear by default -->
|image_map2_alt =
|image_map2_caption =
|capital =
|capital_exile = <!-- If status="Exile" -->
|national_motto =
|national_anthem =
|common_languages =
|religion =
|demonym =
|currency =
<!-- Titles and names of the first and last leaders and their deputies -->
|leader1 = <!-- Name of king or president -->
|leader2 =
|leader3 =
|leader4 =
|leader21 = <!--(up to 21 distinct leaders may be included)-->
|year_leader1 = <!-- Years served -->
|year_leader2 =
|year_leader3 =
|year_leader4 =
|year_leader21 =
|title_leader = <!-- Default: "King" for monarchy, otherwise "President" -->
|representative1 = <!-- Name of representative of head of state (e.g. colonial governor) -->
|representative2 =
|representative3 =
|representative4 =
|representative5 =
|year_representative1 = <!-- Years served -->
|year_representative2 =
|year_representative3 =
|year_representative4 =
|year_representative5 =
|title_representative = <!-- Default: "Governor" -->
|deputy1 = <!-- Name of prime minister -->
|deputy2 =
|deputy3 =
|deputy4 =
|year_deputy1 = <!-- Years served -->
|year_deputy2 =
|year_deputy3 =
|year_deputy4 =
|title_deputy = <!-- Default: "Prime minister" -->
<!-- Legislature -->
|legislature = <!-- Name of legislature -->
|house1 = <!-- Name of first chamber -->
|type_house1 = <!-- Default: "Upper house" -->
|house2 = <!-- Name of second chamber -->
|type_house2 = <!-- Default: "Lower house" -->
<!-- Area and population of a given year -->
|stat_year1 = <!-- year of the statistic, specify either area, population or both -->
|stat_area1 = <!-- area in square kílometres (w/o commas or spaces), area in square miles is calculated -->
|stat_pop1 = <!-- population (w/o commas or spaces), population density is calculated if area is also given -->
|stat_year2 =
|stat_area2 =
|stat_pop2 =
|stat_year3 =
|stat_area3 =
|stat_pop3 =
|stat_year4 =
|stat_area4 =
|stat_pop4 =
|stat_year5 =
|stat_area5 =
|stat_pop5 =
|today = <!-- Present-day countries that overlap with the territorial extent of the former country. Do not use this parameter if there are more than four such countries. --><!-- Do NOT add flags, per MOS:INFOBOXFLAG -->
|footnote_a = <!-- Accepts wikilinks -->
|footnote_b = <!-- Accepts wikilinks -->
...
|footnote_h = <!-- Accepts wikilinks -->
|footnotes = <!-- Accepts wikilinks -->
}}</pre>
{{hidden end}}<!----(Former country)---->
== Examples ==
<!------------------ Country/territory example ------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Country or territory}}
{{Infobox country
|conventional_long_name = Republic of Cameroon
|native_name = {{lang|fr|République du Cameroun}}
|common_name = Cameroon
|image_flag = Flag of Cameroon.svg
|alt_flag = Vertical tricolor (green, red, yellow) with a five-pointed gold star in the center of the red.
|image_coat = Coat of arms of Cameroon.svg
|symbol_type = Coat of arms
|image_map = Cameroon (orthographic projection).svg
|alt_map = Location of Cameroon on the globe.
|national_motto = <br/>{{native phrase|fr|"Paix – Travail – Patrie"|italics=off}}<br/>{{small|"Peace – Work – Fatherland"}}
|national_anthem = <br/>"{{native phrase|fr|[[O Cameroon, Cradle of our Forefathers|Ô Cameroun, Berceau de nos Ancêtres]]|nolink=yes|italics=off}}"<br/>{{raise|0.2em|{{small|''O Cameroon, Cradle of our Forefathers''}} {{lower|0.1em|<sup>a</sup>}}}}
|official_languages = {{hlist |[[French language|French]] |[[English language|English]]}}
|demonym = Cameroonian
|ethnic_groups =
{{unbulleted list
| {{nowrap|31% [[Ethnic groups in Cameroon|Cameroon Highlanders]]}}
| 19% [[Bantu peoples|Equatorial Bantu]]
| 11% [[Kirdi]]
| 10% [[Fula people|Fulani]]
| 8% [[Bantu peoples|Northwestern Bantu]]
| 7% Eastern Nigritic
| 13% other African
| <1% non-African
}}
|capital = [[Yaoundé]]
|coordinates = {{coord|3|52|N|11|31|E}}
|largest_city = [[Douala]]
|government_type = [[Republic]]
|leader_title1 = [[List of heads of state of Cameroon|President]]
|leader_name1 = [[Paul Biya]]
|leader_title2 = [[Prime Minister of Cameroon|Prime Minister]]
|leader_name2 = [[Philémon Yang]]
|legislature = [[National Assembly (Cameroon)|National Assembly]]
|area_rank = 54th <!--Demographic Yearbook 1.-->
|area_km2 = 475,442
|area_sq_mi = 183,568 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 1.3 <!--CIA World Factbook-->
|population_estimate = 20,129,878
|population_estimate_rank = 58th <!--UN World Population Prospects-->
|population_estimate_year = July 2012
|population_census = 17,463,836
|population_census_year = 2005
|population_density_km2 = 39.7
|population_density_sq_mi = 102.8 <!--Do not remove per [[WP:MOSNUM]]-->
|population_density_rank = 167th <!--UN World Population Prospects-->
|GDP_PPP = $47.251 billion
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $2,257
|GDP_PPP_per_capita_rank =
|GDP_nominal = $25.759 billion
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $1,230
|sovereignty_type = Independence {{nobold|from [[France]]}}
|established_event1 = Declared
|established_date1 = 1 January 1960
|established_event2 = {{nowrap|Annexation of former<br/>[[British Cameroons]]}}
|established_date2 = 1 October 1961
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.482 <!--number only-->
|HDI_ref =
|HDI_rank = 150th
|Gini_year = 2001
|Gini_change = <!--increase/decrease/steady-->
|Gini = 44.6 <!--number only-->
|Gini_ref =
|Gini_rank =
|currency = [[Central African CFA franc]]
|currency_code = XAF
|time_zone = [[West Africa Time|WAT]]
|utc_offset = +1
|time_zone_DST =
|utc_offset_DST =
|electricity =
|drives_on = right
|calling_code = [[+237]]
|cctld = [[.cm]]
|footnote_a = These are the titles as given in the ''Constitution of the Republic of Cameroon'', Article X. The French version of the song is sometimes called {{lang|fr|Chant de Ralliement}}, as in ''National Anthems of the World''; and the English version "O Cameroon, Cradle of Our Forefathers", as in DeLancey and DeLancey 61.
}}
<pre style="font-size:95%;overflow:auto;">
{{Infobox country
|conventional_long_name = Republic of Cameroon
|native_name = {{lang|fr|République du Cameroun}}
|common_name = Cameroon
|image_flag = Flag of Cameroon.svg
|alt_flag = Vertical tricolor (green, red, yellow) with a five-pointed gold star in the center of the red.
|image_coat = Coat of arms of Cameroon.svg
|symbol_type = Coat of arms
|image_map = Cameroon (orthographic projection).svg
|alt_map = Location of Cameroon on the globe.
|national_motto = <br/>{{native phrase|fr|"Paix – Travail – Patrie"|italics=off}}<br/>{{small|"Peace – Work – Fatherland"}}
|national_anthem = <br/>"{{native phrase|fr|[[O Cameroon, Cradle of our Forefathers|Ô Cameroun, Berceau de nos Ancêtres]]|nolink=yes|italics=off}}"<br/>{{raise|0.2em|{{small|''O Cameroon, Cradle of our Forefathers''}} {{lower|0.1em|<sup>a</sup>}}}}
|official_languages = {{hlist |[[French language|French]] |[[English language|English]]}}
|demonym = Cameroonian
|ethnic_groups =
{{unbulleted list
| {{nowrap|31% [[Ethnic groups in Cameroon|Cameroon Highlanders]]}}
| 19% [[Bantu peoples|Equatorial Bantu]]
| 11% [[Kirdi]]
| 10% [[Fula people|Fulani]]
| 8% [[Bantu peoples|Northwestern Bantu]]
| 7% Eastern Nigritic
| 13% other African
| <1% non-African
}}
|capital = [[Yaoundé]]
|coordinates = {{coord|3|52|N|11|31|E}}
|largest_city = [[Douala]]
|government_type = [[Republic]]
|leader_title1 = [[List of heads of state of Cameroon|President]]
|leader_name1 = [[Paul Biya]]
|leader_title2 = [[Prime Minister of Cameroon|Prime Minister]]
|leader_name2 = [[Philémon Yang]]
|legislature = [[National Assembly (Cameroon)|National Assembly]]
|area_rank = 54th <!--Demographic Yearbook 1.-->
|area_km2 = 475,442
|area_sq_mi = 183,568 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 1.3 <!--CIA World Factbook-->
|population_estimate = 20,129,878
|population_estimate_rank = 58th <!--UN World Population Prospects-->
|population_estimate_year = July 2012
|population_census = 17,463,836
|population_census_year = 2005
|population_density_km2 = 39.7
|population_density_sq_mi = 102,8 <!--Do not remove per [[WP:MOSNUM]]-->
|population_density_rank = 167th <!--UN World Population Prospects-->
|GDP_PPP = $47.251 billion
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $2,257
|GDP_PPP_per_capita_rank =
|GDP_nominal = $25.759 billion
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $1,230
|sovereignty_type = Independence {{nobold|from [[France]]}}
|established_event1 = Declared
|established_date1 = 1 January 1960
|established_event2 = {{nowrap|Annexation of former<br/>[[British Cameroons]]}}
|established_date2 = 1 October 1961
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.482 <!--number only-->
|HDI_ref =
|HDI_rank = 150th
|Gini_year = 2001
|Gini_change = <!--increase/decrease/steady-->
|Gini = 44.6 <!--number only-->
|Gini_ref =
|Gini_rank =
|currency = [[Central African CFA franc]]
|currency_code = XAF
|time_zone = [[West Africa Time|WAT]]
|utc_offset = +1
|time_zone_DST = not observed
|utc_offset_DST = +1
|electricity =
|drives_on = right
|calling_code = [[+237]]
|cctld = [[.cm]]
|footnote_a = These are the titles as given in the ''Constitution of the Republic of Cameroon'', Article X. The French version of the song is sometimes called {{lang|fr|Chant de Ralliement}}, as in ''National Anthems of the World''; and the English version "O Cameroon, Cradle of Our Forefathers", as in DeLancey and DeLancey 61.
}}
</pre>
{{hidden end}}
<!-------------- Geopolitical organization example --------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Geopolitical organization}}
{{Infobox geopolitical organization
|name =
{{collapsible list
|titlestyle = background:transparent;text-align:center;font-size:85%;
|title = {{resize|130%|European Union}}
|liststyle = text-align:center;
| {{smaller|{{native name|bg|Европейски съюз}}<br/><!--
-->{{native name|hr|Europska unija}}<br/><!--
-->{{native name|cs|Evropská unie}}<br/><!--
-->{{native name|da|Den Europæiske Union}}<br/><!--
-->{{native name|nl|Europese Unie}}<br /><!--
-->{{native name|et|Euroopa Liit}}<br/><!--
-->{{native name|fi|Euroopan unioni}}<br/><!--
-->{{native name|fr|Union européenne}}<br/><!--
-->{{native name|de|Europäische Union}}<br/><!--
-->{{native name|el|Ευρωπαϊκή Ένωση}}<br/><!--
-->{{native name|hu|Európai Unió}}<br/><!--
-->{{native name|ga|An tAontas Eorpach}}<br/><!--
-->{{native name|it|Unione europea}}<br/><!--
-->{{native name|lv|Eiropas Savienība}}<br/><!--
-->{{native name|lt|Europos Sąjunga}}<br/><!--
-->{{native name|mt|Unjoni Ewropea}}<br/><!--
-->{{native name|pl|Unia Europejska}}<br/><!--
-->{{native name|pt|União Europeia}}<br/><!--
-->{{native name|ro|Uniunea Europeană}}<br/><!--
-->{{native name|sk|Európska únia}}<br/><!--
-->{{native name|sl|Evropska unija}}<br/><!--
-->{{native name|es|Unión Europea}}<br/><!--
-->{{native name|sv|Europeiska unionen}}<!--
-->}}
}}
|linking_name = Europe
|image_flag = Flag of Europe.svg
|alt_flag = Circle of 12 gold stars on a blue background
|motto = "[[Motto of the European Union|United in diversity]]"
|anthem = <div style="padding-bottom:0.2em;">"[[Anthem of Europe|Ode to Joy]]" {{small|(orchestral)}}</div>[[File:Anthem of Europe (US Navy instrumental short version).ogg|center]]
|image_map = EU Globe No Borders.svg
|map_caption = An [[Orthographic projection (cartography)|orthographic projection]] of the world, highlighting the European Union and its Member States (green).
|map_width = 220px
|admin_center_type = Political centres
|admin_center = {{unbulleted list |[[Brussels]] ([[Brussels and the European Union|de facto capital]])|[[Luxembourg (city)|Luxembourg]] |[[Strasbourg]]}}
|largest_city = [[London]]
|official_languages =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = [[Languages of the European Union|24 languages]]
| {{hlist |[[Bulgarian language|Bulgarian]] |[[Croatian language|Croatian]] |[[Czech language|Czech]] |[[Danish language|Danish]] |[[Dutch language|Dutch]] |[[English language|English]] |[[Estonian language|Estonian]] |[[Finnish language|Finnish]] |[[French language|French]] |[[German language|German]] |[[Greek language|Greek]] |[[Hungarian language|Hungarian]] |[[Irish language|Irish]] |[[Italian language|Italian]] |[[Latvian language|Latvian]] |[[Lithuanian language|Lithuanian]] |[[Maltese language|Maltese]] |[[Polish language|Polish]] |[[Portuguese language|Portuguese]] |[[Romanian language|Romanian]] |[[Slovak language|Slovak]] |[[Slovene language|Slovene]] |[[Spanish language|Spanish]] |[[Swedish language|Swedish]]}}
}}
|demonym = [[Citizenship of the European Union|European]]
|membership_type = [[Member state of the European Union|Member state]]s
|membership =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = 28 states
|{{flagcountry|Austria}} |{{flagcountry|Belgium|state}} |{{flagcountry|Bulgaria}}
|{{flagcountry|Croatia}} |{{flagcountry|Cyprus}} |{{flagcountry|Czech Republic}}
|{{flagcountry|Denmark}} |{{flagcountry|Estonia}} |{{flagcountry|Finland}}
|{{flagcountry|France}} |{{flagcountry|Germany}} |{{flagcountry|Greece}}
|{{flagcountry|Hungary}} |{{flagcountry|Ireland}} |{{flagcountry|Italy}}
|{{flagcountry|Latvia}} |{{flagcountry|Lithuania}} |{{flagcountry|Luxembourg}}
|{{flagcountry|Malta}} |{{flagcountry|Netherlands}} |{{flagcountry|Poland}}
|{{flagcountry|Portugal}} |{{flagcountry|Romania}} |{{flagcountry|Slovakia}}
|{{flagcountry|Slovenia}} |{{flagcountry|Spain}} |{{flagcountry|Sweden}}
|{{flagcountry|United Kingdom}}
}}
|leader_title1 = [[President of the European Council|President of the European Council]]
|leader_name1 = {{nowrap|[[Charles Michel]] ([[Mouvement Réformateur|MR]])}}
|leader_title2 = [[President of the European Commission|President of the Commission]]
|leader_name2 = {{nowrap|[[Ursula von der Leyen]] ([[Christian Democratic Union of Germany|CDU]])}}
|legislature = [[Legislature of the European Union]]
|upper_house = {{nowrap|[[Council of the European Union]]}}
|lower_house = [[European Parliament]]
|established_event1 = [[Treaty of Paris (1951)|Treaty of Paris]]
|established_date1 = 23 July 1952
|established_event2 = [[Treaty of Rome]]
|established_date2 = 1 January 1958
|established_event3 = {{nowrap|[[Maastricht Treaty|Treaty of Maastricht]]}}
|established_date3 = 1 November 1993
|official_website = {{URL|europa.eu}}
|area_rank = 7th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|area_km2 = 4,381,376 <!--Do not remove per [[WP:MOSNUM]]-->
|area_sq_mi = 1,691,658 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 3.08
|population_estimate = 507,890,191
|population_estimate_rank = 3rd<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|population_estimate_year = 2012
|population_density_km2 = 116.2 <!--502,486,499 / 4,324,782km2 = 116.2 people/km2 (1 January 2011)-->
|population_density_sq_mi = 300.9 <!--502,486,499 / 1,669,807sq_mi = 300.9 people/sq_mi (1 January 2011)-->
|population_density_rank = <!--Calculated by taking out EU members from the list-->
<!--IMF GDP data published in September 2011; so please do not use the IMF *projections* for 2011-->
|GDP_PPP = $15.821 trillion
|GDP_PPP_rank = 1st<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $31,607<!--same ref as above-->
|GDP_PPP_per_capita_rank = 15th<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal = $17.577 trillion
|GDP_nominal_rank = 1st<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $35,116
|GDP_nominal_per_capita_rank = 14th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|Gini_year = 2010
|Gini_change = <!--increase/decrease/steady-->
|Gini = 30.4 <!--number only-->
|Gini_ref =
|Gini_rank =
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.876 <!--number only-->
|HDI_ref =
|HDI_rank = 13th<!--Calculated by taking out EU members from the list-->{{\}}25th<sup>a</sup><!--Calculated with EU members in the list-->
|currency =
{{hidden begin
|titlestyle = font-size:105%;font-weight:normal;
|title = {{pad|0.5em}}[[Euro]] and others
|bodystyle=font-size:90%;}}
<table cellspacing="0" cellpadding="0">
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Eurozone]]{{spaces|2}}{{nobold|{{small|(17 countries)}}}}</tr>
<tr style="height:22px;"><th>{{flagicon|EU}}<th>[[Euro]]<th>[[Euro sign|€]]<th><code>[[ISO 4217|EUR]]</code></tr>
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Currencies of the European Union|Other currencies]]</tr>
<tr style="height:22px;"><td>{{flagicon|Bulgaria}}<td>[[Bulgarian lev|Lev]]<td>лв<td><code>[[ISO 4217|BGN]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Croatia}}<td>[[Croatian kuna|Kuna]]<td>kn<td><code>[[ISO 4217|HRK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Czech Republic}}<td>[[Czech koruna|Koruna]]<td>Kč<td><code>[[ISO 4217|CZK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Denmark}}<td>[[Danish krone|Krone]]<td>kr<td><code>[[ISO 4217|DKK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Hungary}}<td>[[Hungarian forint|Forint]]<td>Ft<td><code>[[ISO 4217|HUF]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Latvia}}<td>[[Latvian lats|Lats]]<td>Ls<td><code>[[ISO 4217|LVL]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Lithuania}}<td>[[Lithuanian litas|Litas]]<td>Lt<td><code>[[ISO 4217|LTL]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Poland}}<td>[[Polish złoty|Złoty]]<td>zł<td><code>[[ISO 4217|PLN]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Romania}}<td>[[Romanian Leu|Leu]]<td><td><code>[[ISO 4217|RON]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Sweden}}<td>[[Swedish krona|Krona]]<td>kr<td><code>[[ISO 4217|SEK]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|United Kingdom}}<td>[[Pound sterling]]<td>£<td><code>[[ISO 4217|GBP]]</code></tr>
<tr style="height:22px;"><td>{{flagicon|Gibraltar}}<td>[[Gibraltar pound|Pound]]<td>£<td><code>[[ISO 4217|GIP]]</code></tr>
</table>
{{hidden end}}
|time_zone =
|utc_offset = +0 to +2
|time_zone_DST =
|utc_offset_DST = +1 to +3
|date_format =
|cctld = [[.eu]]
|calling_code = [[Telephone numbers in the European Union|28 codes]]
|footnote_a = If considered as a single entity.
}}
<pre style="font-size:95%;overflow:auto;">
{{Infobox geopolitical organization
|name =
{{collapsible list
|titlestyle = background:transparent;text-align:center;font-size:85%;
|title = {{resize|130%|European Union}}
|liststyle = text-align:center;
| {{smaller|{{native name|bg|Европейски съюз}}<br/><!--
-->{{native name|hr|Europska unija}}<br/><!--
-->{{native name|cs|Evropská unie}}<br/><!--
-->{{native name|da|Den Europæiske Union}}<br/><!--
-->{{native name|nl|Europese Unie}}<br /><!--
-->{{native name|et|Euroopa Liit}}<br/><!--
-->{{native name|fi|Euroopan unioni}}<br/><!--
-->{{native name|fr|Union européenne}}<br/><!--
-->{{native name|de|Europäische Union}}<br/><!--
-->{{native name|el|Ευρωπαϊκή Ένωση}}<br/><!--
-->{{native name|hu|Európai Unió}}<br/><!--
-->{{native name|ga|An tAontas Eorpach}}<br/><!--
-->{{native name|it|Unione europea}}<br/><!--
-->{{native name|lv|Eiropas Savienība}}<br/><!--
-->{{native name|lt|Europos Sąjunga}}<br/><!--
-->{{native name|mt|Unjoni Ewropea}}<br/><!--
-->{{native name|pl|Unia Europejska}}<br/><!--
-->{{native name|pt|União Europeia}}<br/><!--
-->{{native name|ro|Uniunea Europeană}}<br/><!--
-->{{native name|sk|Európska únia}}<br/><!--
-->{{native name|sl|Evropska unija}}<br/><!--
-->{{native name|es|Unión Europea}}<br/><!--
-->{{native name|sv|Europeiska unionen}}<!--
-->}}
}}
|linking_name = Europe
|image_flag = Flag of Europe.svg
|alt_flag = Circle of 12 gold stars on a blue background
|motto = "[[Motto of the European Union|United in diversity]]"
|anthem = <div style="padding-bottom:0.2em;">''[[Anthem of Europe|Ode to Joy]]'' {{small|(orchestral)}}</div>{{center|[[File:Anthem of Europe (US Navy instrumental short version).ogg]]}}
|image_map = EU Globe No Borders.svg
|map_caption = An [[Orthographic projection (cartography)|orthographic projection]] of the world, highlighting the European Union and its Member States (green).
|map_width = 220px
|admin_center_type = Political centres
|admin_center = {{unbulleted list |[[Brussels]] ([[Brussels and the European Union|de facto capital]])|[[Luxembourg (city)|Luxembourg]] |[[Strasbourg]]}}
|largest_city = [[London]]
|official_languages =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = [[Languages of the European Union|24 languages]]
| {{hlist |[[Bulgarian language|Bulgarian]] |[[Croatian language|Croatian]] |[[Czech language|Czech]] |[[Danish language|Danish]] |[[Dutch language|Dutch]] |[[English language|English]] |[[Estonian language|Estonian]] |[[Finnish language|Finnish]] |[[French language|French]] |[[German language|German]] |[[Greek language|Greek]] |[[Hungarian language|Hungarian]] |[[Irish language|Irish]] |[[Italian language|Italian]] |[[Latvian language|Latvian]] |[[Lithuanian language|Lithuanian]] |[[Maltese language|Maltese]] |[[Polish language|Polish]] |[[Portuguese language|Portuguese]] |[[Romanian language|Romanian]] |[[Slovak language|Slovak]] |[[Slovene language|Slovene]] |[[Spanish language|Spanish]] |[[Swedish language|Swedish]]}}
}}
|demonym = [[Citizenship of the European Union|European]]
|membership_type = [[Member state of the European Union|Member state]]s
|membership =
{{collapsible list
|titlestyle = background:transparent;text-align:left;font-weight:normal;
|title = 28 states
|{{flagcountry|Austria}} |{{flagcountry|Belgium|state}} |{{flagcountry|Bulgaria}}
|{{flagcountry|Croatia}} |{{flagcountry|Cyprus}} |{{flagcountry|Czech Republic}}
|{{flagcountry|Denmark}} |{{flagcountry|Estonia}} |{{flagcountry|Finland}}
|{{flagcountry|France}} |{{flagcountry|Germany}} |{{flagcountry|Greece}}
|{{flagcountry|Hungary}} |{{flagcountry|Ireland}} |{{flagcountry|Italy}}
|{{flagcountry|Latvia}} |{{flagcountry|Lithuania}} |{{flagcountry|Luxembourg}}
|{{flagcountry|Malta}} |{{flagcountry|Netherlands}} |{{flagcountry|Poland}}
|{{flagcountry|Portugal}} |{{flagcountry|Romania}} |{{flagcountry|Slovakia}}
|{{flagcountry|Slovenia}} |{{flagcountry|Spain}} |{{flagcountry|Sweden}}
|{{flagcountry|United Kingdom}}
}}
|leader_title1 = [[President of the European Council|President of the European Council]]
|leader_name1 = {{nowrap|[[Charles Michel]] ([[Mouvement Réformateur|MR]])}}
|leader_title2 = [[President of the European Commission|President of the Commission]]
|leader_name2 = {{nowrap|[[Ursula von der Leyen]] ([[Christian Democratic Union of Germany|CDU]])}}
|legislature = [[Legislature of the European Union]]
|upper_house = {{nowrap|[[Council of the European Union]]}}
|lower_house = [[European Parliament]]
|established_event1 = [[Treaty of Paris (1951)|Treaty of Paris]]
|established_date1 = 23 July 1952
|established_event2 = [[Treaty of Rome]]
|established_date2 = 1 January 1958
|established_event3 = {{nowrap|[[Maastricht Treaty|Treaty of Maastricht]]}}
|established_date3 = 1 November 1993
|official_website = {{URL|europa.eu}}
|area_rank = 7th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|area_km2 = 4,381,376 <!--Do not remove per [[WP:MOSNUM]]-->
|area_sq_mi = 1,691,658 <!--Do not remove per [[WP:MOSNUM]]-->
|percent_water = 3.08
|population_estimate = 507,890,191
|population_estimate_rank = 3rd<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|population_estimate_year = 2012
|population_density_km2 = 116.2 <!--502,486,499 / 4,324,782km2 = 116.2 people/km2 (1 January 2011)-->
|population_density_sq_mi = 300.9 <!--502,486,499 / 1,669,807sq_mi = 300.9 people/sq_mi (1 January 2011)-->
|population_density_rank = <!--Calculated by taking out EU members from the list-->
<!--IMF GDP data published in September 2011; so please do not use the IMF *projections* for 2011-->
|GDP_PPP = $15.821 trillion
|GDP_PPP_rank = 1st<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|GDP_PPP_year = 2011
|GDP_PPP_per_capita = $31,607
|GDP_PPP_per_capita_rank = 15th<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal = $17.577 trillion
|GDP_nominal_rank = 1st<sup>a</sup><!--Calculated by taking out EU members from the list-->
|GDP_nominal_year = 2011
|GDP_nominal_per_capita = $35,116
|GDP_nominal_per_capita_rank = 14th<sup>a</sup><!--gives link to list--><!--Calculated by taking out EU members from the list-->
|Gini_year = 2010
|Gini_change = <!--increase/decrease/steady-->
|Gini = 30.4 <!--number only-->
|Gini_ref =
|Gini_rank =
|HDI_year = 2011
|HDI_change = increase <!--increase/decrease/steady-->
|HDI = 0.876 <!--number only-->
|HDI_ref =
|HDI_rank = 13th<!--Calculated by taking out EU members from the list-->{{\}}25th<sup>a</sup><!--Calculated with EU members in the list-->
|currency =
{{hidden begin
|titlestyle = font-size:105%;font-weight:normal;
|title = {{pad|0.5em}}[[Euro]] and others
|bodystyle=font-size:90%;}}
<table cellspacing="0" cellpadding="0">
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Eurozone]]{{spaces|2}}{{nobold|{{small|(17 countries)}}}}</tr>
<tr style="height:22px;"><th>{{flagicon|EU}}<th>[[Euro]]<th>[[Euro sign|€]]<th><code>[[ISO 4217|EUR]]</tr>
<tr style="height:22px;"><th colspan="4" style="font-size:120%;">[[Currencies of the European Union|Other currencies]]</tr>
<tr style="height:22px;"><td>{{flagicon|Bulgaria}}<td>[[Bulgarian lev|Lev]]<td>лв<td><code>[[ISO 4217|BGN]]</tr>
<tr style="height:22px;"><td>{{flagicon|Croatia}}<td>[[Croatian kuna|Kuna]]<td>kn<td><code>[[ISO 4217|HRK]]</tr>
<tr style="height:22px;"><td>{{flagicon|Czech Republic}}<td>[[Czech koruna|Koruna]]<td>Kč<td><code>[[ISO 4217|CZK]]</tr>
<tr style="height:22px;"><td>{{flagicon|Denmark}}<td>[[Danish krone|Krone]]<td>kr<td><code>[[ISO 4217|DKK]]</tr>
<tr style="height:22px;"><td>{{flagicon|Hungary}}<td>[[Hungarian forint|Forint]]<td>Ft<td><code>[[ISO 4217|HUF]]</tr>
<tr style="height:22px;"><td>{{flagicon|Latvia}}<td>[[Latvian lats|Lats]]<td>Ls<td><code>[[ISO 4217|LVL]]</tr>
<tr style="height:22px;"><td>{{flagicon|Lithuania}}<td>[[Lithuanian litas|Litas]]<td>Lt<td><code>[[ISO 4217|LTL]]</tr>
<tr style="height:22px;"><td>{{flagicon|Poland}}<td>[[Polish złoty|Złoty]]<td>zł<td><code>[[ISO 4217|PLN]]</tr>
<tr style="height:22px;"><td>{{flagicon|Romania}}<td>[[Romanian Leu|Leu]]<td><td><code>[[ISO 4217|RON]]</tr>
<tr style="height:22px;"><td>{{flagicon|Sweden}}<td>[[Swedish krona|Krona]]<td>kr<td><code>[[ISO 4217|SEK]]</tr>
<tr style="height:22px;"><td>{{flagicon|United Kingdom}}<td>[[Pound sterling]]<td>£<td><code>[[ISO 4217|GBP]]</tr>
<tr style="height:22px;"><td>{{flagicon|Gibraltar}}<td>[[Gibraltar pound|Pound]]<td>£<td><code>[[ISO 4217|GIP]]</tr>
</table>
{{hidden end}}
|time_zone =
|utc_offset = +0 to +2
|time_zone_DST =
|utc_offset_DST = +1 to +3
|date_format =
|cctld = [[.eu]]
|calling_code = [[Telephone numbers in the European Union|28 codes]]
|footnote_a = If considered as a single entity.
}}
</pre>
{{hidden end}}
<!----(Geopolitical organization example)---->
<!------------------ Former country example ------------------->
{{hidden begin |toggle=left |titlestyle=font-size:120%; |title=Former country}}
An example from [[German Empire]]:
{{Infobox former country
|native_name = ''Deutsches Reich''
|conventional_long_name = German Empire
|common_name = Germany
|iso3166code = omit
|status = Empire
|era = [[New Imperialism]]/[[World War I|WWI]]
|event_start = [[Unification of Germany|Unification]]
|date_start = 18 January
|year_start = 1871
|event_end = [[German Revolution of 1918–1919|Republic declared]]
|date_end = 9 November
|year_end = 1918
|event_post = Formal abdication
|date_post = 28 November 1918
|p1 = North German Confederation
|flag_p1 = Flag of the German Empire.svg
|p2 = Kingdom of Bavaria
|flag_p2 = Flag of Bavaria (striped).svg
|p3 = Kingdom of Württemberg
|flag_p3 = Flagge Königreich Württemberg.svg
|p4 = Grand Duchy of Baden
|flag_p4 = Flagge Großherzogtum Baden (1871-1891).svg
|p5 = Grand Duchy of Hesse
|flag_p5 = Flagge_Großherzogtum_Hessen_ohne_Wappen.svg
|p6 = Alsace-Lorraine
|flag_p6 = Flag of France.svg
|s1 = Weimar Republic
|s2 = Republic of Alsace-Lorraine
|s3 = Free City of Danzig
|s4 = Second Polish Republic
|s5 = Klaipėda Region
|s6 = Saar (League of Nations)
|s7 = Hlučín Region
|s8 = South Jutland County{{!}}Northern Schleswig
|s9 = Eupen-Malmedy
|flag_s1 = Flag of Germany (3-2 aspect ratio).svg
|flag_s2 = Flag of the Republic of Alsace-Lorraine.svg
|flag_s3 = Gdansk flag.svg
|flag_s4 = Flag of Poland.svg
|flag_s5 = Flag of Lithuania 1918-1940.svg
|flag_s6 = Flag of Saar 1920-1935.svg
|flag_s7 = Flag of Bohemia.svg
|flag_s8 = Flag of Denmark.svg
|flag_s9 = Flag of Belgium.svg
|image_flag = Flag of the German Empire.svg
|flag_alt = Horizontal tricolor (black, white, red)
|flag_caption = Flag of the German Empire
|image_coat = Wappen Deutsches Reich - Reichsadler 1889.svg
|symbol_type = Imperial Coat of arms
|coat_alt = Shield containing a black, one-headed, rightward-looking eagle with red beak, tongue and claws. On its breast is a shield with another eagle. Over its head is an imperial crown with two crossing ribbons.
|image_map = German Empire, Wilhelminian third version.svg
|image_map_alt = Located in north central Europe, containing modern Germany plus much of modern Poland
|image_map_caption = Territory of the German Empire in 1914, prior to [[World War I]]
|national_motto = ''[[Gott mit uns]]''<br/><small>"God with us"</small>
|national_anthem = {{plainlist|
*''(none official)''
*"[[Heil dir im Siegerkranz]]" (Imperial)
*"[[Deutschlandlied]]" (popular)
*"[[Die Wacht am Rhein]]" (unofficial)
}}
|capital = Berlin
|common_languages =
;Official language
:[[German language|German]]
;Unofficial minority languages
:[[Danish language|Danish]], [[French language|French]], [[Polish language|Polish]], [[Saterland Frisian language|Frisian]], [[Old Prussian language|Old Prussian]], [[Lithuanian language|Lithuanian]]
;Colonial languages
:[[Bantu languages|Bantu]], [[Oshiwambo]], [[Afrikaans]], [[Swahili language|Swahili]] (African Colonies)
:[[Chinese language|Chinese]] (Tsingtao & Jiaozhou bay)
:[[Papuan languages]] (German New Guinea)
:[[Samoan language|Samoan]] (German Samoa)
|government_type = Constitutional monarchy
|title_leader = [[German Emperor|Emperor]]
|leader1 = [[William I, German Emperor|William I]]
|year_leader1 = 1871–1888
|leader2 = [[Frederick III, German Emperor|Frederick III]]
|year_leader2 = 1888
|leader3 = [[Wilhelm II, German Emperor|Wilhelm II]]
|year_leader3 = 1888–1918
|title_deputy = [[List of Chancellors of Germany|Chancellor]]
|deputy1 = [[Otto von Bismarck]] (first)
|year_deputy1 = 1871–1890
|deputy2 = [[Friedrich Ebert]] (last)
|year_deputy2 = 8–9 Nov 1918
|legislature = [[Reichstag (German Empire)|Reichstag]]
|house1 = [[Reichsrat (Germany)|Reichsrat]]
|type_house1 = State council
|stat_year1 = 1871
|religion = {{plainlist|
*[[Lutherans]]~60%
*[[Roman Catholics]]~40%
}}
|stat_pop1 = 41058792
|stat_year2 = 1890
|stat_pop2 = 49428470
|stat_year4 = 1910
|stat_pop4 = 64925993
|stat_area4 = 540857.54
|currency = {{plainlist|
*[[Vereinsthaler]], [[South German gulden]], [[Bremen thaler]], [[Hamburg mark]], [[French franc]] <small>(until 1873, together)</small>
*[[German gold mark|Goldmark]] <small>(1873–1914)</small>
*[[German Papiermark|Papiermark]] <small>(after 1914)</small>
}}
|footnotes = Area and population not including colonial possessions
|today =
}}
<pre style="overflow:auto;">
{{Infobox former country
|native_name = ''Deutsches Reich''
|conventional_long_name = German Empire
|common_name = Germany
|iso3166code = omit
|status = Empire
|era = [[New Imperialism]]/[[World War I|WWI]]
|event_start = [[Unification of Germany|Unification]]
|date_start = 18 January
|year_start = 1871
|event_end = [[German Revolution of 1918–1919|Republic declared]]
|date_end = 9 November
|year_end = 1918
|event_post = Formal abdication
|date_post = 28 November 1918
|p1 = North German Confederation
|flag_p1 = Flag of the German Empire.svg
|p2 = Kingdom of Bavaria
|flag_p2 = Flag of Bavaria (striped).svg
|p3 = Kingdom of Württemberg
|flag_p3 = Flagge Königreich Württemberg.svg
|p4 = Grand Duchy of Baden
|flag_p4 = Flagge Großherzogtum Baden (1871-1891).svg
|p5 = Grand Duchy of Hesse
|flag_p5 = Flagge_Großherzogtum_Hessen_ohne_Wappen.svg
|p6 = Alsace-Lorraine
|flag_p6 = Flag of France.svg
|s1 = Weimar Republic
|s2 = Republic of Alsace-Lorraine
|s3 = Free City of Danzig
|s4 = Second Polish Republic
|s5 = Klaipėda Region
|s6 = Saar (League of Nations)
|s7 = Hlučín Region
|s8 = South Jutland County{{!}}Northern Schleswig
|s9 = Eupen-Malmedy
|flag_s1 = Flag of Germany (3-2 aspect ratio).svg
|flag_s2 = Flag of the Republic of Alsace-Lorraine.svg
|flag_s3 = Gdansk flag.svg
|flag_s4 = Flag of Poland.svg
|flag_s5 = Flag of Lithuania 1918-1940.svg
|flag_s6 = Flag of Saar 1920-1935.svg
|flag_s7 = Flag of Bohemia.svg
|flag_s8 = Flag of Denmark.svg
|flag_s9 = Flag of Belgium.svg
|image_flag = Flag of the German Empire.svg
|flag_alt = Horizontal tricolor (black, white, red)
|flag_caption = Flag of the German Empire
|image_coat = Wappen Deutsches Reich - Reichsadler 1889.svg
|symbol_type = Imperial Coat of arms
|coat_alt = Shield containing a black, one-headed, rightward-looking eagle with red beak, tongue and claws. On its breast is a shield with another eagle. Over its head is an imperial crown with two crossing ribbons.
|image_map = German Empire, Wilhelminian third version.svg
|image_map_alt = Located in north central Europe, containing modern Germany plus much of modern Poland
|image_map_caption = Territory of the German Empire in 1914, prior to [[World War I]]
|national_motto = ''[[Gott mit uns]]''<br/><small>"God with us"</small>
|national_anthem = {{plainlist|
*''(none official)''
*"[[Heil dir im Siegerkranz]]" (Imperial)
*"[[Deutschlandlied]]" (popular)
*"[[Die Wacht am Rhein]]" (unofficial)
}}
|capital = Berlin
|common_languages =
;Official language
:[[German language|German]]
;Unofficial minority languages
:[[Danish language|Danish]], [[French language|French]], [[Polish language|Polish]], [[Saterland Frisian language|Frisian]], [[Old Prussian language|Old Prussian]], [[Lithuanian language|Lithuanian]]
;Colonial languages
:[[Bantu languages|Bantu]], [[Oshiwambo]], [[Afrikaans]], [[Swahili language|Swahili]] (African Colonies)
:[[Chinese language|Chinese]] (Tsingtao & Jiaozhou bay)
:[[Papuan languages]] (German New Guinea)
:[[Samoan language|Samoan]] (German Samoa)
|government_type = Constitutional monarchy
|title_leader = [[German Emperor|Emperor]]
|leader1 = [[William I, German Emperor|William I]]
|year_leader1 = 1871–1888
|leader2 = [[Frederick III, German Emperor|Frederick III]]
|year_leader2 = 1888
|leader3 = [[Wilhelm II, German Emperor|Wilhelm II]]
|year_leader3 = 1888–1918
|title_deputy = [[List of Chancellors of Germany|Chancellor]]
|deputy1 = [[Otto von Bismarck]] (first)
|year_deputy1 = 1871–1890
|deputy2 = [[Friedrich Ebert]] (last)
|year_deputy2 = 8–9 Nov 1918
|legislature = [[Reichstag (German Empire)|Reichstag]]
|house1 = [[Reichsrat (Germany)|Reichsrat]]
|type_house1 = State council
|stat_year1 = 1871
|religion = {{plainlist|
*[[Lutherans]]~60%
*[[Roman Catholics]]~40%
}}
|stat_pop1 = 41058792
|stat_year2 = 1890
|stat_pop2 = 49428470
|stat_year4 = 1910
|stat_pop4 = 64925993
|stat_area4 = 540857.54
|currency = {{plainlist|
*[[Vereinsthaler]], [[South German gulden]], [[Bremen thaler]], [[Hamburg mark]], [[French franc]] <small>(until 1873, together)</small>
*[[German gold mark|Goldmark]] <small>(1873–1914)</small>
*[[German Papiermark|Papiermark]] <small>(after 1914)</small>
}}
|footnotes = Area and population not including colonial possessions
|today =
}}
</pre>
{{hidden end}}
== Errors ==
If the template generates errors when calculating data for the Gini or HDI fields, it will add the article to [[:Category:Country articles requiring maintenance]]. This only happens if the page is in the [[WP:MAINSPACE|main article space]], not any other [[WP:NAMESPACE|namespaces]].
== Microformat ==
{{UF-hcard-place}}
== Tracking categories ==
* {{clc|Country articles requiring maintenance}}
* {{clc|Pages using infobox country with unknown parameters}}
* {{clc|Pages using infobox country with syntax problems}}
* {{clc|Pages using infobox country or infobox former country with the flag caption or type parameters}}
* {{clc|Pages using infobox country or infobox former country with the symbol caption or type parameters}}
* {{clc|Former country articles using status text with Colony or Exile}}
== TemplateData ==
{{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "This template produces an infobox for countries that covers their major attributes such as their flags, ethnic makeup, and political system.",
"params": {
"conventional_long_name": {
"label": "Conventional long name",
"type": "string",
"required": false,
"description": "Formal or official full name of the country in English. This entry should not be enclosed in brackets.",
"example": "The United States of America"
},
"common_name": {},
"linking_name": {},
"native_name": {
"label": "Native name",
"type": "string",
"required": false,
"example": "{{native name|Bundesrepublik Deutschland}}",
"description": "Country's name (usually full name) in its native language, hence in italics (double quotemarks). The template {{native name}} should be used with this parameter to automatically italicize the text."
},
"name": {
"label": "Geopolitical organisation name",
"type": "string",
"required": false,
"description": "Name of the geopolitical organisation in English."
},
"image_flag": {
"label": "Flag",
"type": "wiki-file-name",
"required": false,
"example": "Flag of Iceland.svg",
"description": "File name of an image file on Wikipedia or on Commons that contains the country's current flag. Do not enclose this entry in double brackets and do not give it a prefix such as File:"
},
"flag_width": {
"label": "Flag width",
"type": "string",
"required": false,
"description": "If the default widths provided for the flag and coat-of-arms/symbol images produce an unsatisfactory result, use this to specify the width to be used for the flag image; the remaining width is then assigned to the coat-of-arms/symbol (if included). Can be done as a % or px."
},
"alt_flag": {
"label": "Flag alt text",
"type": "string",
"required": false,
"description": "Alternate text for flag (text shown when pointer hovers over flag)."
},
"flag_border": {
"label": "Flag border",
"type": "string",
"required": false,
"description": "Set to no to disable border around the flag."
},
"flag_caption": {
"label": "Flag caption",
"type": "string",
"required": false,
"description": "Use this parameter to enter a caption for the flag, if one is necessary. Do not end this entry with a period.",
"example": "1992 version of the flag prior to the country's dissolution"
},
"image_flag2": {
"label": "Second flag",
"type": "wiki-file-name",
"required": false,
"example": "Secondflag of Namibia.svg",
"description": "If a country has a second flag— perhaps because of an ongoing civil war or a dispute over sovereignty— you can provide the file name of that second flag in this parameter. Do not include the prefix File:, and do not enclose it in double brackets."
},
"alt_flag2": {
"label": "Second flag alt text",
"type": "string",
"required": false,
"description": "Alt text for second flag (text shown when pointer hovers over flag)."
},
"flag2_border": {
"label": "Second flag border",
"type": "string",
"required": false,
"description": "Set to no to disable border around the flag."
},
"image_coat": {
"label": "Coat of arms",
"type": "wiki-file-name",
"aliases": [
"image_symbol"
],
"example": "Great Seal of the United States (obverse).svg"
},
"symbol_width": {
"label": "Symbol width",
"type": "string",
"required": false,
"description": "Symbol image's width.",
"default": "85px"
},
"alt_coat": {
"label": "Coat of arms alt text",
"type": "string",
"aliases": [
"alt_symbol",
"coat_alt"
],
"required": false,
"description": "Alt text for coat of arms."
},
"symbol_type": {
"label": "Symbol type",
"type": "string",
"required": false,
"description": "If not a coat of arms.",
"example": "emblem, seal, etc"
},
"symbol_type_article": {
"label": "Symbol type article",
"type": "string",
"description": "An article about the type of symbol of the country"
},
"text_symbol": {
"label": "Text symbol",
"type": "string",
"required": false,
"description": "For other types of text symbol.",
"example": "''[hymn name]''"
},
"text_symbol_type": {
"label": "Text symbol type",
"type": "string",
"required": false,
"description": "For other types of text symbol."
},
"other_symbol": {
"label": "Other symbol",
"type": "string",
"required": false,
"description": "Use if a further symbol exists."
},
"other_symbol_type": {
"label": "Other symbol type",
"type": "string",
"required": false
},
"national_motto": {
"label": "National motto",
"type": "string",
"required": false,
"example": "{{lang|de|''{{lang|de|[[Das Lied der Deutschen|Einigkeit und Recht und Freiheit]]}}''}}",
"description": "In inverted commas and wikilinked if link exists. Can also be used with the {{lang}} template and correct two-letter language code to designate the language of the motto where not provided in English."
},
"motto": {
"label": "Motto",
"type": "string",
"required": false
},
"national_anthem": {
"label": "National anthem",
"type": "string",
"required": false,
"description": "In inverted commas and wikilinked if link exists."
},
"anthem": {
"label": "Anthem",
"type": "string",
"required": false
},
"royal_anthem": {
"label": "Royal anthem",
"type": "string",
"required": false,
"description": "In inverted commas and wikilinked if link exists."
},
"image_map": {
"label": "Map",
"type": "string",
"required": false,
"example": "LocationCountry.svg"
},
"map_width": {
"label": "Map width",
"type": "string",
"required": false,
"description": "Map image's width.",
"default": "250px"
},
"alt_map": {
"label": "Map alt text",
"type": "string",
"required": false
},
"map_caption": {
"label": "Map caption",
"type": "string",
"required": false,
"description": "Caption to place below map."
},
"image_map2": {
"label": "Map 2",
"type": "string",
"required": false,
"description": "Another map, if required."
},
"map2_width": {
"label": "Map 2 width",
"type": "string",
"required": false
},
"alt_map2": {
"label": "Map 2 alt text",
"type": "string",
"required": false
},
"map_caption2": {
"label": "Map 2 caption",
"type": "string",
"required": false,
"description": "Caption to place below second map."
},
"image_map3": {},
"map3_width": {},
"alt_map3": {},
"map_caption3": {},
"capital": {
"label": "Capital",
"type": "string",
"required": false,
"description": "Name of country/territory's capital, wikilinked if link exists."
},
"capital_type": {
"label": "Capital type",
"type": "string",
"required": false
},
"coordinates": {
"label": "Coordinates",
"type": "string",
"required": false,
"description": "The geographic coordinates of the capital."
},
"latd": {
"label": "Latitude degrees",
"type": "string",
"required": false,
"description": "The degrees of the capital's latitude."
},
"latm": {
"label": "Latitude minutes",
"type": "string",
"description": "The minutes of the capital's latitude."
},
"latNS": {
"label": "Latitude NS",
"type": "string",
"description": "The direction of the capital's latitude."
},
"longd": {
"label": "Longitude degrees",
"type": "string",
"description": "The degrees of the capital's longitude."
},
"longm": {
"label": "Longitude minutes",
"type": "string",
"description": "The minutes of the capital's longitude."
},
"longEW": {
"label": "Longitude EW",
"type": "string",
"description": "The direction of the capital's longitude."
},
"admin_center": {
"label": "Administrative center",
"type": "string",
"required": false,
"description": "Location/s of administrative center/s."
},
"admin_center_type": {
"label": "Administrative center type",
"type": "string",
"required": false,
"default": "Administrative center"
},
"capital2": {
"label": "Capital 2",
"type": "string",
"required": false,
"description": "Name of country/territory's capital, wikilinked if link exists."
},
"capital_type2": {
"label": "Capital 2 type",
"type": "string",
"required": false
},
"admin_center2": {
"label": "Administrative center 2",
"type": "string",
"required": false
},
"admin_center_type2": {
"label": "Administrative center 2 type",
"type": "string",
"required": false
},
"largest_city": {
"label": "Largest city",
"type": "string",
"required": false,
"description": "Name of country/territory's largest city. Use \"capital\" (without quotemarks) if it's the capital."
},
"largest_settlement": {
"label": "Largest settlement",
"type": "string",
"required": false,
"description": "Name of largest settlement if not a city."
},
"largest_settlement_type": {
"label": "Largest settlement type",
"type": "string",
"required": false,
"description": "Type of settlement if largest settlement not a city."
},
"official_languages": {
"label": "Official languages",
"type": "string",
"required": false,
"description": "Languages recognised in legislation, constitution, etc."
},
"national_languages": {
"label": "National languages",
"type": "string",
"required": false,
"description": "Country/territory-wide languages recognised but not necessarily in country/territory-wide law, etc."
},
"regional_languages": {
"label": "Regional languages",
"type": "string",
"required": false,
"description": "Languages recognised or associated with particular regions within the country/territory."
},
"languages_type": {
"label": "Languages type",
"type": "string",
"description": "Use to specify a further type of language, if not official, national or regional."
},
"languages_sub": {
"label": "Languages sub",
"type": "string",
"required": false,
"description": "Is this further type of language a sub-item of the previous non-sub type?",
"example": "'yes' or 'no'"
},
"languages": {
"label": "Languages",
"type": "string",
"required": false,
"description": "Languages of the further type."
},
"languages2_type": {
"label": "2nd languages type",
"type": "string",
"description": "Use to specify a 2nd further type of language, if not official, national or regional."
},
"languages2_sub": {
"label": "Languages 2 sub",
"type": "string",
"required": false,
"description": "Is the second alternative type of languages a sub-item of the previous non-sub type?",
"example": "'yes or 'no'"
},
"languages2": {
"label": "Languages 2",
"type": "string",
"required": false,
"description": "Languages of the second further type."
},
"ethnic_groups": {
"label": "Ethnic groups",
"type": "string",
"required": false,
"description": "The primary ethnic groups of the country",
"example": "{{unbulleted list | 68.8% [[Bumiputera (Malaysia)|Bumiputera]] | 23.2% [[Malaysian Chinese|Chinese]] | 7.0% [[Malaysian Indian|Indian]] | 1.0% Others }}"
},
"ethnic_groups_ref": {
"label": "Ethnic groups reference",
"type": "string",
"required": false,
"description": "Reference, in <ref> format, of ethnic composition"
},
"ethnic_groups_year": {
"label": "Ethnic groups year",
"type": "number",
"required": false,
"description": "Year the ethnic group statistic is from",
"example": "2017"
},
"religion": {
"label": "Religions",
"type": "string",
"required": false,
"description": "List of religious affiliations in {{ublist}} format",
"example": "{{ublist|list_style=line-height:1.3em; |class=nowrap | 33.2% [[Buddhism in Singapore|Buddhism]]...}}"
},
"religion_ref": {
"label": "Religions reference",
"type": "string",
"required": false,
"description": "Reference, in <ref> format, of religious composition"
},
"demonym": {
"label": "Demonym",
"type": "string",
"required": false,
"description": "Name of residents of this country",
"example": "Singaporean",
"suggested": true
},
"org_type": {
"label": "Organization type",
"type": "string",
"required": false
},
"membership": {
"label": "membership",
"type": "string",
"required": false
},
"membership_type": {
"label": "membership_type",
"type": "string",
"required": false
},
"government_type": {
"label": "Type of government",
"type": "string",
"required": false,
"description": "The type of government, e.g. federal republic",
"example": "[[Monarchy]]"
},
"politics_link": {
"label": "Politics link",
"type": "string",
"required": false
},
"leader_title1": {
"label": "Leader 1 title",
"type": "line",
"required": false,
"description": "Title of principal leader",
"example": "[[President of Singapore|President]]"
},
"leader_name1": {
"label": "Leader 1 name",
"type": "line",
"required": false,
"description": "Name of principal leader",
"example": "[[Halimah Yacob]]"
},
"leader_title2": {
"label": "Leader 2 title",
"type": "line",
"required": false,
"description": "Title of 2nd leader",
"example": "[[Prime Minister of Singapore|Prime Minister]]"
},
"leader_name2": {
"label": "Leader 2 name",
"type": "line",
"description": "Name of 2nd leader",
"example": "[[Lee Hsien Loong]]"
},
"leader_title3": {
"label": "Leader 3 title",
"type": "line",
"required": false,
"description": "Title of 3rd leader",
"example": "[[Deputy Prime Minister of Singapore|Deputy Prime Ministers]]"
},
"leader_name3": {
"label": "Leader 3 name",
"type": "line",
"description": "Name of 3rd leader",
"example": "[[Teo Chee Hean]]<br>[[Tharman Shanmugaratnam]]"
},
"leader_title4": {
"label": "Leader 4 title",
"type": "line",
"required": false,
"description": "Title of the 4th leader",
"example": "[[President pro tempore of the United States Senate|President pro tempore]]"
},
"leader_name4": {
"label": "Leader 4 name",
"type": "line",
"description": "Name of the 4th leader"
},
"leader_title5": {
"label": "leader_title5",
"type": "string",
"required": false
},
"leader_name5": {
"label": "Leader name 5",
"type": "string"
},
"leader_title6": {
"label": "Leader title 6",
"type": "string",
"required": false
},
"leader_name6": {
"label": "Leader name 6",
"type": "string"
},
"leader_title7": {
"label": "Leader title7",
"type": "string",
"required": false
},
"leader_name7": {
"label": "Leader name 7",
"type": "string"
},
"leader_title8": {
"label": "Leader title 8",
"type": "string",
"required": false
},
"leader_name8": {
"label": "Leader name 8",
"type": "string"
},
"leader_title9": {
"label": "Leader title 9",
"type": "string",
"required": false
},
"leader_name9": {
"label": "Leader name 9",
"type": "string"
},
"leader_title10": {
"label": "Leader title 10",
"type": "string",
"required": false
},
"leader_name10": {
"label": "Leader name 10",
"type": "string"
},
"leader_title11": {
"label": "Leader title 11",
"type": "string",
"required": false
},
"leader_name11": {
"label": "Leader name 11",
"type": "string"
},
"leader_title12": {
"label": "Leader title 12",
"type": "string",
"required": false
},
"leader_name12": {
"label": "Leader name 12",
"type": "string"
},
"leader_title13": {
"label": "Leader title 13",
"type": "string",
"required": false
},
"leader_name13": {
"label": "Leader name 13",
"type": "string"
},
"leader_title14": {
"label": "Leader title 14",
"type": "string",
"required": false
},
"leader_name14": {
"label": "Leader name 14",
"type": "string"
},
"legislature": {
"label": "Legislature",
"type": "line",
"description": "Name of, and link to, the country's national legislature",
"example": "[[Parliament of Singapore|Parliament]]"
},
"upper_house": {
"description": "Upper house of the country or organization's legislature",
"type": "string",
"example": "[[United States House of Representatives|House of Representatives]]"
},
"lower_house": {
"description": "Lower house of the country or organization's legislature",
"label": "Lower house",
"type": "string",
"example": "[[United States House of Representatives|House of Representatives]]"
},
"sovereignty_type": {
"label": "Sovereignty type",
"type": "line",
"required": false,
"description": "Type of sovereignty this country has",
"example": "Independence"
},
"sovereignty_note": {
"label": "Sovereignty note",
"type": "content",
"required": false,
"description": "Note about this country's sovereignty",
"example": "from the [[United Kingdom]]"
},
"established": {
"label": "established",
"type": "string",
"required": false
},
"established_event1": {
"label": "Establishment event 1",
"type": "string",
"required": false
},
"established_date1": {
"label": "Establishment date 1",
"type": "string",
"required": false
},
"established_event2": {
"label": "Establishment event 2",
"type": "string",
"required": false
},
"established_date2": {
"label": "Establishment date 2",
"type": "string",
"required": false
},
"established_event3": {
"label": "Establishment event 3",
"type": "string",
"required": false
},
"established_date3": {
"label": "Establishment date 3",
"type": "string",
"required": false
},
"established_event4": {
"label": "Establishment event 4",
"type": "string",
"required": false
},
"established_date4": {
"label": "established_date4",
"type": "string",
"required": false
},
"established_event5": {
"label": "Establishment event 5",
"type": "string",
"required": false
},
"established_date5": {
"label": "established_date5",
"type": "string",
"required": false
},
"established_event6": {
"label": "established_event6",
"type": "string",
"required": false
},
"established_date6": {
"label": "established_date6",
"type": "string",
"required": false
},
"established_event7": {
"label": "established_event7",
"type": "string",
"required": false
},
"established_date7": {
"label": "established_date7",
"type": "string",
"required": false
},
"established_event8": {
"label": "established_event8",
"type": "string",
"required": false
},
"established_date8": {
"label": "established_date8",
"type": "string",
"required": false
},
"established_event9": {
"label": "established_event9",
"type": "string",
"required": false
},
"established_date9": {
"label": "established_date9",
"type": "string",
"required": false
},
"established_event10": {
"label": "established_event10",
"type": "string",
"required": false
},
"established_date10": {
"label": "established_date10",
"type": "string",
"required": false
},
"established_event11": {
"label": "established_event11",
"type": "string",
"required": false
},
"established_date11": {
"label": "established_date11",
"type": "string",
"required": false
},
"established_event12": {
"label": "established_event12",
"type": "string",
"required": false
},
"established_date12": {
"label": "established_date12",
"type": "string",
"required": false
},
"area_km2": {
"label": "Land area (km²)",
"type": "number",
"required": false,
"description": "Land area of the country in square kilometers",
"example": "722.5",
"suggested": true
},
"area_link": {
"label": "area_link",
"type": "string",
"required": false
},
"area_label": {
"label": "area_label",
"type": "string",
"required": false
},
"FR_foot4": {
"label": "FR_foot4",
"type": "string",
"required": false,
"deprecated": true
},
"area_footnote": {
"label": "area_footnote",
"type": "string",
"required": false
},
"area_rank": {
"label": "Area rank",
"type": "string",
"required": false,
"description": "Rank among countries of land area",
"example": "174th",
"suggested": true
},
"area_sq_mi": {
"label": "Land area (mi²)",
"type": "number",
"required": false,
"description": "Land area of the country in square miles",
"example": "290"
},
"percent_water": {
"label": "percent_water",
"type": "string",
"required": false
},
"area_label2": {
"label": "area_label2",
"type": "string",
"required": false
},
"area_data2": {
"label": "area_data2",
"type": "string",
"required": false
},
"area_label3": {
"label": "area_label3",
"type": "string",
"required": false
},
"area_data3": {
"label": "area_data3",
"type": "string",
"required": false
},
"FR_metropole": {
"label": "FR_metropole",
"type": "string",
"required": false,
"deprecated": true
},
"FR_foot2": {
"label": "FR_foot2",
"type": "string",
"required": false,
"deprecated": true
},
"FR_IGN_area_km2": {
"label": "FR_IGN_area_km2",
"type": "string",
"required": false,
"deprecated": true
},
"FR_IGN_area_rank": {
"label": "FR_IGN_area_rank",
"type": "string",
"required": false,
"deprecated": true
},
"FR_IGN_area_sq_mi": {
"label": "FR_IGN_area_sq_mi",
"type": "string",
"required": false,
"deprecated": true
},
"FR_foot3": {
"label": "FR_foot3",
"type": "string",
"required": false,
"deprecated": true
},
"FR_cadastre_area_km2": {
"label": "FR_cadastre_area_km2",
"type": "string",
"required": false,
"deprecated": true
},
"FR_cadastre_area_rank": {
"label": "FR_cadastre_area_rank",
"type": "string",
"required": false,
"deprecated": true
},
"FR_cadastre_area_sq_mi": {
"label": "FR_cadastre_area_sq_mi",
"type": "string",
"required": false,
"deprecated": true
},
"population_estimate": {
"label": "Population estimate",
"type": "number",
"required": false,
"description": "An estimate of the country's population",
"example": "24,000,000"
},
"population_census": {
"label": "Population census",
"type": "string"
},
"population_link": {
"label": "Population link",
"type": "url"
},
"population_estimate_year": {
"label": "Population estimate year",
"type": "number",
"description": "The year the population estimate is from",
"example": "2018"
},
"population_estimate_rank": {
"label": "Population estimate rank",
"type": "string",
"description": "Rank among countries in estimated population",
"example": "3rd"
},
"population_label2": {
"label": "population_label2",
"type": "string",
"required": false
},
"population_data2": {
"label": "Population data 2",
"type": "string",
"required": false
},
"population_label3": {
"label": "Population label 3",
"type": "string",
"required": false
},
"population_data3": {
"label": "Population data 3",
"type": "string",
"required": false
},
"population_census_year": {
"label": "Population census year",
"type": "number",
"required": false,
"description": "Year the population census statistics are from",
"example": "2010"
},
"population_census_rank": {
"label": "Population census rank",
"type": "string",
"description": "Rank among countries in census population",
"example": "3rd"
},
"population_density_km2": {
"label": "Population density per km²",
"type": "number",
"example": "20,212",
"description": "Population density per square kilometer"
},
"population_density_sq_mi": {
"label": "Population density per mi²",
"type": "number",
"description": "Population density per square mile",
"example": "20,212"
},
"pop_den_footnote": {
"label": "Population density footnote",
"type": "string",
"description": "footnote about the population density statistic"
},
"population_density_rank": {
"label": "Population density rank",
"type": "string",
"required": false,
"description": "Rank among countries in population density",
"example": "3rd"
},
"FR_metropole_population": {
"label": "FR_metropole_population",
"type": "string",
"required": false,
"deprecated": true
},
"FR_total_population_estimate_year": {
"label": "FR_total_population_estimate_year",
"type": "string",
"deprecated": true
},
"FR_foot": {
"label": "FR_foot",
"type": "string",
"deprecated": true
},
"FR_total_population_estimate": {
"label": "FR_total_population_estimate",
"type": "string",
"deprecated": true
},
"FR_total_population_estimate_rank": {
"label": "FR_total_population_estimate_rank",
"type": "string",
"deprecated": true
},
"FR_metropole_population_estimate_rank": {
"label": "FR_metropole_population_estimate_rank",
"type": "string",
"deprecated": true
},
"FR_foot5": {
"label": "FR_foot5",
"type": "string",
"required": false,
"deprecated": true
},
"GDP_PPP": {
"label": "GDP (PPP)",
"type": "line",
"required": false,
"description": "Gross domestic product (purchasing power parity)",
"example": "$554.855 billion",
"suggested": true
},
"GDP_PPP_year": {
"label": "GDP (PPP) year cited",
"type": "number",
"required": false,
"description": "Year the GDP (PPP) statistic is cited from",
"example": "2018",
"suggested": true
},
"GDP_PPP_rank": {
"label": "GDP (PPP) rank",
"type": "string",
"required": false,
"description": "Rank among countries for GDP PPP",
"example": "39th"
},
"GDP_PPP_per_capita": {
"label": "GDP_PPP_per_capita",
"type": "line",
"required": false,
"description": "Gross domestic product (purchasing power parity) per capita",
"example": "$98,014"
},
"GDP_PPP_per_capita_rank": {
"label": "GDP (PPP) per capita rank",
"type": "line",
"required": false,
"description": "Rank among countries for GDP PPP per capita",
"example": "3rd"
},
"GDP_nominal": {
"label": "GDP (nominal)",
"type": "string",
"required": false,
"description": "Nominal GDP of the country"
},
"GDP_nominal_year": {
"label": "GDP (nominal) year",
"type": "number",
"required": false,
"description": "Year cited for the country's nominal GDP statistic"
},
"GDP_nominal_rank": {
"label": "GDP (nominal) rank",
"type": "string",
"required": false,
"description": "Rank among countries for nominal GDP",
"example": "41st"
},
"GDP_nominal_per_capita": {
"label": "GDP (nominal) per capita",
"type": "string",
"required": false,
"description": "Nominal GDP per capita in the country",
"example": "$61,766"
},
"GDP_nominal_per_capita_rank": {
"label": "GDP (nominal) per capita rank",
"type": "string",
"required": false,
"description": "Rank among countries for nominal GDP per capita",
"example": "8th"
},
"Gini": {
"label": "Gini index",
"type": "number",
"required": false,
"description": "Gini index of the country",
"example": "46.4"
},
"Gini_year": {
"label": "Gini index year cited",
"type": "number",
"required": false,
"description": "Year the gini index statistic is cited for",
"example": "2014"
},
"Gini_change": {
"label": "Gini change",
"type": "string",
"required": false,
"description": "\"increase\" or \"decrease\" (over last year)",
"example": "increase"
},
"Gini_ref": {
"label": "Gini index reference",
"type": "line",
"required": false,
"description": "Reference for cited Gini index statistic"
},
"Gini_rank": {
"label": "Gini rank",
"type": "string",
"required": false,
"description": "Rank of Gini indices",
"example": "30th"
},
"HDI": {
"label": "Human development index",
"type": "number",
"required": false,
"example": "0.932",
"suggested": true,
"description": "The country's human development index (HDI)"
},
"HDI_year": {
"label": "Human Development Index year",
"type": "number",
"required": false,
"description": "Year to which the HDI statistic refers",
"example": "2017",
"suggested": true
},
"HDI_change": {
"label": "HDI change",
"type": "string",
"required": false,
"description": "\"increase\" or \"decrease\" from previous year",
"example": "increase"
},
"HDI_ref": {
"label": "Human Development Index reference",
"type": "line",
"required": false,
"description": "Reference for HDI statistic"
},
"HDI_rank": {
"label": "Human development index rank",
"type": "string",
"required": false,
"description": "Rank among countries for HDI score",
"example": "9th"
},
"currency": {
"label": "Currency",
"type": "line",
"required": false,
"description": "National/official currency name and article link",
"example": "[[Singapore dollar]]"
},
"currency_code": {
"label": "Currency code",
"type": "line",
"required": false,
"description": "Currency code of the official currency",
"example": "SGD"
},
"time_zone": {
"label": "Time zone",
"type": "line",
"required": false,
"description": "National time zone(s)",
"example": "[[Singapore Standard Time|SST]]"
},
"utc_offset": {
"label": "UTC offsets",
"type": "string",
"example": "−4 to −12, +10, +11"
},
"utc_offset_DST": {
"label": "UTF offsets (DST)",
"type": "string",
"example": "−4 to −10"
},
"DST_note": {
"label": "DST note",
"type": "string",
"example": "{{efn|name=\"time\"}}"
},
"time_zone_DST": {
"label": "Time zones (DST)",
"type": "string",
"required": false
},
"DST": {
"label": "Daylight savings time",
"type": "string",
"required": false
},
"antipodes": {
"label": "antipodes",
"type": "string",
"required": false
},
"date_format": {
"label": "Date format",
"type": "string",
"required": false
},
"electricity": {
"label": "Mains electricity",
"type": "string",
"required": false
},
"drives_on": {
"label": "drives on",
"type": "string",
"required": false
},
"rail gauge": {
"label": "Rail gauge",
"type": "string",
"required": false
},
"calling_code": {
"label": "Calling code",
"type": "string",
"example": "+1"
},
"patron_saint": {
"label": "Patron saint",
"aliases": [
"patron_saints"
],
"type": "string",
"required": false
},
"iso3166code": {
"label": "ISO 3166 code",
"type": "string",
"description": "ISO 3166 code for the country",
"example": "US"
},
"cctld": {
"label": "Country code top level domain",
"type": "string",
"example": ".se"
},
"official_website": {
"label": "official_website",
"type": "string",
"required": false,
"description": "For geopolitical entities: do not use government website (e.g. usa.gov) for countries (e.g. [[United States]])."
},
"footnote_a": {
"label": "footnote_a",
"type": "string",
"required": false
},
"footnote_b": {
"label": "footnote_b",
"type": "string",
"required": false
},
"footnote_c": {
"label": "footnote_c",
"type": "string",
"required": false
},
"footnote_d": {
"label": "footnote_d",
"type": "string",
"required": false
},
"footnote_e": {
"label": "footnote_e",
"type": "string",
"required": false
},
"footnote_f": {
"label": "footnote_f",
"type": "string",
"required": false
},
"footnote_g": {
"label": "footnote_g",
"type": "string",
"required": false
},
"footnote_h": {
"label": "footnote_h",
"type": "string",
"required": false
},
"footnote1": {
"label": "footnote1",
"type": "string",
"required": false
},
"footnote2": {
"label": "footnote2",
"type": "string",
"required": false
},
"footnote3": {
"label": "footnote3",
"type": "string",
"required": false
},
"footnote4": {
"label": "footnote4",
"type": "string",
"required": false
},
"footnote5": {
"label": "footnote5",
"type": "string",
"required": false
},
"footnote6": {
"label": "footnote6",
"type": "string",
"required": false
},
"footnote7": {
"label": "footnote7",
"type": "string",
"required": false
},
"footnote8": {
"label": "footnote8",
"type": "string",
"required": false
},
"footnotes": {
"label": "footnotes",
"type": "string",
"required": false
},
"navbar": {
"label": "navbar",
"type": "string",
"required": false
},
"micronation": {},
"status": {
"type": "line"
},
"status_text": {
"type": "line"
},
"empire": {},
"year_end": {
"type": "number"
},
"year_exile_start": {
"type": "number"
},
"year_exile_end": {
"type": "number"
},
"life_span": {
"type": "line"
},
"year_start": {
"type": "number"
},
"flag_size": {
"type": "line"
},
"flag_alt": {
"type": "string"
},
"flag_alt2": {
"type": "string"
},
"flag_type": {
"type": "string"
},
"coa_size": {
"type": "line"
},
"englishmotto": {
"type": "string",
"label": "Motto in English",
"description": "The country's motto translated into English"
},
"image_map_size": {
"type": "line"
},
"image_map_alt": {
"type": "string"
},
"image_map_caption": {
"type": "content"
},
"image_map2_size": {
"type": "line"
},
"image_map2_alt": {
"type": "string"
},
"image_map2_caption": {
"type": "content"
},
"loctext": {
"type": "string"
},
"capital_exile": {
"type": "string"
},
"recognized_languages": {
"aliases": [
"recognised_languages"
],
"type": "content",
"label": "Recognized languages",
"description": "Recognized languages of the country, possibly in list format"
},
"recognized_national_languages": {
"aliases": [
"recognised_national_languages"
],
"type": "content",
"label": "Recognized national languages",
"description": "Recognized national languages of the country, possibly in list format"
},
"recognized_regional_languages": {
"aliases": [
"recognised_regional_languages"
],
"type": "content",
"label": "Recognized regional languages",
"description": "Recognized regional languages of the country, possibly in list format"
},
"common_languages": {
"type": "content",
"label": "Common languages",
"description": "Common languages of the country, possibly in list format",
"example": "{{ublist|[[English language|English]]|[[Spanish language|Spanish]]|[[Chinese language|Chinese]]}}"
},
"religion_year": {
"type": "number",
"label": "Religion statistic year",
"description": "Year the religion statistic is from",
"example": "2015"
},
"leader_title15": {
"type": "line"
},
"leader_name15": {
"type": "line"
},
"title_leader": {
"type": "line",
"label": "Leader's title",
"description": "Title of the country's leader",
"example": "[[President of the United States|President]]"
},
"year_leader1": {
"type": "line",
"label": "Leader 1 years",
"description": "Years the first leader reigned",
"example": "1776-1795"
},
"leader1": {
"type": "line",
"label": "Leader 1",
"description": "The first leader of the country",
"example": "[[George Washington]]"
},
"year_leader2": {
"type": "line"
},
"leader2": {
"type": "line"
},
"year_leader3": {
"type": "line"
},
"leader3": {
"type": "line"
},
"year_leader4": {
"type": "line"
},
"leader4": {
"type": "line"
},
"year_leader5": {
"type": "line"
},
"leader5": {
"type": "line"
},
"year_leader6": {
"type": "line"
},
"leader6": {
"type": "line"
},
"year_leader7": {
"type": "line"
},
"leader7": {
"type": "line"
},
"year_leader8": {
"type": "line"
},
"leader8": {
"type": "line"
},
"year_leader9": {
"type": "line"
},
"leader9": {
"type": "line"
},
"year_leader10": {
"type": "line"
},
"leader10": {
"type": "line"
},
"year_leader11": {
"type": "line",
"label": "Leader 11 years",
"description": "Year of leader 11",
"example": "1980-1987"
},
"leader11": {
"type": "line"
},
"title_representative": {
"type": "line",
"label": "Representative title",
"description": "Title of the country's representative",
"example": "[[Governor General of Canada|Governor General]]"
},
"year_representative1": {
"type": "line",
"label": "Representative 1 years",
"description": "Year of representative 1",
"example": "1492-1506"
},
"representative1": {
"type": "line",
"label": "Representative 1",
"description": "First representative"
},
"year_representative2": {
"type": "line",
"label": "Representative 2 years",
"description": "Year of representative 2",
"example": "1552-1580"
},
"representative2": {
"type": "line"
},
"year_representative3": {
"type": "line",
"label": "Representative 3 years",
"description": "Year of representative 3",
"example": "1652-1666"
},
"representative3": {
"type": "line"
},
"year_representative4": {
"type": "line",
"label": "Representative 4 year",
"description": "Year of representative 4",
"example": "1652-1666"
},
"representative4": {
"type": "line"
},
"year_representative5": {
"type": "line",
"label": "Representative 5 years",
"description": "Year of representative 5",
"example": "1652-1666"
},
"representative5": {
"type": "line"
},
"title_deputy": {
"type": "line"
},
"year_deputy1": {
"type": "line",
"label": "Deputy 1 years",
"description": "Years of the 1st deputy",
"example": "2006-2009"
},
"deputy1": {
"type": "line",
"label": "Deputy 1",
"description": "First deputy"
},
"year_deputy2": {
"type": "line",
"label": "Deputy 2 years",
"description": "Years of the 2nd deputy",
"example": "2009-2011"
},
"deputy2": {
"type": "line"
},
"year_deputy3": {
"type": "line",
"label": "Deputy 3 years",
"description": "Years of the 3rd deputy",
"example": "2011-2013"
},
"deputy3": {
"type": "line"
},
"year_deputy4": {
"type": "line",
"label": "Deputy 4 years",
"description": "Years of the 4th deputy",
"example": "2013-2016"
},
"deputy4": {
"type": "line"
},
"year_deputy5": {
"type": "line",
"label": "Deputy 5 years",
"description": "Years of the 5th deputy",
"example": "2016-2018"
},
"deputy5": {
"type": "line"
},
"year_deputy6": {
"type": "line",
"label": "Deputy 6 years",
"description": "Years of the 6th deputy",
"example": "2018-"
},
"deputy6": {
"type": "line"
},
"type_house1": {
"type": "line"
},
"house1": {
"type": "line"
},
"type_house2": {
"type": "line"
},
"house2": {
"type": "line"
},
"event_pre": {
"type": "line"
},
"established_event13": {
"label": "Establishment event 13",
"type": "line"
},
"established_date13": {
"label": "Establishment date 13",
"type": "date"
},
"established_event14": {
"type": "line"
},
"established_date14": {
"type": "line"
},
"established_event15": {
"type": "line"
},
"established_date15": {
"type": "line"
},
"event_start": {
"label": "Starting event",
"description": "The foundational event of the country",
"example": "Established",
"type": "string"
},
"date_pre": {},
"date_start": {
"label": "Date established",
"description": "Date the country, dynasty or organization was established (date of event_start)",
"example": "601 CE",
"type": "string"
},
"event1": {
"label": "Event 1",
"description": "First significant event",
"example": "Signing of the [[Chanyuan Treaty]] with [[Liao dynasty|Liao]]",
"type": "string"
},
"date_event1": {
"label": "Event 1 date",
"description": "Date of the first significant event",
"example": "601",
"type": "date"
},
"event2": {
"label": "Event 2",
"description": "Second significant event",
"example": "[[Alliance Conducted at Sea|Alliance with Jin]]",
"type": "string"
},
"date_event2": {
"label": "Event 2 date",
"description": "Date of the second significant event",
"type": "string"
},
"event3": {
"label": "Event 3",
"description": "Third significant event",
"example": "[[Jingkang Incident]]",
"type": "string"
},
"date_event3": {},
"event4": {
"label": "Event 4",
"description": "Fourth significant event",
"example": "Beginning of [[Mongol conquest of the Song dynasty|Mongol invasion]]",
"type": "string"
},
"date_event4": {},
"event5": {
"label": "Event 5",
"description": "Fifth significant event",
"example": "Fall of [[Hangzhou|Lin'an]]",
"type": "string"
},
"date_event5": {},
"event6": {
"label": "Event 6",
"description": "Sixth significant event",
"example": "[[Krystallnacht]]",
"type": "string"
},
"date_event6": {},
"event_end": {
"label": "Event ending the country",
"description": "The event that caused the country to stop existing or transition, if applicable",
"example": "[[Battle of Yamen]] (end of dynasty)",
"type": "string"
},
"date_end": {
"label": "End date",
"description": "Date the country stopped existing or transitioned, if applicable",
"example": "1433",
"type": "date"
},
"event_post": {},
"date_post": {},
"area_ha": {},
"area_acre": {},
"area_land_km2": {},
"area_land_ha": {},
"area_land_sq_mi": {},
"area_land_acre": {},
"area_water_km2": {},
"area_water_ha": {},
"area_water_sq_mi": {},
"area_water_acre": {},
"stat_area1": {},
"stat_area2": {},
"stat_area3": {},
"stat_area4": {},
"stat_area5": {},
"area_land_footnote": {},
"area_water_footnote": {},
"stat_year1": {},
"ref_area1": {},
"stat_year2": {},
"ref_area2": {},
"stat_year3": {},
"ref_area3": {},
"stat_year4": {},
"ref_area4": {},
"stat_year5": {
"label": "Statistic 5 year",
"description": "Year of statistic 5",
"example": "1933",
"type": "number"
},
"ref_area5": {},
"stat_pop1": {},
"stat_pop2": {},
"stat_pop3": {},
"stat_pop4": {},
"stat_pop5": {},
"ref_pop1": {},
"ref_pop2": {},
"ref_pop3": {},
"ref_pop4": {},
"ref_pop5": {},
"nummembers": {},
"p1": {},
"s1": {},
"flag_p1": {},
"image_p1": {},
"border_p1": {},
"flag_p2": {},
"image_p2": {},
"p2": {},
"border_p2": {},
"flag_p3": {},
"image_p3": {},
"p3": {},
"border_p3": {},
"flag_p4": {},
"image_p4": {},
"p4": {},
"border_p4": {},
"flag_p5": {},
"image_p5": {},
"p5": {},
"border_p5": {},
"flag_p6": {},
"image_p6": {},
"p6": {},
"border_p6": {},
"flag_p7": {},
"image_p7": {},
"p7": {},
"border_p7": {},
"flag_p8": {},
"image_p8": {},
"p8": {},
"border_p8": {},
"flag_p9": {},
"image_p9": {},
"p9": {},
"border_p9": {},
"flag_p10": {},
"image_p10": {},
"p10": {},
"border_p10": {},
"flag_p11": {},
"image_p11": {},
"p11": {},
"border_p11": {},
"flag_p12": {},
"image_p12": {},
"p12": {},
"border_p12": {},
"flag_p13": {},
"image_p13": {},
"p13": {},
"border_p13": {},
"flag_p14": {},
"image_p14": {},
"p14": {},
"border_p14": {},
"flag_p15": {},
"image_p15": {},
"p15": {},
"border_p15": {},
"flag_s1": {},
"image_s1": {},
"border_s1": {},
"flag_s2": {},
"image_s2": {},
"s2": {},
"border_s2": {},
"flag_s3": {},
"image_s3": {},
"s3": {},
"border_s3": {},
"flag_s4": {},
"image_s4": {},
"s4": {},
"border_s4": {},
"flag_s5": {},
"image_s5": {},
"s5": {},
"border_s5": {},
"flag_s6": {},
"image_s6": {},
"s6": {},
"border_s6": {},
"flag_s7": {},
"image_s7": {},
"s7": {},
"border_s7": {},
"flag_s8": {},
"image_s8": {},
"s8": {},
"border_s8": {},
"flag_s9": {},
"image_s9": {},
"s9": {},
"border_s9": {},
"flag_s10": {},
"image_s10": {},
"s10": {},
"border_s10": {},
"flag_s11": {},
"image_s11": {},
"s11": {},
"border_s11": {},
"flag_s12": {},
"image_s12": {},
"s12": {},
"border_s12": {},
"flag_s13": {},
"image_s13": {},
"s13": {},
"border_s13": {},
"flag_s14": {},
"image_s14": {},
"s14": {},
"border_s14": {},
"flag_s15": {},
"image_s15": {},
"s15": {},
"border_s15": {},
"today": {
"label": "Today part of",
"description": "For former countries, a list of countries of which the former country's territories are now part, if no more than four.",
"example": "{{plainlist| *[[Czech Republic]] *[[Denmark]] *[[France]] *[[Germany]] }}",
"type": "content",
"suggested": true
},
"footnotes2": {},
"symbol_caption": {},
"nested": {}
}
}
</templatedata>
{{cob}}
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
[[Category:Country infobox templates| ]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
f0add634a25f1dbf63f13654a3f8dbcb354a4b67
Template:Infobox geopolitical organization
10
162
323
322
2024-06-03T23:44:12Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox country]]{{R from alternate name}}
<!-- see Template:Infobox Geopolitical organization -->
4d4892c38a22f1866ca7a29f81ddbc7fc26967f5
Template:Lang
10
163
325
324
2024-06-03T23:44:13Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Lang|{{{fn|lang}}}}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
ed35aafbfe8198c5ad80fd861124244d0c7f2742
Template:Lower
10
164
327
326
2024-06-03T23:44:13Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="position: relative; top: {{safesubst<noinclude />:#if:{{{2|}}}|{{{1}}}|0.6em}};">{{{2|{{{1}}}}}}</span><noinclude>
{{documentation}}
</noinclude>
8c1373e7c520b1f0a9dd17ea8a02e8922e84bb99
Template:Native name
10
165
329
328
2024-06-03T23:44:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><!--
Name/Phrase:
-->{{lang |{{{1}}}{{#if:{{{script|}}}|-{{{script}}}|}} |italic={{#switch:{{{italics|{{{italic|}}}}}}|off|no=no|{{{italics|{{{italic|}}}}}}}}|{{{2}}}|template=Native name}}<!--
Language:
-->{{#switch:{{{paren|{{{icon|}}}}}}
|omit|off|no=
|#default= {{#switch:{{{italics|{{{italic|}}}}}} |off|no= |{{#switch:{{{nbsp|}}}|omit|no=| }}}}<!--
--><span class="languageicon" style="font-size:{{{parensize|{{{fontsize|100%}}}}}};font-weight:normal;"><!--
-->{{#if:{{{nolink|}}} |({{#invoke:lang|name_from_tag|{{{1}}}|template=Native name}})
| {{#if:{{#invoke:lang|is_ietf_tag|{{{1}}}}}|({{#invoke:lang|name_from_tag|{{{1}}}|template=Native name|link=yes}}) |(language?)}}<!--
-->}}<!--
--></span><!--
-->}}</includeonly><noinclude>{{Documentation}}</noinclude>
04fed5fe3f20675042a5f062b3bcd72defc1c83d
Template:Native phrase
10
166
331
330
2024-06-03T23:44:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#redirect [[Template:Native name]]
561f2c45647b28659d991f0a467779366e7ec49e
Template:Nowrap
10
167
333
332
2024-06-03T23:44:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="nowrap">{{{1}}}</span><noinclude>
{{documentation}}
<!-- Categories go on the /doc page; interwikis go to Wikidata. -->
</noinclude>
5d0dc6b6d89b37f4356242404f46138a4017f015
Template:Pad
10
168
335
334
2024-06-03T23:44:15Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><span style="padding-left:{{{1|1.0em}}};"> </span></includeonly><noinclude>{{Documentation}}</noinclude>
2599d1d54987c7f7e949b4a843acdb9f1c6af259
Template:Raise
10
169
337
336
2024-06-03T23:44:15Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="position:relative; bottom:{{#if:{{{2|}}} |{{{1}}} |0.6em}};">{{{2|{{{1}}}}}}</span><noinclude>{{Documentation}}</noinclude>
da747eda753555e094baeeb84eeca1be020ee399
Template:Resize
10
170
339
338
2024-06-03T23:44:15Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{safesubst<noinclude />:#if:{{{2|}}}
|<span style="font-size:{{{1|}}};">{{{2|}}}</span>
|<span style="font-size:90%;">{{{1}}}</span>
}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! -->
</noinclude>
d8a072f6a053371ba39a7306e2a001d420383b0d
Template:Smallsup
10
171
341
340
2024-06-03T23:44:16Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><sup><small>{{{1}}}</small></sup></includeonly><noinclude>
{{Documentation}}
</noinclude>
c174fb3247218273210500118556feb9f3c76d5a
Template:Spaces
10
172
343
342
2024-06-03T23:44:16Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="nowrap">{{#iferror:{{#expr:{{{1|1}}}}}
|{{#switch:{{{1}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}
|{{#invoke:String|rep|{{#switch:{{{2}}}
|fig= 
|en= 
|em= 
|thin= 
|hair= 
|
}}|{{{1|1}}}}}
}}</span><noinclude>
{{documentation}}
</noinclude>
a9ed762825e7579f15dcb9b171b0c1c3bf524b3f
Template:UF-hcard-place
10
173
345
344
2024-06-03T23:44:16Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
The HTML mark up produced by this template includes an [[HCard|hCard microformat]], which makes the place-name and location [[Parsing|parsable]] by computers, either acting automatically to catalogue article across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to an address book. For more information about the use of [[microformat]]s on Wikipedia, please see [[WP:UF|the microformat project]].
If the place or venue has an "established", "founded", "opened" or similar date that is specific to the day, use {{tl|start date}} [[Wikipedia:WikiProject Microformats/dates|unless the date is before 1583 CE]]. If it has a URL, use {{tl|URL}}.
hCard uses HTML classes including:
{{flatlist/microformat |
* adr
* category
* country-name
* extended-address
* fn
* label
* locality
* nickname
* note
* org
* street-address
* url
* vcard
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<includeonly>{{sandbox other||[[Category:Templates generating hCards]]}}</includeonly><noinclude>
[[Category:Templates generating hCards]]
[[Category:Microformat (uF) message templates]]
</noinclude>
4b191f1687db6dff942a47261bce5bc7c83da0b5
Template:\
10
174
347
346
2024-06-03T23:44:17Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
/ <noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
8cbfbe9d6f2aaa7726dfacfb2ee3c213dae39921
Template:Archive
10
175
349
348
2024-06-03T23:44:31Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>
{{#if: {{{status|}}}
|{{#invoke:Message box
|ambox
|name=Archive
|type= content
|issue=
This article '''contains information about the previous version of Alathra.''' {{#ifeq: {{{status|}}} | done | <br /> It has been permanently archived and given a protected status to prevent any further edits. | <br /> It will soon be archived and placed into the relevant archival category.}}
}}
}}
{{#ifeq: {{{status|}}} | undone | [[Category:Articles for archiving]] | {{#switch: {{{1}}}
|nation = [[Category:Archived nations]]
|town = [[Category:Archived towns]]
|place = [[Category:Archived places]]
|event = [[Category:Archived events]]
|player = [[Category:Archived players]]
|org = [[Category:Archived organizations]]
|religion = [[Category:Archived religions]]
|lore = [[Category:Archived lore]]
|item = [[Category:Archived artifacts]]
|book = [[Category:Archived books]]}}}}</includeonly>
<noinclude>
{{Documentation}}
</noinclude>
80fcb3c32f385d55d4ad8141a6e62bb6b161362a
Template:Main
10
176
351
350
2024-06-03T23:44:32Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:main|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
a7952a0ddabebcef9371e9783f0fed2425a59187
Template:Self reference
10
177
353
352
2024-06-03T23:44:33Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:{{{2|NONE}}}
|NONE|hatnote|hat={{Hatnote|extraclasses=plainlinks selfreference noprint|1={{{1}}}}}
|inline=<div class="plainlinks selfreference" style="display:inline; font-style: italic;"><!--Same style as class hatnote.-->{{{1}}}</div>
|<!--Matching the empty string here for unprintworthy content is for backwards compatibility with the 2006-2008 version. Do not depend on it!-->=<div style="display:inline;" class="plainlinks selfreference noprint">{{{1}}}</div>
|#default={{error|Second parameter must be <code>hatnote</code>, <code>hat</code>, or <code>inline</code>}}
}}<noinclude>
{{Documentation}}
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES THE /doc SUBPAGE, AND INTERWIKIS TO WIKIDATA, THANKS -->
</noinclude>
0c4a08f880070e918c3edcaa50cc493f99841e98
Module:Format link
828
178
355
354
2024-06-03T23:44:34Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Format link
--
-- Makes a wikilink from the given link and display values. Links are escaped
-- with colons if necessary, and links to sections are detected and displayed
-- with " § " as a separator rather than the standard MediaWiki "#". Used in
-- the {{format link}} template.
--------------------------------------------------------------------------------
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local checkTypeForNamedArg = libraryUtil.checkTypeForNamedArg
local mArguments -- lazily initialise [[Module:Arguments]]
local mError -- lazily initialise [[Module:Error]]
local yesno -- lazily initialise [[Module:Yesno]]
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function getArgs(frame)
-- Fetches the arguments from the parent frame. Whitespace is trimmed and
-- blanks are removed.
mArguments = require('Module:Arguments')
return mArguments.getArgs(frame, {parentOnly = true})
end
local function removeInitialColon(s)
-- Removes the initial colon from a string, if present.
return s:match('^:?(.*)')
end
local function maybeItalicize(s, shouldItalicize)
-- Italicize s if s is a string and the shouldItalicize parameter is true.
if s and shouldItalicize then
return '<i>' .. s .. '</i>'
else
return s
end
end
local function parseLink(link)
-- Parse a link and return a table with the link's components.
-- These components are:
-- - link: the link, stripped of any initial colon (always present)
-- - page: the page name (always present)
-- - section: the page name (may be nil)
-- - display: the display text, if manually entered after a pipe (may be nil)
link = removeInitialColon(link)
-- Find whether a faux display value has been added with the {{!}} magic
-- word.
local prePipe, display = link:match('^(.-)|(.*)$')
link = prePipe or link
-- Find the page, if it exists.
-- For links like [[#Bar]], the page will be nil.
local preHash, postHash = link:match('^(.-)#(.*)$')
local page
if not preHash then
-- We have a link like [[Foo]].
page = link
elseif preHash ~= '' then
-- We have a link like [[Foo#Bar]].
page = preHash
end
-- Find the section, if it exists.
local section
if postHash and postHash ~= '' then
section = postHash
end
return {
link = link,
page = page,
section = section,
display = display,
}
end
local function formatDisplay(parsed, options)
-- Formats a display string based on a parsed link table (matching the
-- output of parseLink) and an options table (matching the input options for
-- _formatLink).
local page = maybeItalicize(parsed.page, options.italicizePage)
local section = maybeItalicize(parsed.section, options.italicizeSection)
if (not section) then
return page
elseif (not page) then
return mw.ustring.format('§ %s', section)
else
return mw.ustring.format('%s § %s', page, section)
end
end
local function missingArgError(target)
mError = require('Module:Error')
return mError.error{message =
'Error: no link or target specified! ([[' .. target .. '#Errors|help]])'
}
end
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
function p.formatLink(frame)
-- The formatLink export function, for use in templates.
yesno = require('Module:Yesno')
local args = getArgs(frame)
local link = args[1] or args.link
local target = args[3] or args.target
if not (link or target) then
return missingArgError('Template:Format link')
end
return p._formatLink{
link = link,
display = args[2] or args.display,
target = target,
italicizePage = yesno(args.italicizepage),
italicizeSection = yesno(args.italicizesection),
categorizeMissing = args.categorizemissing
}
end
function p._formatLink(options)
-- The formatLink export function, for use in modules.
checkType('_formatLink', 1, options, 'table')
local function check(key, expectedType) --for brevity
checkTypeForNamedArg(
'_formatLink', key, options[key], expectedType or 'string', true
)
end
check('link')
check('display')
check('target')
check('italicizePage', 'boolean')
check('italicizeSection', 'boolean')
check('categorizeMissing')
-- Normalize link and target and check that at least one is present
if options.link == '' then options.link = nil end
if options.target == '' then options.target = nil end
if not (options.link or options.target) then
return missingArgError('Module:Format link')
end
local parsed = parseLink(options.link)
local display = options.display or parsed.display
local catMissing = options.categorizeMissing
local category = ''
-- Find the display text
if not display then display = formatDisplay(parsed, options) end
-- Handle the target option if present
if options.target then
local parsedTarget = parseLink(options.target)
parsed.link = parsedTarget.link
parsed.page = parsedTarget.page
end
-- Test if page exists if a diagnostic category is specified
if catMissing and (mw.ustring.len(catMissing) > 0) then
local title = nil
if parsed.page then title = mw.title.new(parsed.page) end
if title and (not title.isExternal) then
local success, exists = pcall(function() return title.exists end)
if success and not exists then
category = mw.ustring.format('[[Category:%s]]', catMissing)
end
end
end
-- Format the result as a link
if parsed.link == display then
return mw.ustring.format('[[:%s]]%s', parsed.link, category)
else
return mw.ustring.format('[[:%s|%s]]%s', parsed.link, display, category)
end
end
--------------------------------------------------------------------------------
-- Derived convenience functions
--------------------------------------------------------------------------------
function p.formatPages(options, pages)
-- Formats an array of pages using formatLink and the given options table,
-- and returns it as an array. Nil values are not allowed.
local ret = {}
for i, page in ipairs(pages) do
ret[i] = p._formatLink{
link = page,
categorizeMissing = options.categorizeMissing,
italicizePage = options.italicizePage,
italicizeSection = options.italicizeSection
}
end
return ret
end
return p
1253bdd2683ee4badc33856bfd5499b09a7dca1f
Module:Hatnote list
828
179
357
356
2024-06-03T23:44:35Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote list --
-- --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------
local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------
--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
conjunction = "and",
separator = ",",
altSeparator = ";",
space = " ",
formatted = false
}
--Searches display text only
local function searchDisp(haystack, needle)
return string.find(
string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
)
end
-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
-- Type-checks, defaults, and a shortcut
checkType("stringifyList", 1, list, "table")
if #list == 0 then return nil end
checkType("stringifyList", 2, options, "table", true)
options = options or {}
for k, v in pairs(stringifyListDefaultOptions) do
if options[k] == nil then options[k] = v end
end
local s = options.space
-- Format the list if requested
if options.formatted then
list = mFormatLink.formatPages(
{categorizeMissing = mHatnote.missingTargetCat}, list
)
end
-- Set the separator; if any item contains it, use the alternate separator
local separator = options.separator
for k, v in pairs(list) do
if searchDisp(v, separator) then
separator = options.altSeparator
break
end
end
-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
local conjunction = s .. options.conjunction .. s
if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
conjunction = separator .. conjunction
end
-- Return the formatted string
return mw.text.listToText(list, separator .. s, conjunction)
end
--DRY function
function p.conjList (conj, list, fmt)
return stringifyList(list, {conjunction = conj, formatted = fmt})
end
-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end
--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------
--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
andKeyword = 'and',
title = mw.title.getCurrentTitle().text,
otherText = 'other uses',
forSeeForm = 'For %s, see %s.',
}
--Collapses duplicate punctuation at end of string, ignoring italics and links
local function punctuationCollapse (text)
return text:match("[.?!]('?)%1(%]?)%2%.$") and text:sub(1, -2) or text
end
-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
-- Type-checks and defaults
checkType("forSeeArgsToTable", 1, args, 'table')
checkType("forSeeArgsToTable", 2, from, 'number', true)
from = from or 1
checkType("forSeeArgsToTable", 3, options, 'table', true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
local maxArg = 0
for k, v in pairs(args) do
if type(k) == 'number' and k > maxArg then maxArg = k end
end
-- Structure the data out from the parameter list:
-- * forTable is the wrapper table, with forRow rows
-- * Rows are tables of a "use" string & a "pages" table of pagename strings
-- * Blanks are left empty for defaulting elsewhere, but can terminate list
local forTable = {}
local i = from
local terminated = false
-- If there is extra text, and no arguments are given, give nil value
-- to not produce default of "For other uses, see foo (disambiguation)"
if options.extratext and i > maxArg then return nil end
-- Loop to generate rows
repeat
-- New empty row
local forRow = {}
-- On blank use, assume list's ended & break at end of this loop
forRow.use = args[i]
if not args[i] then terminated = true end
-- New empty list of pages
forRow.pages = {}
-- Insert first pages item if present
table.insert(forRow.pages, args[i + 1])
-- If the param after next is "and", do inner loop to collect params
-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
while args[i + 2] == options.andKeyword do
if args[i + 3] then
table.insert(forRow.pages, args[i + 3])
end
-- Increment to next "and"
i = i + 2
end
-- Increment to next use
i = i + 2
-- Append the row
table.insert(forTable, forRow)
until terminated or i > maxArg
return forTable
end
-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
-- Type-checks and defaults
checkType("forSeeTableToString", 1, forSeeTable, "table", true)
checkType("forSeeTableToString", 2, options, "table", true)
options = options or {}
for k, v in pairs(forSeeDefaultOptions) do
if options[k] == nil then options[k] = v end
end
-- Stringify each for-see item into a list
local strList = {}
if forSeeTable then
for k, v in pairs(forSeeTable) do
local useStr = v.use or options.otherText
local pagesStr =
p.andList(v.pages, true) or
mFormatLink._formatLink{
categorizeMissing = mHatnote.missingTargetCat,
link = mHatnote.disambiguate(options.title)
}
local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
forSeeStr = punctuationCollapse(forSeeStr)
table.insert(strList, forSeeStr)
end
end
if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
-- Return the concatenated list
return table.concat(strList, ' ')
end
-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
local forSeeTable = p.forSeeArgsToTable(args, from, options)
return p.forSeeTableToString(forSeeTable, options)
end
-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
mArguments = require('Module:Arguments')
return p._forSee(mArguments.getArgs(frame), from, options)
end
return p
1c8e6212115f76ecc3db8d05137011cd18207988
Module:Main
828
180
359
358
2024-06-03T23:44:35Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[
-- This module produces a link to a main article or articles. It implements the
-- template {{main}}.
--
-- If the module is used in category or category talk space, it produces "The
-- main article for this category is xxx". Otherwise, it produces
-- "Main article: xxx".
--]]
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments -- lazily initialise
local p = {}
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {parentOnly = true})
local pages = {}
for k, v in pairs(args) do
if type(k) == 'number' then
local display = args['label ' .. k] or args['l' .. k]
local page = display and
string.format('%s|%s', string.gsub(v, '|.*$', ''), display) or v
pages[#pages + 1] = page
end
end
if #pages == 0 and mw.title.getCurrentTitle().namespace == 0 then
return mHatnote.makeWikitextError(
'no page names specified',
'Template:Main#Errors',
args.category
)
end
local options = {
selfref = args.selfref
}
return p._main(pages, options)
end
function p._main(args, options)
-- Get the list of pages. If no first page was specified we use the current
-- page name.
local currentTitle = mw.title.getCurrentTitle()
if #args == 0 then args = {currentTitle.text} end
local firstPage = string.gsub(args[1], '|.*$', '')
-- Find the pagetype.
local pageType = mHatnote.findNamespaceId(firstPage) == 0 and 'article' or 'page'
-- Make the formatted link text
list = mHatlist.andList(args, true)
-- Build the text.
local isPlural = #args > 1
local mainForm
local curNs = currentTitle.namespace
if (curNs == 14) or (curNs == 15) then --category/talk namespaces
mainForm = isPlural and
'The main %ss for this [[Help:Categories|category]] are %s'
or
'The main %s for this [[Help:Categories|category]] is %s'
else
mainForm = isPlural and 'Main %ss: %s' or 'Main %s: %s'
end
local text = string.format(mainForm, pageType, list)
-- Process the options and pass the text to the _rellink function in
-- [[Module:Hatnote]].
options = options or {}
local hnOptions = {
selfref = options.selfref
}
return mHatnote._hatnote(text, hnOptions)
end
return p
1ae1e9ed5770c74dbe4878a8d7c91f6f505851e7
Module:Message box/ambox.css
828
181
361
360
2024-06-03T23:44:35Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp|small=y}} */
.ambox {
border: 1px solid #a2a9b1;
/* @noflip */
border-left: 10px solid #36c; /* Default "notice" blue */
background-color: #fbfbfb;
box-sizing: border-box;
}
/* Single border between stacked boxes. Take into account base templatestyles,
* user styles, and Template:Dated maintenance category.
* remove link selector when T200206 is fixed
*/
.ambox + link + .ambox,
.ambox + link + style + .ambox,
.ambox + link + link + .ambox,
/* TODO: raise these as "is this really that necessary???". the change was Dec 2021 */
.ambox + .mw-empty-elt + link + .ambox,
.ambox + .mw-empty-elt + link + style + .ambox,
.ambox + .mw-empty-elt + link + link + .ambox {
margin-top: -1px;
}
/* For the "small=left" option. */
/* must override .ambox + .ambox styles above */
html body.mediawiki .ambox.mbox-small-left {
/* @noflip */
margin: 4px 1em 4px 0;
overflow: hidden;
width: 238px;
border-collapse: collapse;
font-size: 88%;
line-height: 1.25em;
}
.ambox-speedy {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ambox-delete {
/* @noflip */
border-left: 10px solid #b32424; /* Red */
}
.ambox-content {
/* @noflip */
border-left: 10px solid #f28500; /* Orange */
}
.ambox-style {
/* @noflip */
border-left: 10px solid #fc3; /* Yellow */
}
.ambox-move {
/* @noflip */
border-left: 10px solid #9932cc; /* Purple */
}
.ambox-protection {
/* @noflip */
border-left: 10px solid #a2a9b1; /* Gray-gold */
}
.ambox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.5em;
width: 100%;
}
.ambox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.5em;
text-align: center;
}
.ambox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.5em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ambox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ambox .mbox-image-div {
width: 52px;
}
/* Hack around MobileFrontend being opinionated */
html.client-js body.skin-minerva .mbox-text-span {
margin-left: 23px !important;
}
@media (min-width: 720px) {
.ambox {
margin: 0 10%; /* 10% = Will not overlap with other elements */
}
}
29898fdc5160b39a8f580c76efe77afa1f6f58a4
Template:Template link expanded
10
182
363
362
2024-06-03T23:44:38Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#Invoke:Template link general|main|code=on}}<noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlx}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
6c99696fee02f1da368ed20d2504e19bc15b1c13
Template:Tlx
10
183
365
364
2024-06-03T23:44:38Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link expanded]]
{{Redirect category shell|
{{R from move}}
}}
1fec988ceb46cb324af228aac45d7cd25fcc9008
Module:Template link general
828
184
367
366
2024-06-03T23:44:39Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This implements Template:Tlg
local getArgs = require('Module:Arguments').getArgs
local p = {}
-- Is a string non-empty?
local function _ne(s)
return s ~= nil and s ~= ""
end
local nw = mw.text.nowiki
local function addTemplate(s)
local i, _ = s:find(':', 1, true)
if i == nil then
return 'Template:' .. s
end
local ns = s:sub(1, i - 1)
if ns == '' or mw.site.namespaces[ns] then
return s
else
return 'Template:' .. s
end
end
local function trimTemplate(s)
local needle = 'template:'
if s:sub(1, needle:len()):lower() == needle then
return s:sub(needle:len() + 1)
else
return s
end
end
local function linkTitle(args)
if _ne(args.nolink) then
return args['1']
end
local titleObj
local titlePart = '[['
if args['1'] then
-- This handles :Page and other NS
titleObj = mw.title.new(args['1'], 'Template')
else
titleObj = mw.title.getCurrentTitle()
end
titlePart = titlePart .. (titleObj ~= nil and titleObj.fullText or
addTemplate(args['1']))
local textPart = args.alttext
if not _ne(textPart) then
if titleObj ~= nil then
textPart = titleObj:inNamespace("Template") and args['1'] or titleObj.fullText
else
-- redlink
textPart = args['1']
end
end
if _ne(args.subst) then
-- HACK: the ns thing above is probably broken
textPart = 'subst:' .. textPart
end
if _ne(args.brace) then
textPart = nw('{{') .. textPart .. nw('}}')
elseif _ne(args.braceinside) then
textPart = nw('{') .. textPart .. nw('}')
end
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
titlePart = nw('{') .. titlePart .. nw('}')
end
return titlePart
end
function p.main(frame)
local args = getArgs(frame, {
trim = true,
removeBlanks = false
})
return p._main(args)
end
function p._main(args)
local bold = _ne(args.bold) or _ne(args.boldlink) or _ne(args.boldname)
local italic = _ne(args.italic) or _ne(args.italics)
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
-- Build the link part
local titlePart = linkTitle(args)
if bold then titlePart = "'''" .. titlePart .. "'''" end
if _ne(args.nowrapname) then titlePart = '<span class="nowrap">' .. titlePart .. '</span>' end
-- Build the arguments
local textPart = ""
local textPartBuffer = ""
local i = 2
while args[i] do
local val = args[i]
textPartBuffer = textPartBuffer .. '|'
if val ~= "" then
if _ne(args.nowiki) then
-- Unstrip nowiki tags first because calling nw on something that already contains nowiki tags will
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
textPart = textPart .. textPartBuffer .. val
textPartBuffer = ""
end
i = i+1
end
-- final wrap
local ret = titlePart .. textPart
if not dontBrace then ret = nw('{{') .. ret .. nw('}}') end
if _ne(args.a) then ret = nw('*') .. ' ' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if code then
ret = '<code>' .. ret .. '</code>'
elseif _ne(args.plaincode) then
ret = '<code style="border:none;background:transparent;">' .. ret .. '</code>'
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
--[[ Wrap as html??
local span = mw.html.create('span')
span:wikitext(ret)
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
return ret
end
return p
737651670b1eb932db151ad2b9ff37e683e44c74
Template:Archive/doc
10
185
369
368
2024-06-03T23:44:40Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
The '''Archive''' template is a maintenance template used for creating message boxes related to archival work.
=== Usage ===
The full template syntax is as follows: {{tlx|Archive|status{{=}}''status''|''category''}}
By placing {{tlx|Archive|status{{=}}''status''}} at the top of a page, an informational banner will appear. The parameter for ''status'' is required, while ''category'' is suggested to be used when archiving is complete.
The following table contains ''status'' keywords that automatically fill the banner with relevant information:
{|class="wikitable"
! Status
! Description
|-
|done
|Use for articles which have been properly archived
|-
|undone
|Use for articles that need to be archived and protected from edits. Page is placed into [[:Category:Articles for archiving]]
|-
|}
Providing a ''category'' value automatically places the page into an archive category. Its values include:
{|class="wikitable"
! Value
! Category
|-
|nation
|[[:Category:Alathra Nations Archive]]
|-
|town
|[[:Category:Alathra Towns Archive]]
|-
|place
|[[:Category:Alathra Places Archive]]
|-
|event
|[[:Category:Alathra Events Archive]]
|-
|player
|[[:Category:Alathra Players Archive]]
|-
|org
|[[:Category:Alathra Organizations Archive]]
|-
|religion
|[[:Category:Alathra Religions Archive]]
|-
|lore
|[[:Category:Alathra Lore Archive]]
|-
|item
|[[:Category:Alathra Artifacts/Items Archive]]
|-
|book
|[[:Category:Alathra Books Archive]]
|}
=== Template data ===
{{TemplateData header}}
<templatedata>
{
"params": {
"status": {
"description": "Status of the page relating to archiving",
"type": "string",
"required": true
}
},
"description": "General template for archival-related message boxes."
}
</templatedata>
dd62cd3657d58ab8e5fc24f37d46d55ed06bd64e
Template:Distinguish
10
186
371
370
2024-06-03T23:45:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Distinguish|distinguish}}<noinclude><!-- splitting these lines causes {{Documentation}} template to terminate green shading when Distinguish is used in /doc pages. -->
{{Documentation}}
<!-- Add categories to the /doc subpage and interwikis to Wikidata, not here! -->
</noinclude>
f949a4cbfd6eb0ab77b832e69059a40a964b1fd8
Template:High-use
10
187
373
372
2024-06-03T23:45:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:High-use|main|1={{{1|}}}|2={{{2|}}}|info={{{info|}}}|demo={{{demo|}}}|form={{{form|}}}|expiry={{{expiry|}}}|system={{{system|}}}}}<noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! -->
</noinclude>
a3322d1bd47ac03df14fa2090855cff4fede9bc7
Template:Template link with link off
10
188
375
374
2024-06-03T23:45:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nowrap=yes|nolink=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tlf}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
b099fea5d1f36b0b4b9cb253ad3a9f4e095f6851
Template:Tlf
10
189
377
376
2024-06-03T23:45:01Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link with link off]]
{{Redirect category shell|
{{R from move}}
}}
52759e1d3f7c9aa4a03d0b7d4f84f4c6adf53edf
Module:Distinguish
828
190
379
378
2024-06-03T23:45:01Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local mHatnote = require('Module:Hatnote')
local mHatlist = require('Module:Hatnote list')
local mArguments --initialize lazily
local mTableTools --initialize lazily
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}
function p.distinguish(frame)
mArguments = require('Module:Arguments')
mTableTools = require('Module:TableTools')
local args = mArguments.getArgs(frame)
local selfref = args.selfref
local text = args.text
args = mTableTools.compressSparseArray(args)
return p._distinguish(args, text, selfref)
end
function p._distinguish(args, text, selfref)
checkType("_distinguish", 1, args, 'table')
if #args == 0 and not text then return '' end
local text = string.format(
'Not to be confused with %s.',
text or mHatlist.orList(args, true)
)
hnOptions = {selfref = selfref}
return mHatnote._hatnote(text, hnOptions)
end
return p
0364d14af01fc656ad1d898c5036fbd12a7ca938
Module:High-use
828
191
381
380
2024-06-03T23:45:01Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
-- _fetch looks at the "demo" argument.
local _fetch = require('Module:Transclusion_count').fetch
local yesno = require('Module:Yesno')
function p.num(frame, count)
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
-- Build output string
local return_value = ""
if count == nil then
if frame.args[1] == "risk" then
return "a very large number of"
else
return "many"
end
else
-- Use 2 significant figures for smaller numbers and 3 for larger ones
local sigfig = 2
if count >= 100000 then
sigfig = 3
end
-- Prepare to round to appropriate number of sigfigs
local f = math.floor(math.log10(count)) - sigfig + 1
-- Round and insert "approximately" or "+" when appropriate
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then
-- Round down
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )
else
-- Round to nearest
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
end
end
end
return return_value
end
-- Actions if there is a large (greater than or equal to 100,000) transclusion count
function p.risk(frame)
if frame.args[1] == "risk" then
return "risk"
else
local count = _fetch(frame)
if count and count >= 100000 then
return "risk"
end
end
return ""
end
function p.text(frame, count)
-- Only show the information about how this template gets updated if someone
-- is actually editing the page and maybe trying to update the count.
local bot_text = (frame:preprocess("{{REVISIONID}}") == "") and "\n\n----\n'''Preview message''': Transclusion count updated automatically ([[Template:High-use/doc#Technical details|see documentation]])." or ''
if count == nil then
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
end
local title = mw.title.getCurrentTitle()
if title.subpageText == "doc" or title.subpageText == "sandbox" then
title = title.basePageTitle
end
local systemMessages = frame.args['system']
if frame.args['system'] == '' then
systemMessages = nil
end
-- This retrieves the project URL automatically to simplify localiation.
local templateCount = ('on [https://linkcount.toolforge.org/index.php?project=%s&page=%s %s pages]'):format(
mw.title.getCurrentTitle():fullUrl():gsub('//(.-)/.*', '%1'),
mw.uri.encode(title.fullText), p.num(frame, count))
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
used_on_text = used_on_text .. systemMessages ..
((count and count > 2000) and ("''', and " .. templateCount) or ("'''"))
else
used_on_text = used_on_text .. templateCount .. "'''"
end
local sandbox_text = ("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages, or in your own [[%s]]. "):format(
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),
title.fullText, title.fullText,
mw.title.getCurrentTitle().namespace == 828 and "Module:Sandbox|module sandbox" or "Wikipedia:User pages#SUB|user subpage"
)
local infoArg = frame.args["info"] ~= "" and frame.args["info"]
if (systemMessages or frame.args[1] == "risk" or (count and count >= 100000) ) then
local info = systemMessages and '.<br/>Changes to it can cause immediate changes to the Wikipedia user interface.' or '.'
if infoArg then
info = info .. "<br />" .. infoArg
end
sandbox_text = info .. '<br /> To avoid major disruption' ..
(count and count >= 100000 and ' and server load' or '') ..
', any changes should be tested in the ' .. sandbox_text ..
'The tested changes can be added to this page in a single edit. '
else
sandbox_text = (infoArg and ('.<br />' .. infoArg .. ' C') or ' and c') ..
'hanges may be widely noticed. Test changes in the ' .. sandbox_text
end
local discussion_text = systemMessages and 'Please discuss changes ' or 'Consider discussing changes '
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])
else
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )
end
return used_on_text .. sandbox_text .. discussion_text .. " before implementing them." .. bot_text
end
function p.main(frame)
local count = nil
if yesno(frame.args['fetch']) == false then
if (frame.args[1] or '') ~= '' then count = tonumber(frame.args[1]) end
else
count = _fetch(frame)
end
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"
local type_param = "style"
local epilogue = ''
if frame.args['system'] and frame.args['system'] ~= '' then
image = "[[File:Ambox important.svg|40px|alt=Warning|link=]]"
type_param = "content"
local nocat = frame:getParent().args['nocat'] or frame.args['nocat']
local categorise = (nocat == '' or not yesno(nocat))
if categorise and not mw.title.getCurrentTitle().isRedirect then
epilogue = frame:preprocess('{{Sandbox other||{{#switch:{{#invoke:Effective protection level|{{#switch:{{NAMESPACE}}|File=upload|#default=edit}}|{{FULLPAGENAME}}}}|sysop|templateeditor|interfaceadmin=|#default=[[Category:Pages used in system messages needing protection]]}}}}')
end
elseif (frame.args[1] == "risk" or (count and count >= 100000)) then
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"
type_param = "content"
end
if frame.args["form"] == "editnotice" then
return frame:expandTemplate{
title = 'editnotice',
args = {
["image"] = image,
["text"] = p.text(frame, count),
["expiry"] = (frame.args["expiry"] or "")
}
} .. epilogue
else
return require('Module:Message box').main('ombox', {
type = type_param,
image = image,
text = p.text(frame, count),
expiry = (frame.args["expiry"] or "")
}) .. epilogue
end
end
return p
e22649bbbdf0185575aade09174113873db5066a
Module:Navbar
828
192
383
382
2024-06-03T23:45:02Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local function get_title_arg(is_collapsible, template)
local title_arg = 1
if is_collapsible then title_arg = 2 end
if template then title_arg = 'template' end
return title_arg
end
local function choose_links(template, args)
-- The show table indicates the default displayed items.
-- view, talk, edit, hist, move, watch
-- TODO: Move to configuration.
local show = {true, true, true, false, false, false}
if template then
show[2] = false
show[3] = false
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6,
talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
-- TODO: Consider removing TableTools dependency.
for _, v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
local num = index[v]
if num then show[num] = true end
end
end
local remove_edit_link = args.noedit
if remove_edit_link then show[3] = false end
return show
end
local function add_link(link_description, ul, is_mini, font_style)
local l
if link_description.url then
l = {'[', '', ']'}
else
l = {'[[', '|', ']]'}
end
ul:tag('li')
:addClass('nv-' .. link_description.full)
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:attr('title', link_description.html_title)
:cssText(font_style)
:wikitext(is_mini and link_description.mini or link_description.full)
:done()
:wikitext(l[3])
:done()
end
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
if not title then
error(cfg.invalid_title .. title_text)
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- TODO: Get link_descriptions and show into the configuration module.
-- link_descriptions should be easier...
local link_descriptions = {
{ ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template',
['link'] = title.fullText, ['url'] = false },
{ ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template',
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title:fullUrl('action=history'), ['url'] = true },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template',
['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
local ul = mw.html.create('ul')
if has_brackets then
ul:addClass(cfg.classes.brackets)
:cssText(font_style)
end
for i, _ in ipairs(displayed_links) do
if displayed_links[i] then add_link(link_descriptions[i], ul, is_mini, font_style) end
end
return ul:done()
end
function p._navbar(args)
-- TODO: We probably don't need both fontstyle and fontcolor...
local font_style = args.fontstyle
local font_color = args.fontcolor
local is_collapsible = args.collapsible
local is_mini = args.mini
local is_plain = args.plain
local collapsible_class = nil
if is_collapsible then
collapsible_class = cfg.classes.collapsible
if not is_plain then is_mini = 1 end
if font_color then
font_style = (font_style or '') .. '; color: ' .. font_color .. ';'
end
end
font_style = (font_style or '') .. ';text-decoration:inherit;'
local navbar_style = args.style
local div = mw.html.create():tag('div')
div
:addClass(cfg.classes.navbar)
:addClass(cfg.classes.plainlinks)
:addClass(cfg.classes.horizontal_list)
:addClass(collapsible_class) -- we made the determination earlier
:cssText(navbar_style)
if is_mini then div:addClass(cfg.classes.mini) end
local box_text = (args.text or cfg.box_text) .. ' '
-- the concatenated space guarantees the box text is separated
if not (is_mini or is_plain) then
div
:tag('span')
:addClass(cfg.classes.box_text)
:cssText(font_style)
:wikitext(box_text)
end
local template = args.template
local displayed_links = choose_links(template, args)
local has_brackets = args.brackets
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local list = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(list)
if is_collapsible then
local title_text_class
if is_mini then
title_text_class = cfg.classes.collapsible_title_mini
else
title_text_class = cfg.classes.collapsible_title_full
end
div:done()
:tag('div')
:addClass(title_text_class)
:cssText(font_style)
:wikitext(args[1])
end
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())
end
function p.navbar(frame)
return p._navbar(require('Module:Arguments').getArgs(frame))
end
return p
daf988cd3d1f449dbc3ff6129578c8bec3dd9ec4
Module:Navbar/configuration
828
193
385
384
2024-06-03T23:45:02Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local configuration = {
['templatestyles'] = 'Module:Navbar/styles.css',
['box_text'] = 'This box: ', -- default text box when not plain or mini
['title_namespace'] = 'Template', -- namespace to default to for title
['invalid_title'] = 'Invalid title ',
['classes'] = { -- set a line to nil if you don't want it
['navbar'] = 'navbar',
['plainlinks'] = 'plainlinks', -- plainlinks
['horizontal_list'] = 'hlist', -- horizontal list class
['mini'] = 'navbar-mini', -- class indicating small links in the navbar
['this_box'] = 'navbar-boxtext',
['brackets'] = 'navbar-brackets',
-- 'collapsible' is the key for a class to indicate the navbar is
-- setting up the collapsible element in addition to the normal
-- navbar.
['collapsible'] = 'navbar-collapse',
['collapsible_title_mini'] = 'navbar-ct-mini',
['collapsible_title_full'] = 'navbar-ct-full'
}
}
return configuration
7f1b6300bc4a690ecfb1c83b582f36c603bd1dff
Module:Navbar/styles.css
828
194
387
386
2024-06-03T23:45:02Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp|small=yes}} */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
/* Navbar styling when nested in infobox and navbox
Should consider having a separate TemplateStyles for those specific places
using an infobox/navbox and a navbar, or possibly override from using template */
.infobox .navbar {
font-size: 100%;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
f4cf6b1111f177ad6af0154b14f9c942400f3636
Module:Transclusion count
828
195
389
388
2024-06-03T23:45:03Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = {}
function p.fetch(frame)
local template = nil
local return_value = nil
-- Use demo parameter if it exists, otherswise use current template name
local namespace = mw.title.getCurrentTitle().namespace
if frame.args["demo"] and frame.args["demo"] ~= "" then
template = mw.ustring.gsub(frame.args["demo"],"^[Tt]emplate:","")
elseif namespace == 10 then -- Template namespace
template = mw.title.getCurrentTitle().text
elseif namespace == 828 then -- Module namespace
template = (mw.site.namespaces[828].name .. ":" .. mw.title.getCurrentTitle().text)
end
-- If in template or module namespace, look up count in /data
if template ~= nil then
namespace = mw.title.new(template, "Template").namespace
if namespace == 10 or namespace == 828 then
template = mw.ustring.gsub(template, "/doc$", "") -- strip /doc from end
template = mw.ustring.gsub(template, "/sandbox$", "") -- strip /sandbox from end
local index = mw.ustring.sub(mw.title.new(template).text,1,1)
local status, data = pcall(function ()
return(mw.loadData('Module:Transclusion_count/data/' .. (mw.ustring.find(index, "%a") and index or "other")))
end)
if status then
return_value = tonumber(data[mw.ustring.gsub(template, " ", "_")])
end
end
end
-- If database value doesn't exist, use value passed to template
if return_value == nil and frame.args[1] ~= nil then
local arg1=mw.ustring.match(frame.args[1], '[%d,]+')
if arg1 and arg1 ~= '' then
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R'))
end
end
return return_value
end
-- Tabulate this data for [[Wikipedia:Database reports/Templates transcluded on the most pages]]
function p.tabulate(frame)
local list = {}
for i = 65, 91 do
local data = mw.loadData('Module:Transclusion count/data/' .. ((i == 91) and 'other' or string.char(i)))
for name, count in pairs(data) do
table.insert(list, {mw.title.new(name, "Template").fullText, count})
end
end
table.sort(list, function(a, b)
return (a[2] == b[2]) and (a[1] < b[1]) or (a[2] > b[2])
end)
local lang = mw.getContentLanguage();
for i = 1, #list do
list[i] = ('|-\n| %d || [[%s]] || %s\n'):format(i, list[i][1]:gsub('_', ' '), lang:formatNum(list[i][2]))
end
return table.concat(list)
end
return p
000ef6bcbf7b66e727870b0c300c4009da300513
Template:Navbox
10
196
391
390
2024-06-03T23:45:03Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Navbox|navbox}}</includeonly><noinclude>
{{Documentation}}
</noinclude>
fe9b964401f895918ee4fe078678f1722a3c41ec
Module:Color contrast
828
197
393
392
2024-06-03T23:45:03Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB (v)
if (v <= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum(R, G, B)
if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum(h, s, l)
if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 <= h and h < 60 ) then
r = r + c
g = g + x
elseif( 60 <= h and h < 120 ) then
r = r + x
g = g + c
elseif( 120 <= h and h < 180 ) then
g = g + c
b = b + x
elseif( 180 <= h and h < 240 ) then
g = g + x
b = b + c
elseif( 240 <= h and h < 300 ) then
r = r + x
b = b + c
elseif( 300 <= h and h < 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum(c)
if (c == nil) then
return ''
end
-- html '#' entity
c = c:gsub("#", "#")
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
return color2lum(color)
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 > v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg > lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.
Parameters:
-- |1= — required; A color to check.
--]]
function p.lum(frame)
local color = frame.args[1] or frame:getParent().args[1]
return p._lum(color)
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p
1e399769117591366a63f62996c9a407077cc711
Module:Color contrast/colors
828
198
395
394
2024-06-03T23:45:04Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}
6ae47fdb24de4eed5ec26d203faf5341a388987b
Module:Navbox
828
199
397
396
2024-06-03T23:45:04Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--
-- This module implements {{Navbox}}
--
local p = {}
local navbar = require('Module:Navbar')._navbar
local getArgs -- lazily initialized
local args
local border
local listnums
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127'
local RESTART_MARKER = '\127_ODDEVEN0_\127'
local REGEX_MARKER = '\127_ODDEVEN(%d?)_\127'
local function striped(wikitext)
-- Return wikitext with markers replaced for odd/even striping.
-- Child (subgroup) navboxes are flagged with a category that is removed
-- by parent navboxes. The result is that the category shows all pages
-- where a child navbox is not contained in a parent navbox.
local orphanCat = '[[Category:Navbox orphans]]'
if border == 'subgroup' and args.orphan ~= 'yes' then
-- No change; striping occurs in outermost navbox.
return wikitext .. orphanCat
end
local first, second = 'odd', 'even'
if args.evenodd then
if args.evenodd == 'swap' then
first, second = second, first
else
first = args.evenodd
second = first
end
end
local changer
if first == second then
changer = first
else
local index = 0
changer = function (code)
if code == '0' then
-- Current occurrence is for a group before a nested table.
-- Set it to first as a valid although pointless class.
-- The next occurrence will be the first row after a title
-- in a subgroup and will also be first.
index = 0
return first
end
index = index + 1
return index % 2 == 1 and first or second
end
end
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(REGEX_MARKER, changer)) -- () omits gsub count
end
local function processItem(item, nowrapitems)
if item:sub(1, 2) == '{|' then
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n'
end
if nowrapitems == 'yes' then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match('^<span class="nowrap">') then
line = prefix .. '<span class="nowrap">' .. content .. '</span>'
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
local function renderNavBar(titleCell)
if args.navbar ~= 'off' and args.navbar ~= 'plain' and not (not args.name and mw.getCurrentFrame():getParent():getTitle():gsub('/sandbox$', '') == 'Template:Navbox') then
titleCell:wikitext(navbar{
args.name,
mini = 1,
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;box-shadow:none;padding:0;'
})
end
end
--
-- Title row
--
local function renderTitleRow(tbl)
if not args.title then return end
local titleRow = tbl:tag('tr')
if args.titlegroup then
titleRow
:tag('th')
:attr('scope', 'row')
:addClass('navbox-group')
:addClass(args.titlegroupclass)
:cssText(args.basestyle)
:cssText(args.groupstyle)
:cssText(args.titlegroupstyle)
:wikitext(args.titlegroup)
end
local titleCell = titleRow:tag('th'):attr('scope', 'col')
if args.titlegroup then
titleCell
:css('border-left', '2px solid #fdfdfd')
:css('width', '100%')
end
local titleColspan = 2
if args.imageleft then titleColspan = titleColspan + 1 end
if args.image then titleColspan = titleColspan + 1 end
if args.titlegroup then titleColspan = titleColspan - 1 end
titleCell
:cssText(args.basestyle)
:cssText(args.titlestyle)
:addClass('navbox-title')
:attr('colspan', titleColspan)
renderNavBar(titleCell)
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args.title))
:addClass(args.titleclass)
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItem(args.title))
end
--
-- Above/Below rows
--
local function getAboveBelowColspan()
local ret = 2
if args.imageleft then ret = ret + 1 end
if args.image then ret = ret + 1 end
return ret
end
local function renderAboveRow(tbl)
if not args.above then return end
tbl:tag('tr')
:tag('td')
:addClass('navbox-abovebelow')
:addClass(args.aboveclass)
:cssText(args.basestyle)
:cssText(args.abovestyle)
:attr('colspan', getAboveBelowColspan())
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', args.title and nil or mw.uri.anchorEncode(args.above))
:wikitext(processItem(args.above, args.nowrapitems))
end
local function renderBelowRow(tbl)
if not args.below then return end
tbl:tag('tr')
:tag('td')
:addClass('navbox-abovebelow')
:addClass(args.belowclass)
:cssText(args.basestyle)
:cssText(args.belowstyle)
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItem(args.below, args.nowrapitems))
end
--
-- List rows
--
local function renderListRow(tbl, index, listnum)
local row = tbl:tag('tr')
if index == 1 and args.imageleft then
row
:tag('td')
:addClass('noviewer')
:addClass('navbox-image')
:addClass(args.imageclass)
:css('width', '1px') -- Minimize width
:css('padding', '0px 2px 0px 0px')
:cssText(args.imageleftstyle)
:attr('rowspan', #listnums)
:tag('div')
:wikitext(processItem(args.imageleft))
end
if args['group' .. listnum] then
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args.title or args.above or args.group2) then
groupCell
:attr('id', mw.uri.anchorEncode(args.group1))
end
groupCell
:attr('scope', 'row')
:addClass('navbox-group')
:addClass(args.groupclass)
:cssText(args.basestyle)
:css('width', args.groupwidth or '1%') -- If groupwidth not specified, minimize width
groupCell
:cssText(args.groupstyle)
:cssText(args['group' .. listnum .. 'style'])
:wikitext(args['group' .. listnum])
end
local listCell = row:tag('td')
if args['group' .. listnum] then
listCell
:css('text-align', 'left')
:css('border-left-width', '2px')
:css('border-left-style', 'solid')
else
listCell:attr('colspan', 2)
end
if not args.groupwidth then
listCell:css('width', '100%')
end
local rowstyle -- usually nil so cssText(rowstyle) usually adds nothing
if index % 2 == 1 then
rowstyle = args.oddstyle
else
rowstyle = args.evenstyle
end
local listText = args['list' .. listnum]
local oddEven = ODD_EVEN_MARKER
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find('<th[^>]*"navbox%-title"') and RESTART_MARKER or 'odd'
end
listCell
:css('padding', '0px')
:cssText(args.liststyle)
:cssText(rowstyle)
:cssText(args['list' .. listnum .. 'style'])
:addClass('navbox-list')
:addClass('navbox-' .. oddEven)
:addClass(args.listclass)
:addClass(args['list' .. listnum .. 'class'])
:tag('div')
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
:wikitext(processItem(listText, args.nowrapitems))
if index == 1 and args.image then
row
:tag('td')
:addClass('noviewer')
:addClass('navbox-image')
:addClass(args.imageclass)
:css('width', '1px') -- Minimize width
:css('padding', '0px 0px 0px 2px')
:cssText(args.imagestyle)
:attr('rowspan', #listnums)
:tag('div')
:wikitext(processItem(args.image))
end
end
--
-- Tracking categories
--
local function needsHorizontalLists()
if border == 'subgroup' or args.tracking == 'no' then
return false
end
local listClasses = {
['plainlist'] = true, ['hlist'] = true, ['hlist hnum'] = true,
['hlist hwrap'] = true, ['hlist vcard'] = true, ['vcard hlist'] = true,
['hlist vevent'] = true,
}
return not (listClasses[args.listclass] or listClasses[args.bodyclass])
end
local function hasBackgroundColors()
for _, key in ipairs({'titlestyle', 'groupstyle', 'basestyle', 'abovestyle', 'belowstyle'}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
end
local function hasBorders()
for _, key in ipairs({'groupstyle', 'basestyle', 'abovestyle', 'belowstyle'}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
end
end
local function isIllegible()
local styleratio = require('Module:Color contrast')._styleratio
for key, style in pairs(args) do
if tostring(key):match("style$") then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
end
end
end
return false
end
local function getTrackingCategories()
local cats = {}
if needsHorizontalLists() then table.insert(cats, 'Navigational boxes without horizontal lists') end
if hasBackgroundColors() then table.insert(cats, 'Navboxes using background colours') end
if isIllegible() then table.insert(cats, 'Potentially illegible navboxes') end
if hasBorders() then table.insert(cats, 'Navboxes using borders') end
return cats
end
local function renderTrackingCategories(builder)
local title = mw.title.getCurrentTitle()
if title.namespace ~= 10 then return end -- not in template space
local subpage = title.subpageText
if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end
for _, cat in ipairs(getTrackingCategories()) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
--
-- Main navbox tables
--
local function renderMainTable()
local tbl = mw.html.create('table')
:addClass('nowraplinks')
:addClass(args.bodyclass)
if args.title and (args.state ~= 'plain' and args.state ~= 'off') then
if args.state == 'collapsed' then args.state = 'mw-collapsed' end
tbl
:addClass('mw-collapsible')
:addClass(args.state or 'autocollapse')
end
tbl:css('border-spacing', 0)
if border == 'subgroup' or border == 'none' then
tbl
:addClass('navbox-subgroup')
:cssText(args.bodystyle)
:cssText(args.style)
else -- regular navbox - bodystyle and style will be applied to the wrapper table
tbl
:addClass('navbox-inner')
:css('background', 'transparent')
:css('color', 'inherit')
end
tbl:cssText(args.innerstyle)
renderTitleRow(tbl)
renderAboveRow(tbl)
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum)
end
renderBelowRow(tbl)
return tbl
end
function p._navbox(navboxArgs)
args = navboxArgs
listnums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match('^list(%d+)$')
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
border = mw.text.trim(args.border or args[1] or '')
if border == 'child' then
border = 'subgroup'
end
-- render the main body of the navbox
local tbl = renderMainTable()
-- render the appropriate wrapper around the navbox, depending on the border param
local res = mw.html.create()
if border == 'none' then
local nav = res:tag('div')
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args.title or args.above or (args.group1 and not args.group2) then
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title or args.above or args.group1))
else
nav:attr('aria-label', 'Navbox')
end
elseif border == 'subgroup' then
-- We assume that this navbox is being rendered in a list cell of a parent navbox, and is
-- therefore inside a div with padding:0em 0.25em. We start with a </div> to avoid the
-- padding being applied, and at the end add a <div> to balance out the parent's </div>
res
:wikitext('</div>')
:node(tbl)
:wikitext('<div>')
else
local nav = res:tag('div')
:attr('role', 'navigation')
:addClass('navbox')
:addClass(args.navboxclass)
:cssText(args.bodystyle)
:cssText(args.style)
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args.title or args.above or (args.group1 and not args.group2) then
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title or args.above or args.group1))
else
nav:attr('aria-label', 'Navbox')
end
end
if (args.nocat or 'false'):lower() == 'false' then
renderTrackingCategories(res)
end
return striped(tostring(res))
end
function p.navbox(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {'Template:Navbox'}})
-- Read the arguments in the order they'll be output in, to make references number in the right order.
local _
_ = args.title
_ = args.above
for i = 1, 20 do
_ = args["group" .. tostring(i)]
_ = args["list" .. tostring(i)]
end
_ = args.below
return p._navbox(args)
end
return p
2cf7f5642ab6c9fef529f7213094109a34f505c1
Template:As of
10
200
399
398
2024-06-03T23:45:05Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<!--{{As of}} begin--><includeonly><!--
## param 1 is the year
## optional param 2 is the month
## optional param 3 is the day of the month
## optional named parameter alt=[text] is alternative display text (may include wiki markup)
## optional named parameter df=US produces American date format in displayed text
## optional named parameter lc=on gives lower-case-first output
## optional named parameter url=[URL] gives statement reference
## displayed text ([A/a]s of [Start date] by default)
-->{{#if: {{{alt|}}} | {{{alt}}} | {{#if:{{{since|}}}|{{#ifeq: {{{lc}}} | {{{lc|}}} | s | S }}ince | {{#ifeq: {{{lc}}} | {{{lc|}}} | a | A }}s of}} {{#if:{{{pre|}}}|{{{pre}}} }}{{#if: {{{3|}}} | {{#ifeq:{{lc:{{{df|}}}}}|us|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}}, |{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}} }}{{{1}}}|{{#if: {{{2|}}} |{{MONTHNAME|{{{2}}}}} }}{{{1}}}}}}}{{#if:{{{post|}}}|<nowiki />{{{post}}}}}<!--
#### That nowiki is required or, various characters (:, ;, #, and *} will be parsed as wikisyntax for list items.
## ref/update inline banner (hidden by default)
--><sup class="plainlinks noexcerpt noprint asof-tag {{#if:{{{url|}}}|ref|update}}" style="display:none;">[{{#if:{{{url|}}}|{{{url}}} [ref]|{{fullurl:{{PAGENAME}}|action=edit}} [update]}}]</sup><!--
## categorisation disabled outside main namespace
-->{{DMCA|Articles containing potentially dated statements|from|<!--
## temporal category for template (word method)
-->{{#if: {{#ifexpr: {{{1}}} = 1 }} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 2004 | {{{1}}} | {{#ifexpr: {{#time:Y|{{{1}}}}} > 1989 | {{#time:Y|{{{1}}}}} | before 1990 }}}} | <!--
## temporal category for template (parameter method)
-->{{#ifexpr: {{{1}}} > 2004 | {{#if:{{{2|}}} | {{MONTHNAME|{{{2}}}}} }} {{{1}}} | {{#ifexpr:{{{1}}} > 1989 | {{{1}}} | before 1990 }}}}}}|<!--
## global category for template
-->All articles containing potentially dated statements}}</includeonly><!--{{As of}} end--><noinclude><!--
## dynamic example (as of today, self ref)
-->{{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}<sup class="plainlinks">[https://en.wikipedia.org/wiki/Template:As_of [ref]]</sup>
{{documentation}}
<!-- Add categories and inter-wikis to the /doc subpage, not here! -->
</noinclude>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using as of template with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:As of]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | 2 | 3 | alt | df | lc | post | pre | since | url }}
e9f5197664e88118b4669c3e17a7dddeb8e14163
Template:DMCA
10
201
401
400
2024-06-03T23:45:05Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Dated maintenance category
|onlyarticles=yes
|1={{{1|}}}
|2={{{2|}}}
|3={{{3|}}}
|4={{{4|}}}
|5={{{5|}}}
}}<noinclude>
{{documentation|Template:Dated maintenance category/doc}}
</noinclude>
6bbc57c75cc28708a0e71dd658224d5945d80d68
Template:Dated maintenance category
10
202
403
402
2024-06-03T23:45:05Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<nowiki/><!--This nowiki helps to prevent whitespace at the top of articles-->{{#ifeq:{{FULLROOTPAGENAME}}|Wikipedia:Template messages|<!--Do not categorize-->|<!--
-->{{#ifexpr:{{#if:{{NAMESPACE}}|0|1}}+{{#ifeq:{{{onlyarticles|no}}}|yes|0|1}}
|{{#if:{{{3|}}}
|[[Category:{{{1}}} {{{2}}} {{{3}}}]]<!--
-->{{#ifexist:Category:{{{1}}} {{{2}}} {{{3}}}
|<!--
-->|[[Category:Articles with invalid date parameter in template]]<!--
-->}}
|[[Category:{{#if:{{{5|}}}
|{{{5}}}<!--
-->|{{{1}}}<!--
-->}}]]<!--
-->}}{{#if:{{{4|}}}
|[[Category:{{{4}}}]]}}<!--
-->}}<!--
-->}}<noinclude>
{{documentation}}
</noinclude>
41e7d4000124d4f718ddf222af0b72825048c4c4
Template:Dc2
10
203
405
404
2024-06-03T23:45:06Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<del class="deprecated-content {{{class|}}}" style="color:{{#if:{{{red|}}}|#B26F5A|#A9A9A9}}; text-decoration:line-through; {{#if:{{{style|}}}|{{{style}}}|}}" {{#if:{{{id|}}}|id="{{{id}}}|}}" {{#if:{{{title|{{{2|}}}}}}|title="{{{title|{{{2}}}}}}"|}}><span style="color:{{#if:{{{red|}}}|#8B0000|#696969}};">{{{1}}}</span></del><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
418df0517ccca7496d9d4056e488cc574f7817a8
Template:Em
10
204
407
406
2024-06-03T23:45:06Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<em {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</em><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
e2fac6fb507a0dd72c4e79d02403049c7d857c8d
Template:FULLROOTPAGENAME
10
205
409
408
2024-06-03T23:45:06Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{|safesubst:}}}#if: {{ {{{|safesubst:}}}Ns has subpages | {{ {{{|safesubst:}}}#if:{{{1|}}}|{{ {{{|safesubst:}}}NAMESPACE:{{{1}}}}}|{{ {{{|safesubst:}}}NAMESPACE}}}} }}
| {{ {{{|safesubst:}}}#titleparts:{{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|{{ {{{|safesubst:}}}FULLPAGENAME}}}}|1}}
| {{ {{{|safesubst:}}}#if:{{{1|}}}|{{{1}}}|{{ {{{|safesubst:}}}FULLPAGENAME}}}}
}}<noinclude>
{{documentation}}
</noinclude>
f9584dc5ed14e997ad5a07cfd50b58abd1b0db91
Template:Hatnote inline
10
206
411
410
2024-06-03T23:45:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Hatnote inline/invoke|1={{{1|{{{text|{{{content}}}}}}}}}|extraclasses={{{class|{{{extraclasses|}}}}}}|selfref={{#if:{{{printworthy|{{{selfref|}}}}}}||yes}}|category={{{category|}}}|inline={{{inline|true}}}}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
6100bc21ef0eb771865a7df70ae432137e283584
Template:Hatnote inline/invoke
10
207
413
412
2024-06-03T23:45:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Hatnote inline|hatnote}}</includeonly><noinclude>
{{Documentation|content=This is an includeonly part of [[Template:Hatnote inline]].}}</noinclude>
bcceba0d964fb499427b81aef69b70f463221df3
Template:Hatnote templates
10
208
415
414
2024-06-03T23:45:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Navbox
| name = Hatnote templates
| state = {{{state|<includeonly>autocollapse</includeonly>}}}
| bodyclass = hlist
| belowclass = hlist
| title = [[WP:Hatnote#Hatnote templates|Hatnote templates]]
| above =
*[[Wikipedia:Hatnote]]
*[[Wikipedia:Disambiguation]]
*[[Wikipedia:Redirect]]
| group1 = Generic
| list1 =
*{{tl|Hatnote}}
*{{tl|Selfref}} (for self-references)
| group2 = For and about
| list2 =
*{{tl|For}}
*{{tl|For2}} (for custom text)
*{{tl|About}}
*Variations: {{tl|Other uses}}
*{{tl|Other uses of}}
| group3 = Other topics
| list3 =
*{{tl|Other people}}
*{{tl|About other people}} (adds "about" description)
*{{tl|Similar names}}
*{{tl|Other places}}
*{{tl|Other ships}}
*{{tl|Other hurricanes}}
| group4 = Redirect
| list4 =
*{{tl|Redirect}}
*{{tl|Redirect2}} (for two redirects)
*{{tl|Redirect-multi}} (for multiple redirects)
*{{tl|Redirect-several}} (for several redirects, without listing each)
*{{tl|Redirect-synonym}}
*{{tl|Redirect-distinguish}}
*{{tl|Technical reasons}}
| group5 = Distinguish
| list5 =
*{{tl|Distinguish}} (supports custom text too)
*{{tl|Redirect-distinguish}}
*{{tl|Redirect-distinguish2}} (for custom text)
*{{tl|Redirect-distinguish6}}
*{{tl|About-distinguish}}
*{{tl|About-distinguish2}} (for custom text)
| group6 = For use in sections
| list6 =
*{{tl|Main}}
*{{tl|Further}}
*{{tl|Further2}} (for custom text)
*{{tl|Further ill}}
*{{tl|See also}}
*{{tl|See also if exists}}
*{{tl|For outline}}
| group7 = Special
| list7 =
*{{tl|Broader}}
*{{tl|See introduction}}
*{{tl|See Wiktionary}}
*{{tl|Transcluding article}}
*{{tl|Transcluded section}}
| group8 = Subject specific
| list8 =
* {{tl|Year dab}}
* {{tl|Highway detail hatnote}}
* {{tl|For LMST}}
* {{tl|WikiIPA}}
* {{tl|Other MeSH codes}}
| below =
*{{Icon|cat}} [[:Category:Hatnote templates]]
**[[:Category:Hatnote modules|modules]]
**[[:Category:Hatnote templates for names|for [family] names]]
**[[:Category:Hatnote templates for lists|for lists]]
*[[Template:Category hatnote templates|hatnote templates for category pages]]
}}<noinclude>
{{Documentation}}
</noinclude>
35662f9be74df2380a87afc245b795ce66b0e941
Template:Icon
10
209
417
416
2024-06-03T23:45:08Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Icon|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
bd5b855953c5eec9d9c48400aa39315cb4218558
Template:Navbox hatnote templates
10
210
419
418
2024-06-03T23:45:08Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Hatnote templates]]
{{R from move}}
26939c8223b6e0617eb1e6b2e9990c178cbf8ac5
Template:Never substitute
10
211
421
420
2024-06-03T23:45:08Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Ombox
|type=notice
|text='''This template should {{em|not}} be [[Wikipedia:Substitution|substituted]].''' {{{1|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
ed10c57c4f8088f4a40cd7d066ae311218883d20
Template:Ns has subpages
10
212
423
422
2024-06-03T23:45:09Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:Ns has subpages|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
060d2d01af26cb67fd90a7c346a0d2d5e450a040
Template:Self reference/doc
10
213
425
424
2024-06-03T23:45:10Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{distinguish|Template:Self reference cleanup}}
{{Documentation subpage}}
{{High-use|2060}}
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE, AND INTERWIKIS TO WIKIDATA. -->
{{never substitute}}
The {{tlf|Self reference}} template generates a [[WP:HAT|hatnote]] that will ''not'' appear in any [[WP:Reusing Wikipedia content|reuse of Wikipedia article content]], including the [[Wikipedia:Keyboard_shortcuts#List_of_access_keys|printable version]] of an article. The template's intended purpose is to display information that is relevant only to a reader viewing the article directly within Wikipedia. Such information might include a [[WP:DAB|disambiguation]] statement that points to a [[WP:H|Wikipedia help]] page or an instruction to editors. (In [[WP:Glossary|Wikipedia terminology]], these are forms of self-reference.)
Unlike many hatnote templates, {{tlf|Self reference}} has no preset text, link generation, or formatting other than italics. <code><nowiki>{{Self reference|Foo}}</nowiki></code> simply returns ''Foo''. Many hatnote templates that ''do'' contain helpful preset text and linking, such as {{t|for}} and {{t|about}}, support a {{para|selfref}} parameter that gives them the same functionality as {{tlf|Self reference}}, making them better options in most circumstances.
In most cases, references to the Wikipedia project are discouraged, and the valid uses for this template are rare. Consultation of the list of [[Wikipedia:Self-references to avoid|Self-references to avoid]] is advisable.
== Usage ==
In most cases, {{tlf|Selfref}} is used to create a disambiguation link to a page in the "Wikipedia:" namespace from article-space; for instance, the page [[Objectivity (disambiguation)]] could have a self-referential "[[WP:HATNOTE|hatnote]]" link at the top: <code><nowiki>{{Selfref|For Wikipedia's policy on avoiding bias, see [[Wikipedia:Neutral point of view]].}}</nowiki></code>.
When using {{tlf|Selfref}} in this way, use the following format:
<pre>
{{Selfref|The self-referential notice to display, including [[MOS:LINK|links]].}}
</pre>
which produces:
{{Selfref|The self-referential notice to display, including [[MOS:LINK|links]].}}
italicized (Wikipedia house style for self-referential notes), and both preceded and followed by a linebreak.
For inline use (in body text, mid-sentence, and {{em|not}} in hatnotes), without the indentation and line breaking, use {{tlx|Selfref inline}}:
<pre>
{{Selfref inline|the self-referential text to display, including [[MOS:LINKS|links]]}}
</pre>
which produces: {{Selfref inline|the self-referential text to display, including [[MOS:LINKS|links]]}} (illustrated here on the same line as other content).
Template {{tnull|Selfref}} also has the parameter {{para||inline}}:
<pre>
{{Selfref|the self-referential text to display, including [[MOS:LINKS|links]]|inline}}
</pre>
However, {{as of |alt=as of early 2019|2019|01|post=,}} it does not always function properly, and may cause a line break under some circumstances.
=== Unprintworthy content ===
Rarely, there is other, non-self-referential content which shouldn't appear in mirrors, print editions, or other off-Wikipedia reuses of Wikipedia content, and which shouldn't be italicized as a self-reference.
It is preferable to mark such unprintworthy content with the {{tl|Unprintworthy inline}} template (which includes the <code>noprint</code> CSS class, but not the <code>plainlinks</code> class, since links in such content will not be internal self-references). Although not all [[WP:Mirrors and forks|mirror sites]] do so, the content in question can be removed by reusers of WP content, without any reformatting, by ignoring or removing content marked up by this template, or more accurately by the <code>selfreference</code> CSS class that it (and some other templates) use.
'''Note: The following syntax has been obsolete since 2008, and if you see it, replace it as described below.'''
There was a {{em|deprecated}}, pre-2008 legacy usage of {{tlf|Selfref}} that was used for such unprintworthy cases, and pre-dates the {{tl|Unprintworthy inline}} template. This is to simply end the template with a pipe character – <code>|</code>:
{{dc2|1=<pre>
{{Selfref|the unprintworthy text to display without self-ref styling|}}</pre>}}
This method cannot be depended upon. For one thing, many editors would interpret the ending pipe as an error and remove it, turning the template into an indented self-ref hatnote! It also has not been used since 2008. Any remaining uses of it should be replaced with {{tl|Selfref inline}} (if real a self-references) or {{tl|Unprintworthy inline}} (if simply unprintworthy).
== Example ==
{|border=1 class="wikitable"
! Code !! Page on Wikipedia !! Page on [some] mirrors
|-
| <code><nowiki>{{Selfref|For the Wikipedia Sandbox, see [[WP:SAND]]}}</nowiki></code>
<code><nowiki>The Wikipedia Sandbox is a page on Wikipedia. {{Selfref|(You can edit it by clicking "edit" on the page.)|inline}} It has been edited many times.</nowiki></code>
| {{Selfref|For the Wikipedia Sandbox, see [[WP:SAND]]}}
The Wikipedia Sandbox is a page on Wikipedia. {{Selfref|(You can edit it by clicking "edit" on the page.)|inline}} It has been edited many times.
| The Wikipedia Sandbox is a page on Wikipedia. It has been edited many times.
|}
== See also ==
*[[Wikipedia:Self-references to avoid]]
*{{tlx|srlink}}, for the opposite case when you want a link to the Wikipedia: namespace that ''does'' show in mirrors without breaking (for instance when writing an article about Wikipedia or something connected to it).
*{{tlx|Printworthy selfref}} – for cases of self-references that are printworthy and may or may not be desired by reusers of WP content, depending upon whether they are mirroring or just using single articles
*{{tlx|Unprintworthy inline}} – for unprintworthy inline material that isn't technically a self-reference
*[[Wikipedia:Hatnote]]
{{Navbox hatnote templates|state=collapsed}}<includeonly>{{sandbox other||
<!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANK YOU. -->
[[Category:Wikipedia self-reference templates]]<!--For both forms of this template.-->
[[Category:Disambiguation and redirection templates]]<!--For frequent use atop DAB pages; it's not actually a DAB/redir template, per se.-->
[[Category:Wikipedia page-section templates]]<!--For hatnote usage only.-->
[[Category:Cross-reference templates]]<!--For the inline usage.-->
}}</includeonly>
abfc30fce2dfa8eb3c29343e4ac80e93515b63cd
Template:Selfref
10
214
427
426
2024-06-03T23:45:11Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Self reference]]
{{Redirect category shell|
{{R from template shortcut}}
{{R from alternative spelling}}
{{R from move}}
}}
c64d0bac3495eca2dadbb678a3e9c9413e7918e3
Template:Selfref inline
10
215
429
428
2024-06-03T23:45:11Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Hatnote inline|selfref=yes|1={{{1}}}}}<noinclude>
{{documentation}}
</noinclude>
0db9c100b1ebfce66cfd0f0c9fba5600f00dcded
Template:T
10
216
431
430
2024-06-03T23:45:11Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link]]
{{Rcat shell|
{{R from template shortcut}}
}}
<!-- Used as Template:tl throughout English Wikipedia; demo template referenced only on meta ->
7cd61d87ab8a903c157c16a03e0a37e93459cb14
Template:Template link null
10
217
433
432
2024-06-03T23:45:12Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#Invoke:Template link general|main|nolink=yes|code=yes}}</includeonly><noinclude>
{{Documentation|1=Template:Tlg/doc
|content = {{tlg/doc|tnull}}
}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
2167c503e001d24d870ef82a9de0aaa9832404cb
Template:Tnull
10
218
435
434
2024-06-03T23:45:12Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Template link null]]
{{Redirect category shell|
{{R from move}}
}}
b22d666a4b16808dc3becc2403546fb9ab5dea7e
Module:Hatnote inline
828
219
437
436
2024-06-03T23:45:12Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Hatnote-inline --
-- --
-- This module produces hatnote-style links, and links to related articles, --
-- but inside a <span>, instead of the <div> used by Module:Hatnote. It --
-- implements the {{hatnote-inline}} meta-template. --
--------------------------------------------------------------------------------
local mHatnote = require('Module:Hatnote')
local mArguments = require('Module:Arguments')
local yesno = require('Module:Yesno')
local p = {}
function p.hatnoteInline (frame)
local args = mArguments.getArgs(frame)
local hatnote = mHatnote.hatnote(frame)
if args.inline == nil or yesno(args.inline, true) then
local subs = {
['^<div'] = '<span',
['</div>$'] = '</span>'
}
for k, v in pairs(subs) do hatnote = string.gsub(hatnote, k, v) end
end
return hatnote
end
p.hatnote = p.hatnoteInline --alias
return p
5dc37308b4a4b5e5c6eff5ec44cd977b44edf988
Module:Icon
828
220
439
438
2024-06-03T23:45:13Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements [[Template:Icon]].
local data = mw.loadData('Module:Icon/data')
local p = {}
function p._main(args)
local code = args.class or args[1]
local iconData
if code then
code = code:match('^%s*(.-)%s*$'):lower() -- trim whitespace and put in lower case
iconData = data[code]
end
if not iconData then
iconData = data._DEFAULT
end
return string.format(
'[[File:%s%s|%s|link=]]',
iconData.image,
iconData.tooltip and '|' .. iconData.tooltip or '',
args.size or '16x16px'
)
end
function p.main(frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
args[k] = v
end
return p._main(args)
end
return p
2a9d51e44f8cd64c8eeb17655d5238da36908650
Module:Icon/data
828
221
441
440
2024-06-03T23:45:13Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module stores icon data for [[Module:Icon]].
--------------------------------------------------------------------------------
-- Icon data
--------------------------------------------------------------------------------
local data = {
fa = {
image = "Featured article star.svg",
tooltip = "Featured article",
},
far = {
image = "Cscr-star piece.png",
tooltip = "Featured article review",
},
farc = {
image = "Cscr-star piece.png",
tooltip = "Featured article removal candidate",
},
ffa = {
aliases = {"dfa"},
image = "Featured article star - cross.svg",
tooltip = "Former featured article",
},
fac = {
aliases = {"fan"},
image = "Cscr-candidate.svg",
tooltip = "Featured article candidate",
},
ffac = {
aliases = {"nofa"},
image = "Featured article star - cross.svg",
tooltip = "Failed featured article candidate",
},
fl = {
image = "Featured article star.svg",
tooltip = "Featured list",
},
flrc = {
aliases = {"flr"},
image = "Cscr-star piece.png",
tooltip = "Featured list removal candidate",
},
ffl = {
aliases = {"dfl"},
image = "Cscr-featured-strike.svg",
tooltip = "Former featured list",
},
flc = {
aliases = {"fln"},
image = "Cscr-candidate.svg",
tooltip = "Featured list candidate",
},
fflc = {
aliases = {"nofl"},
image = "Cscr-former.svg",
tooltip = "Failed featured list candidate",
},
a = {
image = "Symbol a class.svg",
tooltip = "A-Class article",
},
dac = {
aliases = {"daa"},
image = "Symbol unsupport A vote.svg",
tooltip = "Demoted A-Class article",
},
acc = {
aliases = {"acn", "aac"},
image = "A candidate.svg",
tooltip = "A-Class article candidate",
},
noac = {
aliases = {"faac"},
image = "Symbol unsupport A vote.svg",
tooltip = "Failed A-Class article candidate",
},
ga = {
image = "Symbol support vote.svg",
tooltip = "Good article",
},
gar = {
image = "GA Candidate Neutral vote(ChaosNil).svg",
tooltip = "Good article reassessment",
},
dga = {
image = "Symbol unsupport vote.svg",
tooltip = "Delisted good article",
},
gan = {
aliases = {"gac"},
image = "GA candidate.svg",
tooltip = "Good article nominee",
},
ga2 = {
image = "Symbol neutral vote.svg",
tooltip = "Good article, 2nd opinion",
},
gah = {
image = "Symbol wait.svg",
tooltip = "Good article on hold",
},
fgan = {
aliases = {"noga", "gaf", "gf"},
image = "Symbol oppose vote.svg",
tooltip = "Failed good article nominee",
},
fp = {
image = "Cscr-featured.svg",
tooltip = "Featured picture",
},
fpc = {
aliases = {"fpn"},
image = "Cscr-candidate.svg",
tooltip = "Featured picture candidate",
},
ffp = {
image = "Cscr-former.svg",
tooltip = "Former featured picture",
},
vp = {
image = "ENWP VP Logo.svg",
tooltip = "Valued picture",
},
vpc = {
image = "Valued pics 1.svg",
tooltip = "Valued picture candidate",
},
fs = {
image = "Cscr-featured.svg",
tooltip = "Featured sound",
},
ffs = {
image = "Cscr-former.svg",
tooltip = "Former featured sound",
},
fsc = {
image = "Cscr-candidate.svg",
tooltip = "Featured sound candidate",
},
fpo = {
image = "Linecons big-star.svg",
tooltip = "Before the featured portal process ceased in 2017, this had been designated as a featured portal.",
},
fpor = {
image = "Cscr-star piece.png",
tooltip = "Featured portal review",
},
ffpo = {
image = "Featured article star - cross.svg",
tooltip = "Former featured portal",
},
fpoc = {
image = "Cscr-candidate.svg",
tooltip = "Featured portal candidate",
},
ft = {
image = "Cscr-featuredtopic.svg",
tooltip = "Featured topic",
},
ftrc = {
image = "Cscr-star piece.png",
tooltip = "Featured topic removal candidate",
},
fft = {
aliases = {"dft"},
image = "DFT candidate_cluster.svg",
tooltip = "Former featured topic",
},
ftc = {
aliases = {"ftn"},
image = "FT candidate cluster.svg",
tooltip = "Featured topic candidate",
},
gt = {
image = "Support cluster.svg",
tooltip = "Good topic",
},
gtrc = {
image = "Symbol unsupport vote.svg",
tooltip = "Good topic removal candidate",
},
gtc = {
aliases = {"gtn"},
image = "GA candidate cluster.svg",
tooltip = "Good topic candidate",
},
bplus = {
aliases = {"b+"},
image = "Symbol bplus class.svg",
tooltip = "Bplus-Class article",
},
b = {
image = "Symbol b class.svg",
tooltip = "B-Class article",
},
br = {
aliases = {"bcr"},
image = "Bclass-checklist.svg",
tooltip = "B-Class review",
},
c = {
image = "Symbol c class.svg",
tooltip = "C-Class article",
},
start = {
image = "Symbol start class.svg",
tooltip = "Start-Class article",
},
stub = {
image = "Symbol stub class.svg",
tooltip = "Stub-Class article",
},
list = {
aliases = {"comparison"},
image = "Symbol list class.svg",
tooltip = "List-Class article",
},
no = {
image = "Crystal button cancel.svg",
tooltip = "Unknown-Class article",
},
book = {
image = "Symbol book class2.svg",
tooltip = "Wikipedia book",
},
category = {
aliases = {"cat", "categ"},
image = "Symbol category class.svg",
tooltip = "Category",
},
disambiguation = {
aliases = {"dab", "disamb", "disambig"},
image = "Symbol dab class.svg",
tooltip = "Disambiguation page",
},
image = {
aliases = {"file"},
image = "Symbol file class.svg",
tooltip = "File",
},
needed = {
image = "Symbol needed class.svg",
tooltip = "Needed article",
},
outline = {
image = "Global thinking.svg",
tooltip = "Outline",
},
portal = {
image = "Symbol portal class.svg",
tooltip = "Portal",
},
project = {
image = "Symbol project class.svg",
tooltip = "Project page",
},
redirect = {
aliases = {"red", "redir"},
image = "Symbol redirect vote2.svg",
tooltip = "Redirect",
},
template = {
aliases = {"temp", "templ"},
image = "Symbol template class.svg",
tooltip = "Template",
},
essay = {
image = "Essay.svg",
tooltip = "Essay",
},
na = {
image = "Symbol na class.svg",
tooltip = "Non-article page",
},
aa = {
image = "Yes check.svg",
tooltip = "Audited article of limited subject matter",
},
da = {
image = "Symbol oppose vote.svg",
tooltip = "Demoted article",
},
dyk = {
image = "Symbol question.svg",
tooltip = "Did You Know?",
},
dyk2 = {
image = "DYK questionmark icon.svg",
tooltip = "Did You Know?",
},
pr = {
image = "Nuvola apps kedit.png",
tooltip = "Peer review",
},
ppr = {
image = "Nuvola apps kedit.png",
tooltip = "Portal peer review",
},
q = {
aliases = {"question"},
image = "Symbol question.svg",
tooltip = "Question",
},
qi = {
image = "Quality images logo.svg",
tooltip = "Quality image on Wikimedia Commons",
},
vi = {
image = "Valued image seal.svg",
tooltip = "Valued image on Wikimedia Commons",
},
tfa = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured Article",
},
tfl = {
image = "Wikipedia-logo.svg",
tooltip = "Today's Featured List",
},
itn = {
image = "Globe current.svg",
tooltip = "In The News",
},
otd = {
image = "Nuvola apps date.svg",
tooltip = "On This Day",
},
wikiproject = {
image = "People icon.svg",
tooltip = "WikiProject",
},
wikipedia = {
image = "Wikipedia-logo.svg",
tooltip = "Wikipedia page",
},
commons = {
image = "Commons-logo.svg",
tooltip = "Commons page",
},
wikiquote = {
image = "Wikiquote-logo.svg",
tooltip = "Wikiquote page",
},
wikiversity = {
image = "Wikiversity logo 2017.svg",
tooltip = "Wikiversity page",
},
wikibooks = {
image = "Wikibooks-logo.svg",
tooltip = "Wikibooks page",
},
wikisource = {
image = "Wikisource-logo.svg",
tooltip = "Wikisource page",
},
wiktionary = {
image = "Wiktionary-logo.svg",
tooltip = "Wiktionary page",
},
wikinews = {
image = "Wikinews-logo.svg",
tooltip = "Wikinews page",
},
wikispecies = {
image = "Wikispecies-logo.svg",
tooltip = "Wikispecies page",
},
wikidata = {
image = "Wikidata-logo.svg",
tooltip = "Wikidata page",
},
wikivoyage = {
image = "Wikivoyage-logo.svg",
tooltip = "Wikivoyage page",
},
meta = {
image = "Wikimedia Community Logo.svg",
tooltip = "Meta-wiki page",
},
four = {
image = "Four Award.svg",
tooltip = "Four Award",
},
million = {
image = "Million award logo.svg",
tooltip = "Million Award",
},
module = {
image = "Lua-logo-nolabel.svg",
tooltip = "Module",
},
vital = {
image = "Círculos_Concéntricos.svg",
tooltip = "Vital article",
},
_DEFAULT = {
image = "Symbol question.svg",
}
}
--------------------------------------------------------------------------------
-- End icon data
--------------------------------------------------------------------------------
-- Make aliases work the same as normal keys, and remove the "aliases" subtables.
for k, t in pairs(data) do
if t.aliases then
for i, alias in ipairs(t.aliases) do
data[alias] = t
end
t.aliases = nil
end
data[k] = t
end
return data
d4471053287e7914d77a91b1838e5f343be3d573
Module:Ns has subpages
828
222
443
442
2024-06-03T23:45:13Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements [[Template:Ns has subpages]].
-- While the template is fairly simple, this information is made available to
-- Lua directly, so using a module means that we don't have to update the
-- template as new namespaces are added.
local p = {}
function p._main(ns, frame)
-- Get the current namespace if we were not passed one.
if not ns then
ns = mw.title.getCurrentTitle().namespace
end
-- Look up the namespace table from mw.site.namespaces. This should work
-- for a majority of cases.
local nsTable = mw.site.namespaces[ns]
-- Try using string matching to get the namespace from page names.
-- Do a quick and dirty bad title check to try and make sure we do the same
-- thing as {{NAMESPACE}} in most cases.
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then
local nsStripped = ns:gsub('^[_%s]*:', '')
nsStripped = nsStripped:gsub(':.*$', '')
nsTable = mw.site.namespaces[nsStripped]
end
-- If we still have no match then try the {{NAMESPACE}} parser function,
-- which should catch the remainder of cases. Don't use a mw.title object,
-- as this would increment the expensive function count for each new page
-- tested.
if not nsTable then
frame = frame or mw.getCurrentFrame()
local nsProcessed = frame:callParserFunction('NAMESPACE', ns)
nsTable = nsProcessed and mw.site.namespaces[nsProcessed]
end
return nsTable and nsTable.hasSubpages
end
function p.main(frame)
local ns = frame:getParent().args[1]
if ns then
ns = ns:match('^%s*(.-)%s*$') -- trim whitespace
ns = tonumber(ns) or ns
end
local hasSubpages = p._main(ns, frame)
return hasSubpages and 'yes' or ''
end
return p
e133068ba73738b16e1e3eba47735516a461eb5b
Module:Transclusion count/data/S
828
223
445
444
2024-06-03T23:45:14Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
return {
["S"] = 2400,
["S-aca"] = 6000,
["S-ach"] = 15000,
["S-aft"] = 206000,
["S-aft/filter"] = 206000,
["S-bef"] = 210000,
["S-bef/filter"] = 210000,
["S-break"] = 4000,
["S-civ"] = 2400,
["S-dip"] = 5000,
["S-end"] = 248000,
["S-gov"] = 6900,
["S-hon"] = 3500,
["S-hou"] = 9100,
["S-inc"] = 12000,
["S-legal"] = 8700,
["S-line"] = 18000,
["S-line/side_cell"] = 18000,
["S-mil"] = 11000,
["S-new"] = 14000,
["S-non"] = 8400,
["S-note"] = 2200,
["S-npo"] = 3400,
["S-off"] = 38000,
["S-par"] = 47000,
["S-par/en"] = 3100,
["S-par/gb"] = 3200,
["S-par/uk"] = 11000,
["S-par/us-hs"] = 11000,
["S-par/us-sen"] = 2000,
["S-ppo"] = 11000,
["S-rail"] = 25000,
["S-rail-start"] = 23000,
["S-rail/lines"] = 25000,
["S-reg"] = 19000,
["S-rel"] = 17000,
["S-roy"] = 2500,
["S-s"] = 3600,
["S-sports"] = 9500,
["S-start"] = 227000,
["S-ttl"] = 216000,
["S-vac"] = 5200,
["SCO"] = 4000,
["SDcat"] = 3690000,
["SECOND"] = 2300,
["SG"] = 2600,
["SGP"] = 2400,
["SIA"] = 2700,
["SLO"] = 3600,
["SMS"] = 7400,
["SPI_archive_notice"] = 59000,
["SPIarchive_notice"] = 59000,
["SPIcat"] = 3800,
["SPIclose"] = 3300,
["SPIpriorcases"] = 54000,
["SR/Olympics_profile"] = 4700,
["SRB"] = 3200,
["SS"] = 19000,
["SSPa"] = 2600,
["STN"] = 12000,
["SUBJECTSPACE_formatted"] = 37000,
["SUI"] = 8000,
["SVG"] = 4100,
["SVG-Logo"] = 17000,
["SVG-Res"] = 14000,
["SVG-logo"] = 3300,
["SVK"] = 5000,
["SVN"] = 4500,
["SWE"] = 12000,
["Sandbox_other"] = 168000,
["Saturday"] = 2600,
["Saved_book"] = 58000,
["Sc"] = 2200,
["Schlüsselconverter"] = 13000,
["School_block"] = 28000,
["School_disambiguation"] = 3200,
["Schoolblock"] = 20000,
["Schooldis"] = 2500,
["Schoolip"] = 15000,
["Scientist_icon"] = 15000,
["Scientist_icon2"] = 15000,
["Sclass"] = 28000,
["Sclass-"] = 26000,
["Sclass/core"] = 31000,
["Sclass2"] = 9000,
["Sclass2-"] = 8100,
["Screen_reader-only"] = 2400,
["Screen_reader-only/styles.css"] = 2700,
["Script/Hebrew"] = 4100,
["Script/Nastaliq"] = 11000,
["Script/styles_hebrew.css"] = 4100,
["Sdash"] = 2100,
["Search_box"] = 37000,
["Search_link"] = 7000,
["Section_link"] = 39000,
["See"] = 9300,
["See_also"] = 160000,
["Seealso"] = 6400,
["Select_skin"] = 3700,
["Selected_article"] = 2400,
["Selected_picture"] = 2400,
["Self"] = 67000,
["Self-published_inline"] = 4000,
["Self-published_source"] = 5700,
["Self-reference_tool"] = 2900,
["Self/migration"] = 46000,
["Self2"] = 2800,
["Self_reference"] = 2400,
["Sent_off"] = 10000,
["Sentoff"] = 3100,
["Separated_entries"] = 135000,
["Serial_killer_opentask"] = 2500,
["Series_overview"] = 5700,
["Serif"] = 2200,
["Set_category"] = 33000,
["Set_index_article"] = 5100,
["Sets_taxobox_colour"] = 160000,
["Sfn"] = 117000,
["SfnRef"] = 114000,
["Sfnm"] = 2300,
["Sfnp"] = 13000,
["Sfnref"] = 7900,
["Sfrac"] = 3500,
["Sfrac/styles.css"] = 3600,
["SharedIP"] = 7500,
["SharedIPEDU"] = 26000,
["Shared_IP"] = 33000,
["Shared_IP_advice"] = 13000,
["Shared_IP_corp"] = 7200,
["Shared_IP_edu"] = 149000,
["Shared_IP_gov"] = 4100,
["Sharedip"] = 10000,
["Sharedipedu"] = 15000,
["Sherdog"] = 2500,
["Ship"] = 79000,
["Ship/maintenancecategory"] = 79000,
["Ship_index"] = 6600,
["Shipboxflag"] = 17000,
["Shipboxflag/core"] = 17000,
["Shipindex"] = 6300,
["Shipwrecks_navbox_footer"] = 4800,
["Short_description"] = 3730000,
["Short_pages_monitor"] = 11000,
["Short_pages_monitor/maximum_length"] = 11000,
["Shortcut"] = 24000,
["Shortcut/styles.css"] = 27000,
["Should_be_SVG"] = 10000,
["Show_button"] = 2420000,
["Sic"] = 24000,
["Sica"] = 2600,
["Side_box"] = 990000,
["Sidebar"] = 190000,
["Sidebar_games_events"] = 32000,
["Sidebar_with_collapsible_lists"] = 80000,
["Sigfig"] = 3300,
["Significant_figures"] = 4000,
["Significant_figures/rnd"] = 3600,
["Signpost-subscription"] = 2000,
["Silver02"] = 14000,
["Silver2"] = 41000,
["Silver_medal"] = 4200,
["Single+double"] = 4300,
["Single-innings_cricket_match"] = 2700,
["Single_chart"] = 31000,
["Single_chart/chartnote"] = 31000,
["Single_namespace"] = 142000,
["Singlechart"] = 22000,
["Singles"] = 36000,
["Sister-inline"] = 153000,
["Sister_project"] = 981000,
["Sister_project_links"] = 9400,
["Sisterlinks"] = 3300,
["Skip_to_talk"] = 11000,
["Skip_to_talk/styles.css"] = 11000,
["Sky"] = 2500,
["Slink"] = 3900,
["Small"] = 896000,
["Small_Solar_System_bodies"] = 3500,
["Smallcaps"] = 16000,
["Smallcaps/styles.css"] = 17000,
["Smallcaps_all"] = 2300,
["Smalldiv"] = 13000,
["Smaller"] = 80000,
["Smallsup"] = 19000,
["Smiley"] = 37000,
["Snd"] = 41000,
["Snds"] = 5800,
["Soccer_icon"] = 125000,
["Soccer_icon2"] = 125000,
["Soccer_icon4"] = 5100,
["Soccerbase"] = 13000,
["Soccerbase_season"] = 5900,
["Soccerway"] = 63000,
["Sock"] = 43000,
["Sockcat"] = 2200,
["Sockmaster"] = 8600,
["Sockpuppet"] = 209000,
["Sockpuppet/categorise"] = 209000,
["SockpuppetCheckuser"] = 5500,
["Sockpuppet_category"] = 43000,
["Sockpuppet_category/confirmed"] = 20000,
["Sockpuppet_category/suspected"] = 23000,
["Sockpuppetcheckuser"] = 3600,
["Sockpuppeteer"] = 20000,
["Soft_redirect"] = 5800,
["Soft_redirect_protection"] = 7500,
["Softredirect"] = 3100,
["Solar_luminosity"] = 3800,
["Solar_mass"] = 4400,
["Solar_radius"] = 3500,
["Soldier_icon"] = 3900,
["Soldier_icon2"] = 3900,
["Song"] = 7500,
["Songs"] = 19000,
["Songs_category"] = 7300,
["Songs_category/core"] = 7300,
["Sort"] = 106000,
["Sortname"] = 44000,
["Source-attribution"] = 2000,
["Source_check"] = 982000,
["Sourcecheck"] = 982000,
["South_America_topic"] = 2500,
["Sp"] = 222000,
["Space"] = 56000,
["Space+double"] = 3600,
["Spaced_en_dash"] = 71000,
["Spaced_en_dash_space"] = 5800,
["Spaced_ndash"] = 22000,
["Spaces"] = 2940000,
["Spain_metadata_Wikidata"] = 7400,
["Spamlink"] = 12000,
["Species_Latin_name_abbreviation_disambiguation"] = 2200,
["Species_list"] = 11000,
["Speciesbox"] = 207000,
["Speciesbox/getGenus"] = 208000,
["Speciesbox/getSpecies"] = 208000,
["Speciesbox/name"] = 208000,
["Speciesbox/parameterCheck"] = 208000,
["Speciesbox/trim"] = 208000,
["Specieslist"] = 4100,
["Split_article"] = 3100,
["Spnd"] = 3300,
["Sport_icon"] = 14000,
["Sport_icon2"] = 14000,
["SportsYearCatUSstate"] = 6300,
["SportsYearCatUSstate/core"] = 6300,
["Sports_links"] = 12000,
["Sports_reference"] = 8600,
["Squad_maintenance"] = 2500,
["Square_bracket_close"] = 87000,
["Square_bracket_open"] = 89000,
["Srt"] = 2900,
["Stack"] = 23000,
["Stack/styles.css"] = 30000,
["Stack_begin"] = 7800,
["Stack_end"] = 7800,
["StaleIP"] = 2800,
["Standings_Table_End"] = 44000,
["Standings_Table_Entry"] = 44000,
["Standings_Table_Entry/record"] = 44000,
["Standings_Table_Start"] = 44000,
["Standings_Table_Start/colheader"] = 44000,
["Standings_Table_Start/colspan"] = 44000,
["Starbox_astrometry"] = 4600,
["Starbox_begin"] = 4800,
["Starbox_catalog"] = 4700,
["Starbox_character"] = 4600,
["Starbox_detail"] = 4400,
["Starbox_end"] = 4700,
["Starbox_observe"] = 4600,
["Starbox_reference"] = 4700,
["Start-Class"] = 100000,
["Start-date"] = 4300,
["Start_box"] = 7700,
["Start_date"] = 378000,
["Start_date_and_age"] = 97000,
["Start_date_and_years_ago"] = 6000,
["Start_of_course_timeline"] = 4400,
["Start_of_course_week"] = 4600,
["Start_tab"] = 4200,
["Startflatlist"] = 100000,
["Static_IP"] = 12000,
["Station"] = 6200,
["Station_link"] = 5900,
["Stdinchicite"] = 10000,
["Steady"] = 12000,
["Stl"] = 3500,
["Stn"] = 5800,
["Stnlnk"] = 28000,
["Stop"] = 2100,
["Storm_colour"] = 4700,
["StoryTeleplay"] = 2800,
["Str_endswith"] = 163000,
["Str_find"] = 594000,
["Str_find0"] = 170000,
["Str_index"] = 12000,
["Str_left"] = 1400000,
["Str_len"] = 376000,
["Str_letter"] = 169000,
["Str_letter/trim"] = 10000,
["Str_number"] = 8000,
["Str_number/trim"] = 30000,
["Str_rep"] = 557000,
["Str_right"] = 63000,
["Str_rightc"] = 304000,
["Str_rightmost"] = 20000,
["Str_sub"] = 17000,
["Str_sub_long"] = 348000,
["Str_sub_old"] = 376000,
["Str_trim"] = 6100,
["Str_≠_len"] = 26000,
["Str_≤_len"] = 8300,
["Str_≥_len"] = 53000,
["Strfind_short"] = 6400,
["Strikethrough"] = 11000,
["Strlen_quick"] = 5800,
["Strong"] = 80000,
["Structurae"] = 2000,
["Stub-Class"] = 59000,
["Stub_Category"] = 13000,
["Stub_category"] = 17000,
["Stub_documentation"] = 35000,
["Student_editor"] = 27000,
["Student_sandbox"] = 4500,
["Student_table_row"] = 3900,
["Students_table"] = 3900,
["Su"] = 11000,
["Su-census1989"] = 4000,
["Sub"] = 2800,
["Subinfobox_bodystyle"] = 31000,
["Subject_bar"] = 17000,
["Subject_bar/styles.css"] = 17000,
["Suboff"] = 5400,
["Subon"] = 5500,
["Subpage_other"] = 163000,
["Subscription"] = 4800,
["Subscription_required"] = 29000,
["Subsidebar_bodystyle"] = 6800,
["Subst_only"] = 3400,
["Substituted_comment"] = 19000,
["Substr_any"] = 6500,
["Succession_box"] = 116000,
["Succession_links"] = 128000,
["Summer_Olympics_by_year_category_navigation"] = 2400,
["Summer_Olympics_by_year_category_navigation/core"] = 2400,
["Sunday"] = 2600,
["Sup"] = 66000,
["Superimpose2/base"] = 2500,
["Superimpose5"] = 2300,
["Suppress_categories"] = 2000,
["Surname"] = 60000,
["Swiss_populations"] = 2400,
["Swiss_populations_NC"] = 3000,
["Swiss_populations_YM"] = 2300,
["Swiss_populations_ref"] = 2400,
["Module:SDcat"] = 3690000,
["Module:Sandbox/Leyo/CommonChemistry"] = 12000,
["Module:Science_redirect"] = 227000,
["Module:Science_redirect/conf"] = 227000,
["Module:Section_link"] = 39000,
["Module:See_also_if_exists"] = 47000,
["Module:Separated_entries"] = 1980000,
["Module:Series_overview"] = 5800,
["Module:Settlement_short_description"] = 623000,
["Module:Shortcut"] = 27000,
["Module:Shortcut/config"] = 27000,
["Module:Side_box"] = 999000,
["Module:Sidebar"] = 259000,
["Module:Sidebar/configuration"] = 259000,
["Module:Sidebar/styles.css"] = 264000,
["Module:Sidebar_games_events"] = 32000,
["Module:Sidebar_games_events/styles.css"] = 32000,
["Module:Singles"] = 36000,
["Module:Sister_project_links"] = 9500,
["Module:Sort_title"] = 15000,
["Module:Sortkey"] = 168000,
["Module:Sports_career"] = 17000,
["Module:Sports_color"] = 58000,
["Module:Sports_color/baseball"] = 31000,
["Module:Sports_color/basketball"] = 20000,
["Module:Sports_rbr_table"] = 8300,
["Module:Sports_rbr_table/styles.css"] = 8300,
["Module:Sports_reference"] = 8600,
["Module:Sports_results"] = 9700,
["Module:Sports_results/styles.css"] = 6100,
["Module:Sports_table"] = 46000,
["Module:Sports_table/WDL"] = 41000,
["Module:Sports_table/WL"] = 2600,
["Module:Sports_table/argcheck"] = 46000,
["Module:Sports_table/styles.css"] = 46000,
["Module:Sports_table/sub"] = 46000,
["Module:Sports_table/totalscheck"] = 33000,
["Module:Stock_tickers/NYSE"] = 2200,
["Module:String"] = 9230000,
["Module:String2"] = 596000,
["Module:Su"] = 11000,
["Module:Subject_bar"] = 17000,
["Module:Suppress_categories"] = 2100,
}
d3c425fe6dd705133d447f75cf4579bdb8c011aa
Template:Infobox lore book
10
224
447
446
2024-06-03T23:45:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Infobox
| title = {{{title|}}}
| image = {{{image|}}}
| caption1 = {{{caption|}}}
| headerstyle = background:lightgrey
| header1 = General information
| label2 = Author
| data2 = {{{author|}}}
| label3 = Genre
| data3 = {{{genre|}}}
| label4 = Page count
| data4 = {{{pages|}}}
| label5 = Created
| data5 = {{{created|}}}
| label6 = Publisher
| data6 = {{{publisher|}}}
| label7 = Current location
| data7 = {{{location|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
e35fb453971baf9c887567ef3fae2d49c1aec402
Template:Infobox religion
10
225
449
448
2024-06-03T23:45:50Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{Infobox
| above = {{#if: {{{icon|}}} |[[file:{{{icon}}}|{{{icon_width|25px}}}|alt={{{icon_alt|}}}]]<br/>{{{name|}}}|{{{name|{{PAGENAMEBASE}}}}}}}
| subheader = {{#if:{{{native_name|}}}|<span class="nickname">'''{{#if:{{{native_name_lang|}}}|{{lang|{{{native_name_lang}}}|{{{native_name}}}}}|{{{native_name}}}}}'''</span>}}
| bodystyle = width: 24em; font-size: 88%; text-align: left;
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{imagewidth|200px}}}|sizedefault=frameless|alt={{{alt|{{{imagealttext|}}}}}}}}
| caption = {{{caption|}}}
| labelstyle = white-space: nowrap;
| label1 = Abbreviation
| data1 = {{{abbreviation|}}}
| label2 = Type
| data2 = {{{type|}}}
| label3 = Classification
| data3 = {{{main_classification|}}}
| label4 = Orientation
| data4 = {{{orientation|}}}
| label5 = Scripture
| data5 = {{{scripture|}}}
| label6 = Theology
| data6 = {{{theology|}}}
| label7 = [[Ecclesiastical polity|Polity]]
| data7 = {{{polity|}}}
| label8 = [[Ecclesiastical polity|Governance]]
| data8 = {{{governance|}}}
| label9 = Structure
| data9 = {{{structure|}}}
| label10 = {{#if: {{{leader_title|}}} | {{{leader_title}}} | Moderator }}
| data10 = {{{leader_name|{{{leader/moderator|}}} }}}
| label11 = {{#if: {{{leader_title1|}}} | {{{leader_title1}}} | Leader }}
| data11 = {{{leader_name1|{{{leader|}}} }}}
| label12 = {{#if: {{{leader_title2|}}} | {{{leader_title2}}} | Director }}
| data12 = {{{leader_name2|{{{director|}}} }}}
| label13 = {{#if: {{{leader_title3|}}} | {{{leader_title3}}} }}
| data13 = {{{leader_name3|}}}
| label14 = {{#if: {{{fellowships_type|}}} | {{{fellowships_type}}} | Distinct fellowships }}
| data14 = {{{fellowships|}}}
| label15= {{#if: {{{fellowships_type1|}}} | {{{fellowships_type1}}} | Distinct fellowships }}
| data15= {{{fellowships1|}}}
| label16 = {{#if: {{{division_type|}}} | {{{division_type}}} | Divisions }}
| data16 = {{{division|}}}
| label17 = {{#if: {{{division_type1|}}} | {{{division_type1}}} | Divisions }}
| data17 = {{{division1|}}}
| label18 = {{#if: {{{division_type2|}}} | {{{division_type2}}} | Divisions }}
| data18 = {{{division2|}}}
| label19 = {{#if: {{{division_type3|}}} | {{{division_type3}}} | Divisions }}
| data19 = {{{division3|}}}
| label20 = Associations
| data20 = {{{associations|}}}
| label21 = Full Communion
| data21 = {{{full_communion|}}}
| label22 = Region
| data22 = {{{area|}}}
| label23 = Language
| data23 = {{{language|}}}
| label24 = Liturgy
| data24 = {{{liturgy|}}}
| label25 = Headquarters
| data25 = {{{headquarters|}}}
| label26 = Territory
| data26 = {{{territory|}}}
| label27 = Possessions
| data27 = {{{possessions|}}}
| label28 = Founder
| data28 = {{{founder|}}}
| label29 = Origin
| data29 = {{#if: {{{founded_date|}}} | {{{founded_date}}} }} {{#if:{{{founded_date|}}}{{{founded_place|}}} |}}{{#if:{{{founded_place|}}}| <br />{{{founded_place}}} }}
| label30 = Independence
| data30 = {{{independence|}}}
| label31 = Reunion
| data31 = {{{reunion|}}}
| label32 = Recognition
| data32 = {{{recognition|}}}
| label33 = [[Schism|Separated from]]
| data33 = {{{separated_from|}}}
| label34 = Branched from
| data34 = {{{branched_from|}}}
| label35 = [[Temple union|Merger of]]
| data35 = {{{merger|}}}
| label36 = Absorbed
| data36 = {{{absorbed|}}}
| label37 = Separations
| data37 = {{{separations|}}}
| label38 = Merged into
| data38 = {{{merged_into|}}}
| label39 = Defunct
| data39 = {{{defunct|}}}
| label40 = {{#if:{{{congregations_type|}}}|{{{congregations_type}}}|Congregations}}
| data40 = {{{congregations|}}}
| label41 = {{#if:{{{number_of_followers|}}}|Number of followers|Members}}
| data41 = {{#if:{{{number_of_followers|}}}|{{{number_of_followers}}}|{{{members|}}}}}
| label42 = {{#if:{{{ministers_type|}}} | {{{ministers_type}}} | [[Minister (Christianity)|Ministers]]}}
| data42 = {{{ministers|}}}
| label43 = Missionaries
| data43 = {{{missionaries|}}}
| label44 = Temple buildings
| data44 = {{{temples|}}}
| label45 = Hospitals
| data45 = {{{hospitals|}}}
| label46 = Nursing homes
| data46 = {{{nursing_homes|}}}
| label47 = Aid organization
| data47 = {{{aid|}}}
| label48 = [[Primary education|Primary schools]]
| data48 = {{{primary_schools|}}}
| label49 = [[Secondary education|Secondary schools]]
| data49 = {{{secondary_schools|}}}
| label50 = [[501c3|Tax status]]
| data50 = {{{tax_status|}}}
| label51 = [[Higher education|Tertiary institutions]]
| data51 = {{{tertiary|}}}
| label52 = Other name(s)
| data52 = {{{other_names|}}}
| label53 = Publications
| data53 = {{{publications|}}}
| label54 = Official website
| data54 = {{{website|}}}
| label55 = {{#if: {{{website_title1|}}} | {{{website_title1}}} | }}
| data55 = {{{website1|{{{website1|}}} }}}
| label56 = Slogan
| data56 = {{{slogan|}}}
| label57 = Logo
| data57 = {{{logo|}}}
| data58 = {{{misc|{{{module|}}}}}}
| belowstyle =
| below = {{{footnotes|}}}
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox Christian denomination with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox Christian denomination]] with unknown parameter "_VALUE_"|ignoreblank=y| abbreviation | absorbed | aid | alt | area | associations | branched_from | caption | temples | congregations | congregations_type | defunct | director | division | division_type | division_type1 | division_type2 | division_type3 | division1 | division2 | division3 | fellowships | fellowships_type | fellowships_type1 | fellowships1 | footnotes | founded_date | founded_place | founder | full_communion | governance | headquarters | hospitals | icon | icon_alt | icon_width | image | imagealttext | imagewidth | independence | language | leader | leader_name | leader_name1 | leader_name2 | leader_name3 | leader_title | leader_title1 | leader_title2 | leader_title3 | leader/moderator | liturgy | logo | main_classification | members | merged_into | merger | ministers | ministers_type | missionaries | module | name | native_name | native_name_lang | number_of_followers | nursing_homes | orientation | other_names | polity | possessions | primary_schools | publications | recognition | reunion | scripture | secondary_schools | separated_from | separations | slogan | structure | tax_status | territory | tertiary | theology | type | website | website_title1 | website1 }}</includeonly><noinclude>
{{documentation}}
</noinclude>
0c789ced5ab2306757f039cd2a1698b8f440fa7b
Template:Infobox person
10
226
451
450
2024-06-03T23:45:51Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Infobox|child={{{child|}}}
| bodyclass = biography vcard
| above = {{Br separated entries
| 1 = {{#if:{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}|<span class="honorific-prefix" style="font-size: 77%; font-weight: normal;">{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|{{{pre-nominals|}}}}}}}}}}}}</span>}}
| 2 = <span class="fn">{{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}</span>
| 3 = {{#if:{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}|<span class="honorific-suffix" style="font-size: 77%; font-weight: normal;">{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|{{{post-nominals|}}}}}}}}}}}}</span>}}
}}
| abovestyle = {{{abovestyle|}}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| caption = {{{image caption|{{{caption|{{{image_caption|}}}}}}}}}
| label1 = Native name
| data1 = {{#if:{{{native_name|}}}|<span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}
| label2 = Pronunciation
| data2 = {{{pronunciation|}}}
| label10 = Born
| data10 = {{Br separated entries|1={{#if:{{{birth_name|{{{birthname|}}}}}}|<span class="nickname">{{{birth_name|{{{birthname|}}}}}}</span>}}|2={{{birth_date|}}}|3={{#if:{{{birth_place|}}}|<span class="birthplace">{{{birth_place|}}}</span>}}}}
| label420 = IGN
| data420 = {{{ign|}}}
| label421 = Race
| data421 = {{{race|}}}
| label11 = Bapti{{#if:{{{baptized|}}}|z|s}}ed
| data11 = {{#if:{{{birth_date|}}}||{{{baptized|{{{baptised|}}}}}}}}
| label12 = Disappeared
| data12 = {{Br separated entries|1={{{disappeared_date|}}}|2={{{disappeared_place|}}}}}
| label13 = Status
| data13 = {{{status|{{{disappeared_status|}}}}}}
| label14 = Died
| data14 = {{Br separated entries|1={{{death_date|}}}|2={{#if:{{{death_place|}}}|<span class="deathplace">{{{death_place|}}}</span>}}}}
| label15 = Cause of death
| data15 = {{{death cause|{{{death_cause|}}}}}}
| label16 = Body discovered
| data16 = {{{body discovered|{{{body_discovered|}}}}}}
| label17 = {{#if:{{{burial_place|}}}|Burial place|Resting place}}
| data17 = {{#if:{{{burial_place|}}}|{{Br separated entries|1={{{burial_place|}}}|2={{{burial_coordinates|}}}}}|{{Br separated entries|1={{{resting place|{{{resting_place|{{{restingplace|}}}}}}}}}|2={{{resting place coordinates|{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}}}}}}}}
| class17 = label
| label18 = Monuments
| data18 = {{{monuments|}}}
| label19 = Residence
| data19 = {{{residence|}}}
| class19 = {{#if:{{{death_date|}}}{{{death_place|}}}||label}}
| label20 = Nationality
| data20 = {{{nationality|}}}
| class20 = category
| label21 = Other names
| data21 = {{{other names|{{{other_names|{{{othername|{{{nickname|{{{alias|}}}}}}}}}}}}}}}
| class21 = nickname
| label23 = Citizenship
| data23 = {{{citizenship|}}}
| class23 = category
| label24 = Education
| data24 = {{{education|}}}
| label25 = Alma mater
| data25 = {{{alma mater|{{{alma_mater|}}}}}}
| label26 = Occupation
| data26 = {{{occupation|}}}
| class26 = role
| label27 = Years active
| data27 = {{{years active|{{{years_active|{{{yearsactive|}}}}}}}}}
| label28 = Era
| data28 = {{{era|}}}
| class28 = category
| label29 = Employer
| data29 = {{{employer|}}}
| class29 = org
| label30 = {{#if:{{{organisation|}}}|Organisation|Organization}}
| data30 = {{{organisation|{{{organization|{{{organizations|}}}}}}}}}
| class30 = org
| label31 = Agent
| data31 = {{{agent|}}}
| class31 = agent
| label32 = Known for
| data32 = {{{known for|{{{known_for|{{{known|}}}}}}}}}
| label33 = <span style="white-space:nowrap;">{{#if:{{{works|}}}|Works|{{#if:{{{credits|}}}|Notable credit(s)|{{#if:{{{label_name|}}}|Label(s)|Notable work}}}}}}</span>
| data33 = {{#if:{{{works|}}}|{{{works|}}}|{{#if:{{{credits|}}}|{{{credits}}}|{{#if:{{{label_name|}}}|{{{label_name}}}|{{{notable works|{{{notable_works|}}}}}}}}}}}}
| label34 = Style
| data34 = {{{style|}}}
| class34 = category
| label37 = Home town
| data37 = {{{home town|{{{home_town|}}}}}}
| label38 = Salary
| data38 = {{{salary|}}}
| label39 = Net worth
| data39 = {{{net worth|{{{net_worth|{{{networth|}}}}}}}}}
| label40 = Height
| data40 = {{#if:{{{height_m|{{{height_cm|}}}}}}{{{height_ft|}}}{{{height_in|}}} | {{convinfobox|{{{height_m|{{{height_cm|}}}}}}|{{#if:{{{height_m|}}}|m|cm}}|{{{height_ft|}}}|ft|{{{height_in|}}}|in}}}}{{#if:{{{height|}}} | {{infobox person/height|{{{height|}}}}}}}
| label41 = Weight
| data41 = {{#if:{{{weight_kg|}}}{{{weight_st|}}}{{{weight_lb|}}} | {{convinfobox|{{{weight_kg|}}}|kg|{{{weight_st|}}}|st|{{{weight_lb|}}}|lb}}}}{{#if:{{{weight|}}} | {{infobox person/weight|{{{weight|}}}}}}}
| label42 = Television
| data42 = {{{television|}}}
| label43 = {{#if:{{{office|}}}|Office|Title}}
| data43 = {{{office|{{{title|}}}}}}
| class43 = title
| label44 = Term
| data44 = {{{term|}}}
| label45 = Predecessor
| data45 = {{{predecessor|}}}
| label46 = Successor
| data46 = {{{successor|}}}
| label47 = Political party
| data47 = {{{party|}}}
| class47 = org
| label48 = Movement
| data48 = {{{movement|}}}
| class48 = category
| label49 = <span class="nowrap">Opponent(s)</span>
| data49 = {{{opponents|}}}
| label50 = Board member of
| data50 = {{{boards|}}}
| label51 = Criminal charge
| data51 = {{{criminal charge|{{{criminal_charge|}}}}}}
| label52 = Criminal penalty
| data52 = {{{criminal penalty|{{{criminal_penalty|}}}}}}
| label53 = {{#if:{{{judicial status|{{{judicial_status|}}}}}}|Judicial status|Criminal status}}
| data53 = {{#if:{{{judicial status|{{{judicial_status|}}}}}} | {{{judicial status|{{{judicial_status}}}}}} | {{{criminal status|{{{criminal_status|}}}}}}}}
| class53 = category
| label54 = <span class="nowrap">Spouse(s)</span>
| data54 = {{{spouse|{{{spouses|{{{spouse(s)|}}}}}}}}}
| label55 = <span class="nowrap">Partner(s)</span>
| data55 = {{{partner|{{{domesticpartner|{{{domestic_partner|{{{partners|{{{partner(s)|}}}}}}}}}}}}}}}
| label56 = Children
| data56 = {{{children|}}}
| label57 = Parent{{#if:{{{parents|}}}|(s)|{{#if:{{{father|}}}|{{#if:{{{mother|}}}|s|(s)}}|(s)}}}}
| data57 = {{#if:{{{parents|}}}|{{{parents}}}|{{Unbulleted list|{{#if:{{{father|}}}|{{{father}}} (father)}}|{{#if:{{{mother|}}}|{{{mother}}} (mother)}}}}}}
| label58 = Relatives
| data58 = {{{relations|{{{relatives|}}}}}}
| label59 = Family
| data59 = {{{family|}}}
| label60 = Call-sign
| data60 = {{{callsign|}}}
| label61 = Awards
| data61 = {{{awards|}}}
| label62 = {{#if:{{{honours|}}}|Honours|Honors}}
| data62 = {{{honours|{{{honors|}}}}}}
| label63 = Website
| data63 = {{{website|{{{homepage|{{{URL|{{{url|}}}}}}}}}}}}
| data64 = {{{misc|{{{module|}}}}}}
| data65 = {{{misc2|{{{module2|}}}}}}
| data66 = {{{misc3|{{{module3|}}}}}}
| data67 = {{{misc4|{{{module4|}}}}}}
| data68 = {{{misc5|{{{module5|}}}}}}
| data69 = {{{misc6|{{{module6|}}}}}}
| header70 = {{#if:{{{signature|}}}|Signature}}
| data71 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}}
| header72 = {{#if:{{{footnotes|}}}|Notes}}
| data73 = {{#if:{{{footnotes|}}}|<div style="text-align: left;">
{{{footnotes}}}</div>}}
}}<!--
-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox person with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview = Page using [[Template:Infobox person]] with unknown parameter "_VALUE_"|ignoreblank=y
| abovestyle | agent | alias | alma mater | alma_mater | alt | awards | baptised | baptized | birth_date | birth_name | birth_place | birthname | boards | body discovered | body_discovered | burial_coordinates | burial_place | callsign | caption | child | children | citizenship | credits | criminal charge | criminal penalty | criminal status | criminal_charge | criminal_penalty | criminal_status | death cause | death_cause | death_date | death_place | disappeared_date | disappeared_place | disappeared_status | domestic_partner | domesticpartner | education | employer | era | family | father | footnotes | height | height_cm | height_ft | height_in | height_m | home town | home_town | homepage | honorific prefix | honorific suffix | honorific_prefix | honorific_suffix | honorific-prefix | honorific-suffix | honors | honours | image | image caption | image size | image_caption | image_size | image_upright | imagesize | judicial status | judicial_status | known | known for | known_for | label_name | misc | misc2 | misc3 | misc4 | misc5 | misc6 | module | module2 | module3 | module4 | module5 | module6 | monuments | mother | movement | name | nationality | native_name | native_name_lang | net worth | net_worth | networth | nickname | nocat_wdimage | notable works | notable_works | occupation | office | opponents | organisation | organization | organizations | other names | other_names | othername | parents | partner | partner | partner(s) | party | predecessor | pre-nominals | post-nominals | pronunciation | relations | relatives | residence | resting place | resting place coordinates | resting_place | resting_place_coordinates | restingplace | restingplacecoordinates | salary | signature | signature alt | signature_alt | signature_size | spouse | spouses | spouse(s) | status | style | successor | television | term | title | URL | url | website | weight | weight_kg | weight_lb | weight_st | works | years active | years_active | yearsactive}}{{main other|
{{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}|[[Category:Infobox person using numbered parameter]]}}<!--
-->{{#if:{{{box_width|}}}|[[Category:Infobox person using boxwidth parameter]]}}<!--
-->{{#if:{{{death_date|}}}{{{death_place|}}}|{{#if:{{{salary|}}}{{{net worth|{{{net_worth|{{{networth|}}}}}}}}}|[[Category:Infobox person using certain parameters when dead]]}}}}<!--
-->{{#if:{{{influences|}}}{{{influenced|}}}|[[Category:Infobox person using influence]]}}<!--
-->{{#if:{{{ethnicity|}}}|[[Category:Infobox person using ethnicity]]}}<!--
-->{{#if:{{{religion|}}}|[[Category:Infobox person using religion]]}}<!--
-->{{#if:{{{denomination|}}}|[[Category:Infobox person using denomination]]}}<!--
-->{{#if:{{{pronunciation|}}}|[[Category:Biography template using pronunciation]]}}<!--
-->{{#if:{{{signature|}}}|[[Category:Biography with signature]]}}<!--
-->{{#if:{{{image|}}}|[[Category:Articles with hCards]]
}}}}<noinclude>
{{Documentation}}{{En-WP attribution notice|Template:Infobox person}}</noinclude>
eb958daafe6ae0010c95d1b367afe7e72f9a4b5c
Template:Infobox continent
10
227
453
452
2024-06-03T23:45:51Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Infobox
|titlestyle = text-align:center;
|title = {{{title|}}}
|imagestyle = text-align:center;
|image = {{{image|}}}
|caption = {{{imagecaption|}}}
|label1 = Area
|data1 = {{{area|}}}
|label2 = Population
|data2 = {{{population|}}}
|label3 = Demonym
|data3 = {{{demonym|}}}
|label4 = States
|data4 = {{{states|}}}
|label5 = Largest cities
|data5 = {{{cities|}}}
|belowstyle = text-align:left; border-top:#aaa 1px solid;
|below = {{{footnotes|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
29bb455ef339661a4f04d566a9d53e5d117410f5
Template:Infobox military conflict
10
228
455
454
2024-06-03T23:45:52Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Infobox military conflict|main}}</includeonly><noinclude>{{documentation}}</noinclude>
d340eca466eb5d0a69c1f4ac57d0f34d306ed031
Template:Infobox lore book/doc
10
229
457
456
2024-06-03T23:45:57Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
== Usage ==
<syntaxhighlight>
{{Infobox lore book
|title =
|image =
|caption =
|author =
|genre =
|pages =
|created =
|publisher =
|location =
}}
</syntaxhighlight>
=== Template data ===
{{TemplateData header}}
<templatedata>
{
"params": {
"title": {
"description": "The in-game name for the written book",
"type": "string",
"suggested": true
},
"image": {
"description": "Picture of the book",
"type": "wiki-file-name",
"default": "File:Minecraft-how-to-make-a-book.jpg",
"suggested": true,
"example": "File:Minecraft-how-to-make-a-book.jpg"
},
"caption": {
"description": "A caption for the image",
"example": "Written book depicting the text"
},
"author": {
"description": "The person or group responsible for creating the book",
"type": "string",
"default": "Unknown",
"suggested": true
},
"genre": {
"type": "string",
"suggested": true,
"default": "Lore",
"example": "History, fiction"
},
"pages": {
"description": "Total number of pages in the book",
"type": "number",
"example": "0"
},
"created": {
"description": "The in-lore date for the book's creation",
"type": "string",
"suggested": true
},
"publisher": {
"description": "The organization that prints and distributes the book",
"type": "string"
},
"location": {
"description": "Where the book is currently being stored and/or available for viewing",
"example": "Town library",
"type": "string",
"default": "Unknown",
"suggested": true
}
},
"description": "This is an altered version of the default book template that only contains the infobox and has no requirements other than the book title. Feel free to use it to document any of your books."
}
</templatedata>
adf8b3cbb701c60a580fd8a5dfd0417f874fcee0
Template:MONTHNAME
10
230
459
458
2024-06-03T23:46:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}|{{#switch:{{MONTHNUMBER|{{{1}}}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=''month''!}}|Missing required parameter 1=''month''!}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
25327282f70efd1189b70245a0e23509f3bb65e6
Template:MONTHNUMBER
10
231
461
460
2024-06-03T23:46:00Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
|{{#switch:{{lc:{{{1}}}}}
|january|jan=1
|february|feb=2
|march|mar=3
|apr|april=4
|may=5
|june|jun=6
|july|jul=7
|august|aug=8
|september|sep|sept=9
|october|oct=10
|november|nov=11
|december|dec=12
|{{#ifexpr:{{{1}}}<0
|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})
|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}
|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}
}}
|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}
}}
}}
|Missing required parameter 1=''month''!
}}</includeonly><noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
c2ade663b96231e493986cd17b454923da290098
Template:En-WP attribution notice
10
232
463
462
2024-06-03T23:46:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{| style="border: 1px solid #e0e0e0; background-color: #f8f8f8; color:black; margin: 5px auto; width: 60%;"
|-
| style="padding: 3px 10px;" | [[File:Wikipedia-logo-v2.svg|30px|Wikipedia logo]]
| style="font-size: 90%; padding: 3px;" | This {{Pagetype}} uses material from the Wikipedia {{Pagetype|page={{{1|{{FULLPAGENAME}}}}}}} [[w:en:{{{1|{{FULLPAGENAME}}}}}|{{{1|{{FULLPAGENAME}}}}}]], which is released under the [[w:en:Wikipedia:Text of Creative Commons Attribution-ShareAlike 3.0 Unported License|Creative Commons Attribution-ShareAlike 3.0 Unported License]] ([https://en.wikipedia.org/w/index.php?title={{urlencode:{{{1|{{FULLPAGENAME}}}}}}}&action=history view authors]).
|}
[[Category:{{Pagetype|category=Categorie}}s from English Wikipedia]]</includeonly>
<noinclude>
{{documentation}}
[[Category:Attribution templates]]
{{En-WP attribution notice|Template:En-WP attribution notice}}
</noinclude>
2f8572b5c25751c527d33ac2122cfc3cdcc7d622
Template:Pagetype
10
233
465
464
2024-06-03T23:46:07Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{<includeonly>safesubst:</includeonly>#invoke:pagetype|main}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Pagetype}}
</noinclude>
b6d5e4de8a716664120e2fd68dd5932b85777262
Module:Namespace detect
828
234
467
466
2024-06-03T23:46:07Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--[[
--------------------------------------------------------------------------------
-- --
-- NAMESPACE DETECT --
-- --
-- This module implements the {{namespace detect}} template in Lua, with a --
-- few improvements: all namespaces and all namespace aliases are supported, --
-- and namespace names are detected automatically for the local wiki. The --
-- module can also use the corresponding subject namespace value if it is --
-- used on a talk page. Parameter names can be configured for different wikis --
-- by altering the values in the "cfg" table in --
-- Module:Namespace detect/config. --
-- --
--------------------------------------------------------------------------------
--]]
local data = mw.loadData('Module:Namespace detect/data')
local argKeys = data.argKeys
local cfg = data.cfg
local mappings = data.mappings
local yesno = require('Module:Yesno')
local mArguments -- Lazily initialise Module:Arguments
local mTableTools -- Lazily initilalise Module:TableTools
local ustringLower = mw.ustring.lower
local p = {}
local function fetchValue(t1, t2)
-- Fetches a value from the table t1 for the first key in array t2 where
-- a non-nil value of t1 exists.
for i, key in ipairs(t2) do
local value = t1[key]
if value ~= nil then
return value
end
end
return nil
end
local function equalsArrayValue(t, value)
-- Returns true if value equals a value in the array t. Otherwise
-- returns false.
for i, arrayValue in ipairs(t) do
if value == arrayValue then
return true
end
end
return false
end
function p.getPageObject(page)
-- Get the page object, passing the function through pcall in case of
-- errors, e.g. being over the expensive function count limit.
if page then
local success, pageObject = pcall(mw.title.new, page)
if success then
return pageObject
else
return nil
end
else
return mw.title.getCurrentTitle()
end
end
-- Provided for backward compatibility with other modules
function p.getParamMappings()
return mappings
end
local function getNamespace(args)
-- This function gets the namespace name from the page object.
local page = fetchValue(args, argKeys.demopage)
if page == '' then
page = nil
end
local demospace = fetchValue(args, argKeys.demospace)
if demospace == '' then
demospace = nil
end
local subjectns = fetchValue(args, argKeys.subjectns)
local ret
if demospace then
-- Handle "demospace = main" properly.
if equalsArrayValue(argKeys.main, ustringLower(demospace)) then
ret = mw.site.namespaces[0].name
else
ret = demospace
end
else
local pageObject = p.getPageObject(page)
if pageObject then
if pageObject.isTalkPage then
-- Get the subject namespace if the option is set,
-- otherwise use "talk".
if yesno(subjectns) then
ret = mw.site.namespaces[pageObject.namespace].subject.name
else
ret = 'talk'
end
else
ret = pageObject.nsText
end
else
return nil -- return nil if the page object doesn't exist.
end
end
ret = ret:gsub('_', ' ')
return ustringLower(ret)
end
function p._main(args)
-- Check the parameters stored in the mappings table for any matches.
local namespace = getNamespace(args) or 'other' -- "other" avoids nil table keys
local params = mappings[namespace] or {}
local ret = fetchValue(args, params)
--[[
-- If there were no matches, return parameters for other namespaces.
-- This happens if there was no text specified for the namespace that
-- was detected or if the demospace parameter is not a valid
-- namespace. Note that the parameter for the detected namespace must be
-- completely absent for this to happen, not merely blank.
--]]
if ret == nil then
ret = fetchValue(args, argKeys.other)
end
return ret
end
function p.main(frame)
mArguments = require('Module:Arguments')
local args = mArguments.getArgs(frame, {removeBlanks = false})
local ret = p._main(args)
return ret or ''
end
function p.table(frame)
--[[
-- Create a wikitable of all subject namespace parameters, for
-- documentation purposes. The talk parameter is optional, in case it
-- needs to be excluded in the documentation.
--]]
-- Load modules and initialise variables.
mTableTools = require('Module:TableTools')
local namespaces = mw.site.namespaces
local cfg = data.cfg
local useTalk = type(frame) == 'table'
and type(frame.args) == 'table'
and yesno(frame.args.talk) -- Whether to use the talk parameter.
-- Get the header names.
local function checkValue(value, default)
if type(value) == 'string' then
return value
else
return default
end
end
local nsHeader = checkValue(cfg.wikitableNamespaceHeader, 'Namespace')
local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, 'Aliases')
-- Put the namespaces in order.
local mappingsOrdered = {}
for nsname, params in pairs(mappings) do
if useTalk or nsname ~= 'talk' then
local nsid = namespaces[nsname].id
-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.
nsid = nsid + 1
mappingsOrdered[nsid] = params
end
end
mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)
-- Build the table.
local ret = '{| class="wikitable"'
.. '\n|-'
.. '\n! ' .. nsHeader
.. '\n! ' .. aliasesHeader
for i, params in ipairs(mappingsOrdered) do
for j, param in ipairs(params) do
if j == 1 then
ret = ret .. '\n|-'
.. '\n| <code>' .. param .. '</code>'
.. '\n| '
elseif j == 2 then
ret = ret .. '<code>' .. param .. '</code>'
else
ret = ret .. ', <code>' .. param .. '</code>'
end
end
end
ret = ret .. '\n|-'
.. '\n|}'
return ret
end
return p
a4757000273064f151f0f22dc0e139092e5ff443
Module:Namespace detect/config
828
235
469
468
2024-06-03T23:46:07Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text "-- " at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for "other" namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of "yes", "no", etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the "table" function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.
0e4ff08d13c4b664d66b32c232deb129b77c1a56
Module:Namespace detect/data
828
236
471
470
2024-06-03T23:46:08Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}
d224f42a258bc308ef3ad8cc8686cd7a4f47d005
Module:Pagetype
828
237
473
472
2024-06-03T23:46:08Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- --
-- PAGETYPE --
-- --
-- This is a meta-module intended to replace {{pagetype}} and similar --
-- templates. It automatically detects namespaces, and allows for a --
-- great deal of customisation. It can easily be ported to other --
-- wikis by changing the values in the [[Module:Pagetype/config]]. --
-- --
--------------------------------------------------------------------------------
-- Load config.
local cfg = mw.loadData('Module:Pagetype/config')
-- Load required modules.
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local nsDetectModule = require('Module:Namespace detect')
local nsDetect = nsDetectModule._main
local getParamMappings = nsDetectModule.getParamMappings
local getPageObject = nsDetectModule.getPageObject
local p = {}
local function shallowCopy(t)
-- Makes a shallow copy of a table.
local ret = {}
for k, v in pairs(t) do
ret[k] = v
end
return ret
end
local function checkPagetypeInput(namespace, val)
-- Checks to see whether we need the default value for the given namespace,
-- and if so gets it from the pagetypes table.
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- val for other input.
local ret = yesno(val, val)
if ret and type(ret) ~= 'string' then
ret = cfg.pagetypes[namespace]
end
return ret
end
local function getPagetypeFromClass(class, param, aliasTable, default)
-- Gets the pagetype from a class specified from the first positional
-- parameter.
param = yesno(param, param)
if param ~= false then -- No check if specifically disallowed.
for _, alias in ipairs(aliasTable) do
if class == alias then
if type(param) == 'string' then
return param
else
return default
end
end
end
end
end
local function getNsDetectValue(args)
-- Builds the arguments to pass to [[Module:Namespace detect]] and returns
-- the result.
-- Get the default values.
local ndArgs = {}
local defaultns = args[cfg.defaultns]
if defaultns == cfg.defaultnsAll then
ndArgs = shallowCopy(cfg.pagetypes)
else
local defaultnsArray
if defaultns == cfg.defaultnsExtended then
defaultnsArray = cfg.extendedNamespaces
elseif defaultns == cfg.defaultnsNone then
defaultnsArray = {}
else
defaultnsArray = cfg.defaultNamespaces
end
for _, namespace in ipairs(defaultnsArray) do
ndArgs[namespace] = cfg.pagetypes[namespace]
end
end
--[[
-- Add custom values passed in from the arguments. These overwrite the
-- defaults. The possible argument names are fetched from
-- Module:Namespace detect automatically in case new namespaces are
-- added. Although we accept namespace aliases as parameters, we only pass
-- the local namespace name as a parameter to Module:Namespace detect.
-- This means that the "image" parameter can overwrite defaults for the
-- File: namespace, which wouldn't work if we passed the parameters through
-- separately.
--]]
local mappings = getParamMappings()
for ns, paramAliases in pairs(mappings) do
-- Copy the aliases table, as # doesn't work with tables returned from
-- mw.loadData.
paramAliases = shallowCopy(paramAliases)
local paramName = paramAliases[1]
-- Iterate backwards along the array so that any values for the local
-- namespace names overwrite those for namespace aliases.
for i = #paramAliases, 1, -1 do
local paramAlias = paramAliases[i]
local ndArg = checkPagetypeInput(paramAlias, args[paramAlias])
if ndArg == false then
-- If any arguments are false, convert them to nil to protect
-- against breakage by future changes to
-- [[Module:Namespace detect]].
ndArgs[paramName] = nil
elseif ndArg then
ndArgs[paramName] = ndArg
end
end
end
-- Check for disambiguation-class and N/A-class pages in mainspace.
if ndArgs.main then
local class = args[1]
if type(class) == 'string' then
-- Put in lower case so e.g. "Dab" and "dab" will both match.
class = mw.ustring.lower(class)
end
local dab = getPagetypeFromClass(
class,
args[cfg.dab],
cfg.dabAliases,
cfg.dabDefault
)
if dab then
ndArgs.main = dab
else
local na = getPagetypeFromClass(
class,
args[cfg.na],
cfg.naAliases,
cfg.naDefault
)
if na then
ndArgs.main = na
end
end
end
-- If there is no talk value specified, use the corresponding subject
-- namespace for talk pages.
if not ndArgs.talk then
ndArgs.subjectns = true
end
-- Add the fallback value. This can also be customised, but it cannot be
-- disabled.
local other = args[cfg.other]
-- We will ignore true/false/nil results from yesno here, but using it
-- anyway for consistency.
other = yesno(other, other)
if type(other) == 'string' then
ndArgs.other = other
else
ndArgs.other = cfg.otherDefault
end
-- Allow custom page values.
ndArgs.page = args.page
return nsDetect(ndArgs)
end
local function detectRedirects(args)
local redirect = args[cfg.redirect]
-- The yesno function returns true/false for "yes", "no", etc., and returns
-- redirect for other input.
redirect = yesno(redirect, redirect)
if redirect == false then
-- Detect redirects unless they have been explicitly disallowed with
-- "redirect=no" or similar.
return
end
local pageObject = getPageObject(args.page)
-- If we are using subject namespaces elsewhere, do so here as well.
if pageObject
and not yesno(args.talk, true)
and args[cfg.defaultns] ~= cfg.defaultnsAll
then
pageObject = getPageObject(
pageObject.subjectNsText .. ':' .. pageObject.text
)
end
-- Allow custom values for redirects.
if pageObject and pageObject.isRedirect then
if type(redirect) == 'string' then
return redirect
else
return cfg.redirectDefault
end
end
end
function p._main(args)
local redirect = detectRedirects(args)
if redirect then
return redirect
else
return getNsDetectValue(args)
end
end
function p.main(frame)
local args = getArgs(frame)
return p._main(args)
end
return p
4e76ed8318e724693304c0ca2063b36b0890825a
Module:Pagetype/config
828
238
475
474
2024-06-03T23:46:09Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
--------------------------------------------------------------------------------
-- Module:Pagetype configuration data --
-- This page holds localisation and configuration data for Module:Pagetype. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
-- This table holds the values to use for "main=true", "user=true", etc. Keys to
-- this table should be namespace parameters that can be used with
-- [[Module:Namespace detect]].
cfg.pagetypes = {
['main'] = 'article',
['user'] = 'user page',
['project'] = 'project page',
['wikipedia'] = 'project page',
['wp'] = 'project page',
['file'] = 'file',
['image'] = 'file',
['mediawiki'] = 'interface page',
['template'] = 'template',
['help'] = 'help page',
['category'] = 'category',
['portal'] = 'portal',
['book'] = 'book',
['draft'] = 'draft',
['education program'] = 'education program page',
['timedtext'] = 'Timed Text page',
['module'] = 'module',
['topic'] = 'topic',
['gadget'] = 'gadget',
['gadget definition'] = 'gadget definition',
['talk'] = 'talk page',
['special'] = 'special page',
['media'] = 'file',
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes by default.
cfg.defaultNamespaces = {
'main',
'file',
'template',
'category',
'module',
'book'
}
-- This table holds the names of the namespaces to be looked up from
-- cfg.pagetypes if cfg.defaultnsExtended is set.
cfg.extendedNamespaces = {
'main',
'user',
'project',
'file',
'mediawiki',
'template',
'category',
'help',
'portal',
'module',
'book',
'draft'
}
-- The parameter name to set which default namespace values to be looked up from
-- cfg.pagetypes.
cfg.defaultns = 'defaultns'
-- The value of cfg.defaultns to set all namespaces, including talk.
cfg.defaultnsAll = 'all'
-- The value of cfg.defaultns to set the namespaces listed in
-- cfg.extendedNamespaces
cfg.defaultnsExtended = 'extended'
-- The value of cfg.defaultns to set no default namespaces.
cfg.defaultnsNone = 'none'
-- The parameter name to use for disambiguation pages page.
cfg.dab = 'dab'
-- This table holds the different possible aliases for disambiguation-class
-- pages. These should be lower-case.
cfg.dabAliases = {
'disambiguation',
'disambig',
'disamb',
'dab'
}
-- The default value for disambiguation pages.
cfg.dabDefault = 'page'
-- The parameter name to use for N/A-class page.
cfg.na = 'na'
-- This table holds the different possible aliases for N/A-class pages. These
-- should be lower-case.
cfg.naAliases = {'na', 'n/a'}
-- The default value for N/A-class pages.
cfg.naDefault = 'page'
-- The parameter name to use for redirects.
cfg.redirect = 'redirect'
-- The default value to use for redirects.
cfg.redirectDefault = 'redirect'
-- The parameter name for undefined namespaces.
cfg.other = 'other'
-- The value used if the module detects an undefined namespace.
cfg.otherDefault = 'page'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line
cbb04dd488cb9335e0f9f749e3d106e6071cfead
Template:Parameter names example
10
239
477
476
2024-06-03T23:46:09Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
{{Documentation}}
</noinclude>
6b63b13c0cf74f1f8d250aa644a6bd27e19052f6
Module:Parameter names example
828
240
479
478
2024-06-03T23:46:09Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements {{parameter names example}}.
local p = {}
local function makeParam(s)
local lb = '{'
local rb = '}'
return lb:rep(3) .. s .. rb:rep(3)
end
local function italicize(s)
return "''" .. s .. "''"
end
local function plain(s)
return s
end
function p._main(args, frame)
-- Find how we want to format the arguments to the template.
local formatFunc
if args._display == 'italics' or args._display == 'italic' then
formatFunc = italicize
elseif args._display == 'plain' then
formatFunc = plain
else
formatFunc = makeParam
end
-- Build the table of template arguments.
local targs = {}
for k, v in pairs(args) do
if type(k) == 'number' then
targs[v] = formatFunc(v)
elseif not k:find('^_') then
targs[k] = v
end
end
targs['nocat'] = 'yes';
targs['categories'] = 'no';
targs['demo'] = 'yes';
-- Find the template name.
local template
if args._template then
template = args._template
else
local currentTitle = mw.title.getCurrentTitle()
if currentTitle.prefixedText:find('/sandbox$') then
template = currentTitle.prefixedText
else
template = currentTitle.basePageTitle.prefixedText
end
end
-- Call the template with the arguments.
frame = frame or mw.getCurrentFrame()
local success, result = pcall(
frame.expandTemplate,
frame,
{title = template, args = targs}
)
if success then
return result
else
return ''
end
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:Parameter names example'
})
return p._main(args, frame)
end
return p
576eb8298850f4e4e62105ac740df295b7b7eb9e
Template:When on basepage
10
241
481
480
2024-06-03T23:46:10Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:
<!--If no or empty "page" parameter then detect
basepage/subpage/subsubpage-->
{{#if:{{{page|}}}
| {{#if:{{#titleparts:{{{page}}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{{page}}}|0|2}}
| subpage
| basepage
}}
}}
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
| subsubpage <!--Subsubpage or lower-->
| {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
| subpage
| basepage
}}
}}
}}
| basepage = {{{1|}}}
| subpage = {{{2|}}}
| subsubpage = {{{3| {{{2|}}} }}} <!--Respecting empty parameter on purpose-->
}}<!--End switch--><noinclude>
{{Documentation}}
</noinclude>
cf4dc92df647a26ab0ce149772a1fe3ac6c3dfc0
Template:!mxt
10
242
483
482
2024-06-03T23:46:12Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="example deprecated-content example-bad monospaced example-mono" style="font-family: monospace, monospace; color: #8B0000;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span><!--"monospace, monospace" needed per https://en.wikipedia.org/wiki/Wikipedia:Typography#The_monospace_'bug'--><noinclude>
{{Documentation|Template:Xt/doc}}
<!--This category has to be done on a per-template basis, not in the shared docs, since it only apply to four templates in the family.-->
[[Category:Programming typing-aid templates]]
{{En-WP attribution notice|Template:!mxt}}
</noinclude>
de48396a3fdbdbf3d480b61327942e47a337fde1
Template:!xt
10
243
485
484
2024-06-03T23:46:13Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="example deprecated-content example-bad" style="font-family: Georgia, 'DejaVu Serif', serif; color: #8B0000;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span><noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:!xt}}
</noinclude>
e89f9718954fee01410846fd9144280a83cc1628
Template:Age
10
244
487
486
2024-06-03T23:46:13Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly><noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Age}}
</noinclude>
6d56a9a667793177cf533ebe051cd9d67f3b3c38
Template:Anchor
10
245
489
488
2024-06-03T23:46:13Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{{{{|safesubst:}}}#invoke:anchor|main}}<noinclude>
{{Documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Anchor}}
</noinclude>
6d6e668cdf4065f16a70fc35c1363cf9a1a5df67
Template:Basepage subpage
10
246
491
490
2024-06-03T23:46:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:When on basepage]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}
47118a1bed1942b7f143cdff1dec183002fc9f4b
Template:Birth date and age
10
247
493
492
2024-06-03T23:46:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><span style="display:none"> (<span class="bday">{{{1|{{{year}}}}}}-{{padleft:{{{2|{{{month}}}}}}|2|0}}-{{padleft:{{{3|{{{day}}}}}}|2|0}}</span>) </span>{{#if:{{{df|}}}|{{#expr:{{{3|{{{day}}}}}}}} {{MONTHNAME|{{{2|{{{month}}}}}}}}|{{MONTHNAME|{{{2|{{{month}}}}}}}} {{#expr:{{{3|{{{day}}}}}}}},}} {{{1|{{{year}}}}}}<span class="noprint ForceAgeToShow"> (age {{age | {{{1|{{{year}}}}}} | {{{2|{{{month}}}}}} | {{{3|{{{day}}}}}} }})</span><!--
-- Error checks --
-->{{#ifexpr: ( {{{1|{{{year}}}}}} > {{CURRENTYEAR}} ) OR ( {{CURRENTYEAR}} - {{{1|{{{year}}}}}} > 150 )
|  {{error|invalid year}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#ifexpr: ( {{{2|{{{month}}}}}} > 12 ) OR ( {{{2|{{{month}}}}}} < 1 )
|  {{error|invalid month}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#ifexpr: ( {{{3|{{{day}}}}}} > 31 ) OR ( {{{3|{{{day}}}}}} < 1 )
|  {{error|invalid day}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}</includeonly><noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Birth date and age}}
</noinclude>
7df5b88ef29db70b767c8b315ba2ecad6bf9bc2e
Template:Block indent
10
248
495
494
2024-06-03T23:46:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div {{#if:{{{class|}}}|class="{{{class}}}"}} style="padding-left: {{{left|{{{em|3}}}}}}em; padding-right:{{{right|0}}}em; overflow: hidden; {{#if:{{{style|}}}|{{{style}}}}}">{{{1|{{{text|{{{quote|<noinclude>{{lorem ipsum}}</noinclude><includeonly>{{error|Error: No content given to indent (or equals sign used in the actual argument to an unnamed parameter)}}</includeonly>}}}}}}}}}</div><noinclude>
{{documentation}}
{{En-WP attribution notice|Template:Block indent}}
</noinclude>
e8811d2dcba863aeb63d63eedc01ec57385457cd
Template:Crossref
10
249
497
496
2024-06-03T23:46:15Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Crossreference]]
{{Rcat shell|
{{R from template shortcut}}
}}
dc4192593ccb8eaa34c0440c4aa712442a06c329
Template:Crossreference
10
250
499
498
2024-06-03T23:46:15Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Hatnote inline|1={{{1|{{{text|{{{content|<noinclude>sample content</noinclude>}}}}}}}}}|extraclasses={{{class|{{{extraclasses|}}}}}}|selfref={{#if:{{{selfref|{{{printworthy|{{{unprintworthy|}}}}}}}}}||yes}}}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{En-WP attribution notice|Template:Crossreference}}
</noinclude>
526faf3f91a2a3fbf706735836db838debadb848
Template:Flatlist
10
251
501
500
2024-06-03T23:46:15Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div class="hlist {{{class|}}}" {{#if:{{{style|}}}{{{indent|}}}|style="{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}"}}>{{#if:{{{1|}}}|
{{{1}}}
</div>}}<noinclude></div>
{{documentation}}
</noinclude>
ec300849f550d5798230cadd0db437bd1612ef15
Template:Infobox person/doc
10
252
503
502
2024-06-03T23:46:17Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{documentation subpage}}
{{Person infobox header}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{tl|Infobox person}} may be used to summarize information about a particular person, usually at the top of an article.
== Usage ==
The infobox may be added by pasting the template as shown below into an article and then filling in the desired fields. Any parameters left blank or omitted will not be displayed.
=== Blank template with basic parameters ===
{{Infobox person
| name = ''name''
| image = example-serious.jpg
| alt = alt
| caption = ''caption''
| birth_name = ''birth_name''
| birth_date = ''birth_date''
| birth_place = ''birth_place''
| death_date = ''death_date''
| death_place = ''death_place''
| nationality = ''nationality''
| other_names = ''other_names''
| occupation = ''occupation''
| years_active = ''years_active''
| known_for = ''known_for''
| notable_works = ''notable_works''
}}
<pre style="overflow:auto; line-height:1.2em;">
{{Infobox person
| name = <!-- include middle initial, if not specified in birth_name -->
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| alt = <!-- descriptive text for use by speech synthesis (text-to-speech) software -->
| caption =
| birth_name = <!-- only use if different from name -->
| birth_date = <!-- {{birth date and age|YYYY|MM|DD}} for living people supply only the year with {{Birth year and age|YYYY}} unless the exact date is already widely published, as per [[WP:DOB]]. For people who have died, use {{Birth date|YYYY|MM|DD}}. -->
| birth_place =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (DEATH date then BIRTH date) -->
| death_place =
| nationality =
| other_names =
| occupation =
| years_active =
| known_for =
| notable_works =
}}
</pre>
{{clear}}
=== Blank template with all parameters ===
Only the most pertinent information should be included. Please {{em|remove}} unused parameters, and refrain from inserting dubious trivia in an attempt to fill all parameters.
{{Parameter names example | _display=italics
| pre-nominals | name | post-nominals
| image=example-serious.jpg | image_upright | alt | caption <!--shows placement of parameters, see examples for image-->
| native_name | native_name_lang | pronunciation
| birth_name | birth_date | birth_place | baptised <!--does not display due to birth date displayed-->
| disappeared_date | disappeared_place | disappeared_status | death_date | death_place | death_cause
| body_discovered | resting_place | resting_place_coordinates | monuments
| residence | nationality | other_names | citizenship | education | alma_mater
| occupation | years_active | era | employer | organization | agent | known_for | notable_works
| style | home_town | salary | net_worth | height | weight | television
| title | term | predecessor | successor | party | movement | opponents | boards
| criminal_charge | criminal_penalty | criminal_status
| spouse | partner | children | parents | relatives | family | callsign | awards | website
| module | module2 | module3 | module4 | module5 | module6 <!--removed the ... which only saved two lines from being shown-->
| signature=''<nowiki />signature'' | signature_size=''signature_size''<br /> | signature_alt <!--shows placement of parameters, see examples for image-->
| footnotes
}}
<pre style="overflow:auto; line-height:1.2em">
{{Infobox person
| pre-nominals =
| name = <!-- include middle initial, if not specified in birth_name -->
| post-nominals =
| image = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
| image_upright =
| alt =
| caption =
| native_name =
| native_name_lang =
| pronunciation =
| birth_name = <!-- only use if different from name above -->
| birth_date = <!-- {{birth date and age|YYYY|MM|DD}} for living people supply only the year with {{Birth year and age|YYYY}} unless the exact date is already widely published, as per [[WP:DOB]]. For people who have died, use {{Birth date|YYYY|MM|DD}}. -->
| birth_place =
| baptised = <!-- will not display if birth_date is entered -->
| disappeared_date = <!-- {{disappeared date and age|YYYY|MM|DD|YYYY|MM|DD}} (disappeared date then birth date) -->
| disappeared_place =
| disappeared_status =
| death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (death date then birth date) -->
| death_place =
| death_cause =
| body_discovered =
| resting_place =
| resting_place_coordinates = <!-- {{coord|LAT|LONG|type:landmark|display=inline}} -->
| burial_place = <!-- may be used instead of resting_place and resting_place_coordinates (displays "Burial place" as label) -->
| burial_coordinates = <!-- {{coord|LAT|LONG|type:landmark|display=inline}} -->
| monuments =
| residence =
| nationality =
| other_names =
| citizenship =
| education =
| alma_mater =
| occupation =
| years_active =
| era =
| employer =
| organization =
| agent = <!-- Discouraged in most cases, specifically when promotional, and requiring a reliable source -->
| known_for =
| notable_works = <!-- produces label "Notable work"; may be overridden by |credits=, which produces label "Notable credit(s)"; or by |works=, which produces label "Works"; or by |label_name=, which produces label "Label(s)" -->
| style =
| home_town =
| salary =
| net_worth = <!-- Net worth should be supported with a citation from a reliable source -->
| height = <!-- "X cm", "X m" or "X ft Y in" plus optional reference (conversions are automatic) -->
| weight = <!-- "X kg", "X lb" or "X st Y lb" plus optional reference (conversions are automatic) -->
| television =
| title = <!-- Formal/awarded/job title. The parameter |office= may be used as an alternative when the label is better rendered as "Office" (e.g. public office or appointments) -->
| term =
| predecessor =
| successor =
| party =
| movement =
| opponents =
| boards =
| criminal_charge = <!-- Criminality parameters should be supported with citations from reliable sources -->
| criminal_penalty =
| criminal_status =
| spouse = <!-- Use article title or common name -->
| partner = <!-- (unmarried long-term partner) -->
| children =
| parents = <!-- overrides mother and father parameters -->
| mother = <!-- may be used (optionally with father parameter) in place of parents parameter (displays "Parent(s)" as label) -->
| father = <!-- may be used (optionally with mother parameter) in place of parents parameter (displays "Parent(s)" as label) -->
| relatives =
| family =
| callsign =
| awards =
| website = <!-- {{URL|example.com}} -->
| module =
| module2 =
| module3 =
| module4 =
| module5 =
| module6 =
| signature =
| signature_size =
| signature_alt =
| footnotes =
}}
</pre>
{{clear}}
== Parameters ==
<big>Do not use all these parameters for any one person. The list is long to cover a wide range of people. Only use those parameters that convey essential or notable information about the subject, and ensure that that information is sourced in the article or (if present only in the infobox) in the infobox itself.</big>
Any parameters left blank or omitted will not be displayed. Many parameters have alternative names, implemented for compatibility with other templates (especially to aid merging). The preferred names are shown in the table below.
{| class="wikitable"
! style="text-align: left" | Parameter
! style="text-align: left" | Explanation
|-
| '''<code>pre-nominals</code>'''
| To appear on the line above the person's name. This is for things like <code><nowiki>|pre-nominals=Sir</nowiki></code> – honorifics of serious significance that are attached to the name in formal address, such as knighthoods and titles of nobility; do not use it for routine things like "{{!mxt|[[Dr.]]}}" or "{{!mxt|[[Ms.]]}}"
|-
| '''<code>name</code>'''
| Common name of person (defaults to article name if left blank; provide {{para|birth_name}} (below) if different from {{para|name}}). If middle initials are specified (or implied) by the lead of the article, and are not specified separately in the {{para|birth_name}} parameter, include them here. ''Do not put honorifics or alternative names in this parameter.'' There are separate parameters for these things, covered below.
|-
| '''<code>post-nominals</code>'''
| To appear on the line below the person's name. This is for things like <code><nowiki>|post-nominals=[[Officer of the Order of the British Empire|OBE]]</nowiki></code> – honorifics of serious significance that are attached to the name in formal address, such as national orders and non-honorary doctorates; do not use it for routine things like "{{!mxt|[[Bachelor of arts|BA]]}}". It is permissible but not required to use the {{tlx|post-nominals}} template inside this parameter; doing so requires {{tlx|post-nominals|size{{=}}100|...}}.
|-
| '''<code>image</code>'''
| Image name: {{kbd|abc.jpg}}, {{kbd|xpz.png}}, {{kbd|123.gif}}, etc., without the {{samp|File:}} or {{samp|Image:}} prefix. If an image is desired but not available, one may add {{kbd|yes}} to the {{para|needs-photo}} parameter of the {{tlx|WikiProject Biography}} template on the talk page. If no image is available yet, [[Wikipedia:Centralized discussion/Image placeholders|do not use an image placeholder]].
|-
| '''<code>image_upright</code>'''
| Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).
|-
| '''<code>alt</code>'''
| Descriptive [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|<code>alt</code> text for the image]], for visually impaired readers. One word (such as {{kbd|photograph}}) is rarely sufficient. Do not copy-paste the value of {{para|caption}} (below) into this parameter. Example of the difference: "Willie Nelson at a concert in Dallas, 1989" is good as {{para|caption}} value; "Nelson in western-wear with an acoustic guitar, on stage in a daytime show with band in background" is an {{para|alt}} description. If nothing meaningful can be said that isn't already in the caption, use the [[Wikipedia:Manual of Style/Accessibility/Alternative text for images#Captions and nearby text|stock text]] {{para|alt|refer to caption}}.
|-
| '''<code>caption</code>'''
| Caption for image, if needed. Try to include the date of photo, some context, and the photographer if known (check the <code>File:</code> or [[Wikimedia Commons|Commons]] page for the image).
|-
| '''<code>native_name</code>'''
| The person's name in their own language, if different.
|-
| '''<code>native_name_lang</code>'''
| [[ISO 639-1]] code, e.g., "{{kbd|fr}}" for French. If more than one, use {{tlx|lang}} around each name in {{para|native_name}} instead.
|-
| '''<code>pronunciation</code>'''
| Details of how to pronounce the individual's native name. <!--copied from TemplateData description, if changed please update there also-->
|-
| '''<code>birth_name</code>'''
| Name at birth; only use if different from {{para|name}}.
|-
| '''<code>birth_date</code>'''
| Date of birth: Use {{tlx|birth date and age}} (if living) or {{tlx|birth date}} (if dead). {{crossref|See template's page for details on usage.}} If only a year of birth is known, or age as of a certain date, consider using {{tlx|birth year and age}} or {{tlx|birth based on age as of date}}. For living people [[Wikipedia:Biographies of living persons#Privacy of personal information and using primary sources|supply only the year unless the exact date is already widely published]]. Treat such cases as if only the year is known, so use {{tlx|birth year and age}} or a similar option. The templates mentioned in this paragraph emit metadata indicating the date is in the Gregorian calendar; if the date is in the Julian calendar, do not use these templates, just write the date.
|-
| {{anchor|birth_place}}'''<code>birth_place</code>'''
| Place of birth: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}.
* Use the name of the birthplace at the time of birth, e.g.: {{kbd|Saigon}} (prior to 1976) or {{kbd|Ho Chi Minh City}} (post 1976).
* [[Wikipedia:Manual of Style/Icons#Do not use flags to indicate locations of birth, residence, or death|Do not use a flag template]], coat of arms, or other icon.
* [[Wikipedia:Manual of Style/Infoboxes#Purpose of an infobox|Omit unnecessary or redundant details]]. For example, it is not necessary to state: {{!xt|{{kbd|[[New York City]], [[New York (state)|New York]], [[United States]]}}}} when {{xt|{{kbd|[[New York City]], US}}}} conveys essentially the same information more concisely.
* Countries should [[Wikipedia:Manual of Style/Linking#What generally should not be linked|generally not be linked]].
* For modern subjects, the country should generally be a sovereign state; for United Kingdom locations, the constituent [[Countries of the United Kingdom|countries of the UK]] are sometimes used instead, when more appropriate in the context.
* For historical subjects, use the place name most appropriate for the context and our readership. What the place may correspond to on a modern map is a matter for an article's main text.
* For subsequent places (of death, etc.) it is not necessary to repeat jurisdictional details or links for the same place name.
|-
| '''<code>baptised</code>'''
| Date of baptism: {{em|Only}} for use when birth date is not known (e.g., for [[Ludwig van Beethoven]]). Will not display if a birth date is entered. Do not use subtemplates. Parameter <code>baptized</code> can be used for articles that use American english spelling.
|-
| '''<code>disappeared_date</code>'''
| (For missing people) Date of disappearance: Use {{tlx|disappeared date and age}} (if birth date is known) or {{tlx|disappeared date}} (if birth date unknown).
|-
| '''<code>disappeared_place</code>'''
| (For missing people) Place of disappearance: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. <!--This space is needed for readability, due to quirk of these templated elements being in proximity.--> ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>disappeared_status</code>'''
| (For missing people) Current status for the person, e.g., if the person is still regarded as missing (using {{tlx|missing for}} to calculate the time since disappearance), or if the person has been [[Declared death in absentia|declared dead ''{{lang|la|in absentia}}'']], with a date for such a ruling.
|-
| '''<code>death_date</code>'''
| Date of death: Use {{tlx|death date and age}} (if birth date is known) or {{tlx|death date}} (if birth date unknown). {{crossref|See template's page for details on usage.}} If exact dates are unknown, consider using {{tlx|death year and age}}. The templates mentioned in this paragraph emit metadata indicating the date is in the Gregorian calendar; if the date is in the Julian calendar, do not use these templates, just write the date.
|-
| '''<code>death_place</code>'''
| Place of death: {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>death_cause</code>'''
| Cause of death. Should be clearly defined and sourced, and should only be included when the cause of death has significance for the subject's notability, e.g. [[James Dean]], [[John Lennon]]. It should not be filled in for unremarkable deaths such as those from old age or routine illness, e.g. [[Bruce Forsyth]], [[Eduard Khil]].
|-
| '''<code>body_discovered</code>'''
| Place where the body was discovered (if different from place of death). {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>burial_place</code>'''
| Place of burial {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc. {{crossref|See {{para|resting_place}} for non-burials}}.)
|-
| '''<code>burial_coordinates</code>'''
| Coordinates for place of burial, to accompany {{para|burial_place}}. Use {{tlx|coord}} template.
|-
| '''<code>resting_place</code>'''
| Location of columbarium, ash-scattering, etc. If no location, leave blank. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>resting_place_coordinates</code>'''
| Coordinates for location of columbarium, ash-scattering etc. Use {{tlx|coord}} template.
|-
| '''<code>monuments</code>'''
| Significant monuments erected, buildings named, etc., in honour of the subject. If many, link to an appropriate section of the article instead.
|-
| '''<code>residence</code>'''
| Location(s) where the person notably resides/resided, if different from birthplace. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>nationality</code>'''
| May be used instead of {{para|citizenship}} (below) or vice versa in cases where any confusion could result. Should only be used {{em|with}} {{para|citizenship}} when they differ. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, anachronisms, "country" definitions, etc.)
|-
| '''<code>other_names</code>'''
| Other notable names for the person, if different from {{para|name}} and {{para|birth_name}}. [[Wikipedia:Manual of Style/Biographies#Pseudonyms|This can include]] stage names, maiden/married names, nicknames, criminal aliases, etc.
|-
| '''<code>citizenship</code>'''
| Country of legal citizenship, if different from nationality. Rarely needed. See usage notes for {{para|nationality}}, above. Should only be used if citizenship differs from the value in {{para|nationality}} and cannot be inferred from the birthplace. Note that many countries do not automatically grant citizenship to people born within their borders. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, anachronisms, "country" definitions, etc.)
|-
| '''<code>education</code>'''
| Education, e.g., degree, institution and graduation year, if relevant. If very little information is available or relevant, the {{para|alma_mater}} parameter may be more appropriate.
|-
| '''<code>alma_mater</code>'''
| ''[[Alma mater]]''. This parameter is a more concise alternative to (not addition to) {{para|education}}, and will often consist of the linked name of the last-attended institution of higher education (not secondary schools). It is usually not relevant to include either parameter for non-graduates, but article talk page consensus may conclude otherwise, as perhaps at [[Bill Gates]].
|-
| '''<code>occupation</code>'''
| Occupation(s) as given in the lead. Use list markup for three or more entries, e.g. with {{tlx|flatlist}}. Please observe [[sentence case]] and capitalise only the first letter of the first item; e.g.:
{{block indent|1={{Flatlist|
* Musician
* singer-songwriter
* actor
}}}}
|-
| '''<code>years_active</code>'''
| Date range in years during which the subject was active in their principal occupation(s) and/or other activity for which they are notable. Use the format <code>1950–2000</code>, or <code>1970–present</code> if still active. [[Wikipedia:Manual of Style/Dates and numbers#Ranges|Date ranges]] always use an [[Wikipedia:Manual of Style#En dashes|en dash]], not hyphen. If no dates of birth and/or death are known for the subject, only a ''[[floruit]]'' date range, as is common with ancient subjects, this parameter can be used for it. If approximate (''[[circa]]'') dates are known for either or both, put them in the {{para|birth_date}} and {{para|death_date}} parameters. Helpful templates: {{tlx|floruit}}, {{tlx|circa}}.
|-
| '''<code>era</code>'''
| Era (e.g., {{kbd|Medieval}}) in which the person lived; less specific than {{para|years_active}}. Should not be used if dates are available.
|-
| '''<code>employer</code>'''
| Employer(s), if relevant.
|-
| '''<code>organization</code>'''
| Non-employing organization(s), if relevant.
|-
| '''<code>agent</code>'''
| The subject's agent (individual and/or agency), discouraged in most cases, specifically when promotional, and requiring a [[Wikipedia:Identifying reliable sources|reliable source]].
|-
| '''<code>known_for</code>'''
| A brief description of why the person is notable.
|-
| {{unbulleted list|'''<code>notable_works</code>''';<br /> <small>alternatives:</small>
|'''<code>credits</code>'''
|'''<code>label_name</code>'''
|'''<code>works</code>'''
}}
| Title(s) of notable work(s) (publications, compositions, sculptures, films, etc.) by the subject, if any. Produces the label '''Notable work'''. May be overridden by {{para|credits}}, which produces '''Notable credit(s)'''; or by {{para|works}}, which produces '''Works'''; or by {{para|label_name}}, which produces '''Label(s)'''.
* The {{para|notable_works}}, {{para|credits}}, and {{para|label_name}} parameters are intended to be (at most) short [[#Inline list|inline lists]].
* The {{para|label_name}} variant is used for one or more record labels with which a performer is associated, or a fashion label in which a designer has been heavily involved or for which they are well known. Remember that this parameter is an alternative to the others mentioned here and is not used along with them.
* The {{para|works}} variant is intended to link to {{em|a specific list article}} for a larger body of work (not all of which may be individually notable).
|-
| '''<code>style</code>'''
| The style of the subject's works, if applicable. {{crossref|This parameter is not for [[Style (manner of address)|styles of address or office]]; see {{para|pre-nominals}}.}}
|-
| '''<code>home_town</code>'''
| The place where the person was raised and matured, if different from birthplace and residence. {{kbd|{{var|city}}, {{var|administrative region}}, {{var|country}}}}. ({{crossref|See {{para|birth_place}}, [[#birth_place|above]], for instructions on how to use this parameter}}, including: no flag templates, inappropriate linking, redundancy, anachronisms, "country" definitions, etc.)
|-
| '''<code>salary</code>'''
| Annual salary or compensation, if relevant. Link the first occurrence to the currency article, e.g.: <code><nowiki>[[Pound sterling|₤]]86,000</nowiki></code>
|-
| '''<code>net_worth</code>'''
| Current estimated net worth, if relevant. Please be sure to support with a citation from a reliable source, in the article body.
|-
| '''<code>height</code>'''
| If person was notable for their height, or if height is relevant. If used, this should also include the year of the measurement if the person had not reached full adulthood when this stat was published. {{crossref|See documentation of this parameter at [[Template:Infobox sportsperson]] for more information.}}
|-
| '''<code>weight</code>'''
| If person was notable for their weight, or if weight is relevant. If used, this should also include the year of the measurement. {{crossref|See documentation of this parameter at [[Template:Infobox sportsperson]] for more information.}}
|-
| '''<code>television</code>'''
| Television programmes presented by or {{em|closely}} associated with the subject. For multiple entries, use an [[#Inline list|inline list]].
|-
| '''<code>title</code>'''
| Multiple uses:
* Formal title, such as {{kbd|First Lady of Japan}} for [[Akie Abe]].
* Awarded title, such as {{kbd|Mr. Olympia}} for [[Arnold Schwarzenegger]].
* Job title, such as {{kbd|President of Calvin College}} for [[Anthony Diekema]].
* A combination of the above, such as {{kbd|Professor of Mathematics}} and {{kbd|[[Fellow of the Royal Society]]}} for [[Bill Parry (mathematician)|Bill Parry]]
For multiple entries, use an [[#Inline list|inline list]].
Use the {{para|awards}} parameter, below, for awarded honors that are not really titles. A single award should not use both parameters.
|-
| '''<code>office</code>'''
| May be used as an alternative to {{para|title}} when the label is better displayed as '''Office''' (e.g. public office or appointments). Using this parameter will override {{para|title}}.
|-
| '''<code>term</code>'''
| Years the person held the {{para|title}} or {{para|office}} listed above. Helpful template: {{tlx|reign}} (also used for civil offices).
|-
| '''<code>predecessor</code>'''
| Person who previously held the {{para|title}} or {{para|office}} listed above.
|-
| '''<code>successor</code>'''
| Person who subsequently held the {{para|title}} or {{para|office}} listed above.
|-
| '''<code>party</code>'''
| If relevant. Field labelled '''Political party'''.
|-
| '''<code>movement</code>'''
| If relevant. Can be [[Social movement|social]], [[Political movement|political]] (non-party), [[Art movement|artistic]], [[Philosophical movement|philosophical]], [[List of literary movements|literary]], [[Cultural movement|cultural]], etc.
|-
| '''<code>opponents</code>'''
| Notable relevant opponents (e.g., for major political office).
|-
| '''<code>boards</code>'''
| For [[board of directors]] membership(s), if relevant. Field labeled '''Board member of'''.
|-
| {{ubl|'''<code>criminal_charge</code>'''|'''<code>criminal_penalty</code>'''|'''<code>criminal_status</code>'''}}
| For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.
|-
| '''<code>spouse</code>'''
| Name of spouse(s), followed by years of marriage. Use the format ''Name (married 1950–present)'' for a current spouse, and ''Name (married 1970–99)'' for former spouse(s). Use article title (if linking) or [[Wikipedia:Article titles#Use commonly recognizable names|common name]]. For multiple entries, use an [[#Inline list|inline list]]. For deceased persons still married at time of death, close the date range with death year.
|-
| '''<code>partner</code>'''
| If particularly relevant, or if the partner is notable; "partner" here means unmarried [[life partner]]s (of any gender or sexual preference), not business partner. Use the format ''Name (1950–present)'' for current partner and ''Name (1970–1999)'' for former partner(s). [[Wikipedia:Manual of Style/Dates_and numbers#Ranges|Do not use truncated years]] (as in "{{xt|1970–99}}").
|-
| '''<code>children</code>'''
| Only if independently notable themselves or particularly relevant. Number of children (e.g., {{kbd|three}}), or list of names if notable. For multiple entries, use an [[#Inline list|inline list]]. {{em|For [[Wikipedia:Biographies of living persons#Privacy of names|privacy reasons]], consider omitting the names of children of living persons, unless notable.}}
|-
| '''<code>parents</code>'''
| Names of parents; include only if they are independently notable or particularly relevant. For multiple entries, use an [[#Inline list|inline list]]. If subject has only one notable mother and/or only one notable father, {{para|mother}} and {{para|father}} parameters may be used instead. These parameter may be used for biological, adoptive, foster, or step-parents.
|-
| '''<code>mother</code>'''
| Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Displays '''Parent(s)''' as label, and is overridden by the {{para|parents}} parameter.
|-
| '''<code>father</code>'''
| Name of father; include only if subject has one father who is independently notable or particularly relevant. Displays '''Parent(s)''' as label, and is overridden by the {{para|parents}} parameter.
|-
| '''<code>relatives</code>'''
| Names of siblings or other relatives; include only if independently notable or particularly relevant. Include the relationship in parentheses after the name (sister, uncle, etc.). For multiple entries, use an [[#Inline list|inline list]].
|-
| '''<code>callsign</code>'''
| Amateur radio [[call sign]], if relevant.
|-
| '''<code>awards</code>'''
| Notable awards. If many, link to an appropriate section of the article instead. Use {{para|title}} parameter, above, for awarded titles; A single award should not use both parameters.
|-
| '''<code>website</code>'''
| Official website only. Unofficial websites should be placed under <code><nowiki>==External links==</nowiki></code> in the body of the article. Use {{tlx|URL}} as in {{tnull|URL|Example.com}}. Do not display the {{samp|www.}} part unless the site requires it.
|-
| {{ubl | '''<code>module</code>''' | '''<code>module2</code>''' | '''<code>module3</code>''' | '''<code>module4</code>''' | '''<code>module5</code>''' | '''<code>module6</code>''' }}
| Used for embedding other infoboxes into this one. Example:
<pre>
{{Infobox person
| name = Ian Watkins
...
| module =
{{Infobox musical artist
| embed = yes
| background = solo_singer <!-- mandatory field -->
...
}} <!-- end of Infobox musical artist -->
...
}} <!-- end of Infobox person -->
</pre>
{{crossref|For more detailed information, see [[Wikipedia:WikiProject Infoboxes/embed]].}}
|-
| '''<code>signature</code>'''
| An image of the person's signature. Please use image name: {{kbd|abc.jpg}}, {{kbd|xpz.png}}, {{kbd|123.gif}}, etc., without the {{samp|File:}} or {{samp|Image:}} prefix
|-
| '''<code>signature_size</code>'''
| Default is {{samp|150px}}. If necessary, a signature can be resized manually as per the {{para|image_size}} parameter.
|-
| '''<code>signature_alt</code>'''
| Alt text for the signature image. For example, for {{samp|[[:File:Thomas Jefferson Signature.svg]]}}, the alt text might be <code>|signature_alt= Th: Jefferson</code>, spelling out the signature exactly as it appears in the image.
|-
| '''<code>footnotes</code>'''
| Textual notes about any of the infobox data. This is not for reference citations. If an infobox parameter's value needs a citation, [[Wikipedia:Citing sources|cite inline]] at the end of the value. Citations will appear in the article's references section along with the other citations in the article.
|-
| '''<code>image_size</code>'''
| {{strongbad|Deprecated}}. Size to display image: {{kbd|200px}} (set width), {{kbd|x300px}} (set height), or {{kbd|200x300px}} (max width & max height). If empty or omitted, this defaults to {{samp|frameless}} (default is {{samp|220px}}, but logged-in users can change this by clicking on "my preferences" and adjusting thumbnail size). [[Wikipedia:Image use policy#Displayed image size|Use of this parameter is discouraged]]. Use image_upright instead. Do not use "{{!mxt|×}}" or capital "{{!mxt|X}}"
|}
=== Inline lists ===
{{Main|WP:Manual of Style/Lists#Horizontal lists|WP:Manual of Style/Lists#Unbulleted lists}}
Parameters with multiple values should be formatted with inline-list templates.
'''Horizontal''' ones include {{tlx|hlist}} or {{tlx|flatlist}}. In [[Wikipedia:Manual of Style/Lists#Horizontal lists|horizontal style]], only the first item is capitalized (aside from [[Wikipedia:Manual of Style/Capital letters#Proper names|proper names]]).
This style is best for short items, and few of them. An entry of two or three very short items that will all fit on one line can be done simply with commas: {{para|parameter_name|Foo, bar, baz}} (use semicolons if any items contain their own commas).
Horizontal list example with {{tlx|hlist|Item one|item two|item three}}: {{hlist|Item one|item two|item three}}
'''Vertical''' templates are {{tlx|plainlist}} and {{tlx|unbulleted list}} (vertical), use [[Wikipedia:Manual of Style/Lists#Unbulleted lists|unbulleted, non-indented lists]] for clean display in infoboxes. Entries may be all [[sentence case]], or all lowercase (aside from proper names) after the first.
This style is best for long items, and longer lists. For long lists of information that may not be of immediate interest but retained for reference, the {{tlx|collapsible list}} template can be used; this is not a universally accessible option, so should not be used for key information.
''[[Wikipedia:Manual of Style/Lists#Line breaks|Do not use {{tag|br|s}} markup]]'' to create fake lists, as in: <code>{{!mxt|<nowiki>Item one<br />item two<br />item three</nowiki>}}</code>.
Vertical list example:, using {{tlx|unbulleted list|Item one|item two|item three}}:
{{unbulleted list|Item one|item two|item three}}
== Examples ==
{{Infobox person{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}}
| name = Bill Gates
| image = Bill Gates in WEF, 2007.jpg
| caption = Bill Gates at the [[World Economic Forum]] in [[Davos]], 2007
| birth_name = William Henry Gates III
| birth_date = {{birth date and age|1955|10|28}}
| birth_place = [[Seattle]], Washington, US
| occupation = {{unbulleted list| Chairman of [[Microsoft]] (non-executive) | Co-chair of [[Bill & Melinda Gates Foundation]] | Director of [[Berkshire Hathaway]] | CEO of [[Cascade Investment]] }}
| networth = {{increase}}[[United States dollar|US$]]53 [[1,000,000,000|billion]] (2010)<ref>[https://www.forbes.com/profile/bill-gates/ Bill Gates profile]. Forbes.com. Retrieved April 2010.</ref>
| spouse = [[Melinda Gates]] (married 1994)
| children = 3
| residence = [[Medina, Washington]]
| alma_mater = Harvard University (dropped out in 1975)
| website = {{URL|microsoft.com/presspass/exec/billg}}
| signature = BillGates Signature.svg
| parents = {{unbulleted list| [[William H. Gates Sr.]] | [[Mary Maxwell Gates]] }}
}}
<pre style="overflow: auto">
{{Infobox person
| name = Bill Gates
| image = Bill Gates in WEF, 2007.jpg
| caption = Bill Gates at the [[World Economic Forum]] in [[Davos]], 2007
| birth_name = William Henry Gates III
| birth_date = {{birth date and age|1955|10|28}}
| birth_place = [[Seattle]], Washington, US
| occupation = {{unbulleted list| Chairman of [[Microsoft]] (non-executive) | Co-chair of [[Bill & Melinda Gates Foundation]] | Director of [[Berkshire Hathaway]] | CEO of [[Cascade Investment]] }}
| networth = {{increase}}[[United States dollar|US$]]53 [[1,000,000,000 (number)|billion]] (2010)<ref>[https://www.forbes.com/profile/bill-gates/ Bill Gates profile]. Forbes.com. Retrieved April 2010.</ref>
| spouse = [[Melinda Gates]] (married 1994)
| children = 3
| residence = [[Medina, Washington]]
| alma_mater = Harvard University (dropped out in 1975)
| website = {{URL|microsoft.com/presspass/exec/billg}}
| signature = BillGates Signature.svg
| parents = {{unbulleted list| [[William H. Gates, Sr.]] | [[Mary Maxwell Gates]] }}
}}
</pre>
== Microformat ==
{{UF-hcard-person}}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "An infobox for articles about people",
"params": {
"pre-nominals": {
"description": "Honorific prefix(es), to appear on the line above the person's name",
"label": "Pre-nominals",
"aliases": [
"honorific_prefix",
"honorific-prefix",
"honorific prefix"
]
},
"name": {
"description": "Common name of person (defaults to article name if left blank; provide birth_name (below) if different from name). If middle initials are specified (or implied) by the lead of the article, and are not specified separately in the birth_name field, include them here.",
"label": "Name",
"required": true
},
"post-nominals": {
"description": "Honorific suffix(es), to appear on the line below the person's name",
"label": "Post-nominals",
"aliases": [
"honorific_suffix",
"honorific-suffix",
"honorific suffix"
]
},
"image": {
"description": "Image name: abc.jpg, xpz.png, 123.gif, etc. If an image is desired but not available, one may add \"yes\" to the \"needs-photo\" section of the :Template:WPBiography on the talkpage. If no image is available yet, do not use an image placeholder.",
"label": "Image"
},
"image_size": {
"description": "DEPRECATED/DISCOURAGED. Size to display image: 200px (set width), x300px (set height), or 200x300px (max width & max height). This defaults to frameless (default is 220px, but logged in users can change this by clicking on \"my preferences\" and adjusting thumbnail size) if empty or omitted. Use of this parameter is discouraged as per WP:IMGSIZE. Use image_upright instead.",
"label": "DEPRECATED: Image size",
"aliases": [
"image size",
"imagesize"
],
"example": "200px",
"default": "220px",
"deprecated": "DEPRECATED: Use of this parameter is discouraged as per WP:IMGSIZE. Delete it when encountered and use image_upright instead."
},
"alt": {
"description": "Alt text for image, for visually impaired readers. One word (such as \"photograph\") is rarely sufficient. See WP:ALT.",
"label": "Alt"
},
"caption": {
"description": "Caption for image, if needed. Try to include date of photo and the photographer.",
"label": "Caption",
"aliases": [
"image caption",
"image_caption"
]
},
"native_name": {
"description": "The person's name in their own language, if different.",
"label": "Native name"
},
"native_name_lang": {
"description": "ISO 639-1 code, e.g., \"fr\" for French. If more than one, use Template:lang in `native_name` instead.",
"label": "Native name language"
},
"pronunciation": {
"description": "Details of how to pronounce the individual's native name.",
"label": "Native name pronunciation"
},
"birth_name": {
"description": "Name at birth; only use if different from name.",
"label": "Birth name",
"aliases": [
"birthname"
]
},
"birth_date": {
"description": "Date of birth: {{Birth date and age|YYYY|MM|DD}} for living people. For people who have died, use {{Birth date|YYYY|MM|DD}}. If only a year of birth is known, or age as of a certain date, consider using Template:birth year and age or Template:birth based on age as of date.",
"label": "Birth date"
},
"birth_place": {
"description": "Place of birth: city, administrative region, sovereign state. Use the name of the birthplace at the time of birth, e.g.: Saigon (prior to 1976), Ho Chi Minh City (post 1976). Do not use a flag template.",
"label": "Birth place"
},
"baptised": {
"description": "Date of baptism: ONLY for use when birth date is not known (e.g., Beethoven). Will not display if a birth date is entered. Do not use subtemplates. Parameter 'baptized' can be used for articles that use American english spelling.",
"label": "Baptised",
"aliases": [
"baptized"
]
},
"disappeared_date": {
"description": "(For missing people) Date of disappearance: Template:disappeared date and age (if birth date is known) or Template:disappeared date (if birth date unknown).",
"label": "Disappeared date"
},
"disappeared_place": {
"description": "(For missing people) Place of disappearance: city, administrative region, sovereign state. Do not use a flag template.",
"label": "Disappeared place"
},
"disappeared_status": {
"description": "(For missing people) Current status for the person, e.g., if the person is still regarded as missing (using Template:missing for to calculate the time since disappearance), or if the person has been declared dead in absentia, with a date for such a ruling.",
"label": "Disappeared status",
"aliases": [
"status"
]
},
"death_date": {
"description": "Date of death: {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} (if birth date is known) or Template:death date (if birth date unknown). See Template:Death date/doc for details on usage. If exact dates are unknown, consider using Template:death year and age.",
"label": "Death date"
},
"death_place": {
"description": "Place of death: city, administrative region, sovereign state. Note: Do not use a flag template. Use the name of the deathplace at the time of death, e.g.: Saigon (prior to 1976), Ho Chi Minh City (post 1976)",
"label": "Death place"
},
"death_cause": {
"description": "Cause of death.",
"label": "Death cause",
"aliases": [
"death cause"
]
},
"body_discovered": {
"description": "Place where the body was discovered (if different from place of death). Do not use a flag template.",
"label": "Body discovered",
"aliases": [
"body discovered"
]
},
"resting_place": {
"description": "Place of burial, ash-scattering, etc. Do not use a flag template.",
"label": "Resting place",
"aliases": [
"resting place",
"restingplace"
]
},
"resting_place_coordinates": {
"description": "Coordinates for place of burial, ash-scattering etc. Use Template:coord template.",
"label": "Resting place coordinates",
"aliases": [
"resting place coordinates",
"restingplacecoordinates"
]
},
"monuments": {
"description": "Significant monuments erected, buildings named, etc., in honour of the subject. If many, link to an appropriate section of the article instead.",
"label": "Monuments"
},
"residence": {
"description": "Location(s) where the person notably resides/resided, if different from birth place. Do not use a flag template.",
"label": "Residence"
},
"nationality": {
"description": "Nationality. May be used instead of citizenship (below) or vice versa in cases where any confusion could result. Should only be used 'with' citizenship when they somehow differ. Should only be used if nationality cannot be inferred from the birthplace. Do not use a flag template.",
"label": "Nationality"
},
"other_names": {
"description": "Other notable names for the person, if different from name and birth_name.",
"label": "Other names",
"aliases": [
"other names",
"othername",
"alias"
]
},
"citizenship": {
"description": "Country of legal citizenship, if different from nationality. Rarely needed. See usage notes for nationality above. Should only be used if citizenship cannot be inferred from the birthplace. Do not use a flag template.",
"label": "Citizenship"
},
"education": {
"description": "Education, e.g., degree, institution and graduation year, if relevant. If very little information is available or relevant, the `alma_mater` parameter may be more appropriate.",
"label": "Education"
},
"alma_mater": {
"description": "Alma mater. This parameter is a more concise alternative to `education`, and will most often simply consist of the linked name of the last-attended higher education institution. It is usually not relevant to include either parameter for non-graduates, but article talk page consensus may conclude otherwise, as at Bill Gates.",
"label": "Alma mater",
"aliases": [
"alma mater"
]
},
"occupation": {
"description": "Occupation(s) as given in the lead.",
"label": "Occupation"
},
"years_active": {
"description": "Date range in years during which the subject was active in their principal occupation(s) and/or other activity for which they are notable. Use the format 1950–2000, or 1970–present if still active (note the use of an en dash, not hyphen). If no dates of birth and/or death are known for the subject, only a floruit date range, as is common with ancient subjects, this parameter can be used for it. If approximate (circa) dates are known for either or both, put them in the birth_date and death_date parameters.",
"label": "Years active",
"aliases": [
"years active",
"yearsactive"
]
},
"era": {
"description": "Era during which the subject lived or was active. Less specific than 'years active'.",
"label": "Era"
},
"employer": {
"description": "Employer(s), if relevant.",
"label": "Employer"
},
"organization": {
"description": "Non-employing organization(s), if relevant.",
"label": "Organization",
"aliases": [
"organizations"
]
},
"agent": {
"description": "The subject's agent (individual and/or agency), discouraged in most cases, specifically when promotional, and requiring a reliable source.",
"label": "Agent"
},
"known_for": {
"description": "A brief description of what the person is notable for.",
"label": "Known For",
"aliases": [
"known for",
"known"
],
"example": "Environmental activism"
},
"notable_works": {
"description": "Title(s) of notable work(s) (publications, compositions, sculptures, films, etc.) by the subject, if any.",
"label": "Notable works",
"aliases": [
"works",
"credits",
"notable works"
]
},
"style": {
"description": "The style in which the subject works, if applicable.",
"label": "Style"
},
"home_town": {
"description": "The place where the person was raised and matured, if different from birth place and residence.",
"label": "Home town",
"aliases": [
"home town"
]
},
"salary": {
"description": "Annual salary or compensation, if relevant.",
"label": "Salary"
},
"net_worth": {
"description": "Current estimated net worth, if relevant. Please be sure to support with a citation from a reliable source, in the article body.",
"label": "Net worth",
"aliases": [
"net worth",
"networth"
]
},
"height": {
"description": "If person was notable for their height, or if height is relevant. If used, this should also include the year of the measurement if the person had not reached full adulthood when this stat was published. See documentation of this parameter at Template:Infobox sportsperson for more information.",
"label": "Height"
},
"height_m": {
"description": "If person was notable for their height, or if height is relevant, their height in metres (it will be automatically converted to Imperial).",
"label": "Height in metres"
},
"height_cm": {
"description": "If person was notable for their height, or if height is relevant, their height in centimetres (it will be automatically converted to Imperial).",
"label": "Height in centimetres"
},
"height_ft": {
"description": "If person was notable for their height, or if height is relevant, their height in whole feet (it will be automatically converted to SI). Use with height_in.",
"label": "Height in feet"
},
"height_in": {
"description": "If person was notable for their height, or if height is relevant, their height in remaining inches (it will be automatically converted to SI). Use with height_ft.",
"label": "Remaining height in inches"
},
"weight": {
"description": "If person was notable for their weight, or if weight is relevant. If used, this should also include the year of the measurement. See documentation of this parameter at Template:Infobox sportsperson for more information.",
"label": "Weight"
},
"weight_kg": {
"description": "If person was notable for their weight, or if weight is relevant, their weight in kilogrammes (it will be automatically converted to Imperial).",
"label": "Weight in kilogrammes"
},
"weight_lb": {
"description": "If person was notable for their weight, or if weight is relevant, their weight in pounds, or their weight in remaining pounds if weight in whole stones is specified (it will be automatically converted to SI).",
"label": "Weight in pounds"
},
"weight_st": {
"description": "If person was notable for their weight, or if weight is relevant, their weight in whole stones (it will be automatically converted to SI).",
"label": "Weight in stones"
},
"television": {
"description": "Television programmes presented by or closely associated with the subject.",
"label": "Television"
},
"title": {
"description": "Multiple uses: Formal title, such as First Lady of Japan for Akie Abe.; Awarded title, such as Mr. Olympia for Arnold Schwarzenegger.; Job title, such as President of Calvin College for Anthony Diekema.; A combination of the above, such as Professor of Mathematics and Fellow of the Royal Society for Bill Parry See also \"awards\" parameter, below, for awarded honors that are not really titles. A single award should not use both parameters.",
"label": "Title"
},
"term": {
"description": "Years the person held the title listed above.",
"label": "Term"
},
"predecessor": {
"description": "Person who previously held the title listed above.",
"label": "Predecessor"
},
"successor": {
"description": "Person who subsequently held the title listed above.",
"label": "Successor"
},
"party": {
"description": "If relevant. Field labelled Political party.",
"label": "Party"
},
"movement": {
"description": "If relevant. '''Movement''' can be social, political (non-party), artistic, philosophical, literary, cultural, etc.",
"label": "Movement"
},
"opponents": {
"description": "Notable relevant opponents (e.g., for major political office).",
"label": "Opponents"
},
"boards": {
"description": "For board of directors membership(s), if relevant. Field labeled Board member of.",
"label": "Boards"
},
"criminal_charge": {
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"label": "Criminal charge",
"aliases": [
"criminal charge"
]
},
"criminal_penalty": {
"label": "Criminal penalty",
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"aliases": [
"criminal penalty"
]
},
"criminal_status": {
"label": "Criminal status",
"description": "For convicted criminals only. Please be certain to support these parameters with citations from reliable sources, in the article body.",
"aliases": [
"judicial_status",
"judicial status",
"criminal status"
]
},
"spouse": {
"description": "Name of spouse(s), followed by years of marriage. Use the format Name (married 1950–present) for a current spouse, and Name (married 1970–99) for former spouse(s). Separate entries using Template:Plainlist or Template:Unbulleted list. For deceased persons still married at time of death, close the date range with death year.",
"label": "Spouse(s)",
"aliases": [
"spouses",
"spouse(s)"
]
},
"partner": {
"description": "For unmarried life partners (of any gender or sexual preference), not business partners. Use the format Name (1950–present) for current partner and Name (1970–99) for former partner(s).",
"label": "Partner(s)",
"aliases": [
"partners",
"partner(s)",
"domestic_partner",
"domestic_partner"
]
},
"children": {
"description": "Number of children (e.g., three or 3), or list of names, in which case, separate entries using Template:Plainlist or Template:Unbulleted list. For privacy reasons, consider omitting the names of children of living persons, unless the children are independently notable.",
"label": "Children"
},
"parents": {
"description": "Names of parents. Separate entries using Template:Plainlist or Template:Unbulleted list. If subject has only one notable mother and/or father, 'mother' and 'father' parameters may be used instead",
"label": "Parent(s)"
},
"mother": {
"description": "Name of mother; include only if subject has one mother who is independently notable or particularly relevant. Overwritten by 'parents' parameter.",
"label": "Mother"
},
"father": {
"description": "Name of father; include only if subject has one father who is independently notable or particularly relevant. Overwritten by 'parents' parameter.",
"label": "Father"
},
"relatives": {
"description": "Names of siblings or other relatives. Include the relationship in parentheses after the name (sister, uncle, etc). Separate entries using Template:Plainlist or Template:Unbulleted list.",
"label": "Relatives",
"aliases": [
"relations"
]
},
"family": {
"description": "Family or house of the individual, if notable.",
"label": "Family"
},
"callsign": {
"description": "Amateur radio call sign, if relevant.",
"label": "Callsign"
},
"awards": {
"description": "Notable awards. If many, link to an appropriate section of the article instead. See also \"title\" parameter, above, for awarded titles. A single award should not use both parameters.",
"label": "Awards"
},
"honours": {
"description": "Honours the individual has been awarded, if notable.",
"label": "Honours",
"aliases": [
"honors"
]
},
"website": {
"description": "Official website only. Unofficial websites should be placed under ==External links== in the body of the article. Use Template:URL as in Example.com . Do not include the www. part unless the server requires it. Use camel case capitalization to make multiword domain names easier to read.",
"label": "Website",
"aliases": [
"homepage",
"URL",
"url"
]
},
"module": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module",
"aliases": [
"misc"
]
},
"module2": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module two",
"aliases": [
"misc2"
]
},
"module3": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module three",
"aliases": [
"misc3"
]
},
"module4": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module four",
"aliases": [
"misc4"
]
},
"module5": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module five",
"aliases": [
"misc5"
]
},
"module6": {
"description": "Used for embedding other infoboxes into this one.",
"label": "Module six",
"aliases": [
"misc6"
]
},
"signature": {
"description": "An image of the person's signature. Please use image name: abc.jpg, xpz.png, 123.gif, etc.",
"label": "Signature"
},
"signature_size": {
"description": "Default is 150px. If necessary, a signature can be resized manually as per the \"image_size\" parameter.",
"label": "Signature size"
},
"signature_alt": {
"description": "Alt text for the signature image. For example, for :File:Thomas Jefferson Signature.svg, the alt text might be |signature_alt= Th: Jefferson, spelling out the signature exactly as it appears in the image.",
"label": "Signature alt",
"aliases": [
"signature alt"
]
},
"footnotes": {
"description": "Notes about any of the infobox data.",
"label": "Footnotes"
},
"abovestyle": {
"description": "DEPRECATED: A CSS style to use for the individual's name, over-riding the community norm. Only use in exception circumstances.",
"label": "DEPRECATED: Name CSS over-ride",
"deprecated": true
},
"child": {
"label": "DEPRECATED: Use as an embedded infobox",
"description": "DEPRECATED: Use this infobox within another one. For experts only.",
"example": "yes",
"deprecated": true
},
"image_upright": {
"label": "Image upright",
"description": "Scales the image thumbnail from its default size by the given factor. Values less than 1 scale the image down (0.9 = 90%) and values greater than 1 scale the image up (1.15 = 115%).",
"example": "1.15",
"default": "1"
},
"burial_place": {
"label": "Burial place",
"description": "Place of burial, alternative to 'Resting place' Displays the label 'Burial place'.",
"type": "content"
},
"burial_coordinates": {
"label": "Burial place coordinates",
"description": "Coordinates for place of burial, to accompany 'Burial place'. Use {{coord}} template."
},
"influences": {
"label": "DEPRECATED: Influences",
"description": "DEPRECATED and unused in the infobox. Do not use.",
"deprecated": "Deprecated. Unused in the infobox. Do not use."
},
"influenced": {
"label": "DEPRECATED: Influenced",
"description": "DEPRECATED and unused in the infobox. Do not use.",
"deprecated": "Deprecated. Unused in the infobox. Do not use."
}
},
"paramOrder": [
"pre-nominals",
"name",
"post-nominals",
"image",
"image_upright",
"image_size",
"alt",
"caption",
"native_name",
"native_name_lang",
"pronunciation",
"birth_name",
"birth_date",
"birth_place",
"baptised",
"disappeared_date",
"disappeared_place",
"disappeared_status",
"death_date",
"death_place",
"death_cause",
"body_discovered",
"resting_place",
"resting_place_coordinates",
"burial_place",
"burial_coordinates",
"monuments",
"residence",
"nationality",
"other_names",
"citizenship",
"education",
"alma_mater",
"occupation",
"years_active",
"era",
"employer",
"organization",
"agent",
"known_for",
"notable_works",
"style",
"home_town",
"salary",
"net_worth",
"height",
"height_m",
"height_cm",
"height_ft",
"height_in",
"weight",
"weight_kg",
"weight_lb",
"weight_st",
"television",
"title",
"term",
"predecessor",
"successor",
"party",
"movement",
"opponents",
"boards",
"criminal_charge",
"criminal_penalty",
"criminal_status",
"spouse",
"partner",
"children",
"parents",
"mother",
"father",
"relatives",
"family",
"callsign",
"awards",
"honours",
"website",
"module",
"module2",
"module3",
"module4",
"module5",
"module6",
"signature",
"signature_size",
"signature_alt",
"footnotes",
"abovestyle",
"child",
"influences",
"influenced"
],
"format": "{{_\n| __________________ = _\n}}\n"
}
</templatedata>
== Tracking categories ==
* {{clc|Pages using infobox person with unknown parameters}}
* {{clc|Infobox person using numbered parameter}}
* {{clc|Infobox person using boxwidth parameter}}
* {{clc|Infobox person using certain parameters when dead}}
* {{clc|Infobox person using influence}}
* {{clc|Infobox person using ethnicity}}
* {{clc|Infobox person using religion}}
* {{clc|Infobox person using denomination}}
* {{clc|Biography template using pronunciation}}
* {{clc|Biography with signature}}
<div style="display: none">{{reflist}}</div>
<includeonly>
{{Basepage subpage|
[[Category:People and person infobox templates| ]]
[[Category:Biographical templates usable as a module|Person]]
[[Category:Infobox templates with module parameter|Person]]
[[Category:Templates that add a tracking category]]
}}
</includeonly>
c032fac57b88f110881f31d83f68b3093b591d98
Template:Infobox person/height
10
253
505
504
2024-06-03T23:46:17Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{infobox person/height/locate|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{{1|}}}<!--
-->|metre|m}}<!--
-->|meter|m}}<!--
-->|centi|c}}<!--
-->|feet|ft}}<!--
-->|foot|ft}}<!--
-->|inches|in}}<!--
-->|inch|in}}<!--
-->|ms|m}}<!--
-->|ins|in}}<!--
-->|pattern=[[in|in]]|replace=[[inch|in]]}}<!--
-->|pattern=[[Centim|cm]]|replace=[[Centimetre|cm]]}}<!--
-->|pattern=[[m]]s|replace=[[Metre|m]]}}<!--
-->|pattern=[[cm]]s|replace=[[Centimetre|cm]]}}<!--
-->}}<noinclude>
{{Documentation}}
</noinclude>
96c47aff4c5093c3ed898b76a20ea036e6bf78df
Template:Infobox person/height/locate
10
254
507
506
2024-06-03T23:46:18Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{infobox person/height/switch
|{{{1|}}}
|{{#invoke:String|replace|{{{1|}}}| | }}
|m={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|m}}
|c={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|cm}}
|f={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|ft}}
|i={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|in}}
}}<noinclude>
{{Documentation}}
</noinclude>
159e634f03c95c6d6d1362ec46f6ed6e00c94478
Template:Infobox person/height/switch
10
255
509
508
2024-06-03T23:46:18Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:0
|{{{m}}}{{{f}}}{{{i}}}={{{1|}}}
|{{{f}}}{{{i}}}={{#ifeq:{{{c}}}|0
|{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}|m|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}}
}}
|{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}|cm|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}}
}}
}}
|{{{m}}}{{{f}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}}
}}
|{{{m}}}{{{i}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}}}
}}
|{{{m}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}+{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}}
}}
|{{{1|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
fbf532398f7569902ed64aac602098329e298bcb
Template:Infobox person/weight
10
256
511
510
2024-06-03T23:46:18Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Infobox person/weight/locate|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{#invoke:String|replace|<!--
-->{{{1|}}}<!--
-->|kilogram|kg}}<!--
-->|stone|st}}<!--
-->|pound|lb}}<!--
-->|kgs|kg}}<!--
-->|lbs|lb}}<!--
-->|sts|st}}<!--
-->|kg-stlb={{#if:{{{kg-stlb|}}}|{{{kg-stlb}}}}}
|lb-stlb={{#if:{{{lb-stlb|}}}|{{{lb-stlb}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
c6b1b9864bd142ea1727458ec0b996da8d6c0faf
Template:Infobox person/weight/locate
10
257
513
512
2024-06-03T23:46:19Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Infobox person/weight/switch
|{{{1|}}}
|{{#invoke:String|replace|{{{1|}}}| | }}
|k={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|kg}}
|s={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|st}}
|l={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}| | }}|lb}}
|kg-stlb={{#if:{{{kg-stlb|}}}|{{{kg-stlb}}}}}
|lb-stlb={{#if:{{{lb-stlb|}}}|{{{lb-stlb}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
1297fd00a0dea602a0c3f3ece3089b58b0a1a9f6
Template:Infobox person/weight/switch
10
258
515
514
2024-06-03T23:46:19Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#switch:0
|{{{k}}}{{{l}}}{{{s}}}={{{1|}}}
|{{{l}}}{{{s}}}={{#iferror:{{#expr:{{#invoke:String|replace|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{k|1}}}-1}}}}|–|-}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{k|1}}}-1}}}}|kg|lb {{#if:{{{kg-stlb|}}}|stlb}}|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{k|1}}}+2}}}}
}}
|{{{k}}}{{{s}}}={{#iferror:{{#expr:{{#invoke:String|replace|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{l|1}}}-1}}}}|–|-}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{l|1}}}-1}}}}|lb|kg {{#if:{{{lb-stlb|}}}|stlb}}|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{l|1}}}+2}}}}
}}
|{{{k}}}{{{l}}}={{#iferror:{{#expr:{{#invoke:String|replace|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}|–|-}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}|st|lb kg|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{s|1}}}+2}}}}
}}
|{{{k}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}+{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{s|1}}}+2}}|{{#expr:{{{l|1}}}-1}}}}}}
|{{{1|}}}
|{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{s|1}}}-1}}}}|st|{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{s|1}}}+2}}|{{#expr:{{{l|1}}}-1}}}}|lb|lb kg|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{l|1}}}+2}}}}
}}
|{{{1|}}}
}}<noinclude>
{{Documentation}}
</noinclude>
6220d0274ccc9f979faa9b0f30c939341941209b
Template:Kbd
10
259
517
516
2024-06-03T23:46:19Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<kbd {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="background:#EEEEEE; {{#if:{{{spacing|}}}| padding-left:{{{padding|0.2em}}}; padding-right:{{{padding|0.2em}}};| letter-spacing:0.05em; padding-left:0.25em; padding-right:0.2em;}}{{#if:{{{style|}}}|{{{style}}}}}" {{#if:{{{lang|}}}|lang="{{{lang}}}" xml:lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</kbd><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
{{En-WP attribution notice|Template:Kbd}}
</noinclude>
e04c98d35a9482b9d56610501070e5ffc18d8b6c
Template:Person infobox header
10
260
519
518
2024-06-03T23:46:20Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ombox|type=content|text=The design and content of biographical infoboxes must follow Wikipedia's [[Wikipedia:Verifiability|verifiability policy]], as well as [[Wikipedia:Manual of Style/Infoboxes|infobox]] and [[Wikipedia:Manual of Style/Biographies|biographical style guideline]].
All content displayed in this template must adhere to the '''[[Wikipedia:Biographies of living persons|biographies of living persons]]''' policy if applicable. [[Wikipedia:Citing sources|Unsourced or poorly sourced]] contentious material '''must be removed immediately''' from the article and its infobox, especially if potentially [[Wikipedia:Libel|libellous]].}}
<noinclude>
{{Documentation}}
</noinclude>
a8734f2e954a6e7191fa292463bb4b7ee3a43e6e
Template:Samp
10
261
521
520
2024-06-03T23:46:20Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<samp {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="padding-left:0.4em; padding-right:0.4em; color:{{#if:{{{color|}}}|{{{color}}}|#666666}};{{#if:{{{style|}}}| {{{style}}}|}}" {{{#if:{{{lang|}}}|lang="{{{lang}}}" xml:lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</samp><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
</noinclude>
553832833b1ab286c2e8f26dce22e83d0ab05e47
Template:Strong
10
262
523
522
2024-06-03T23:46:21Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<strong {{#if:{{{role|}}}|role="{{{role}}}"}} {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</strong><noinclude>
{{documentation}}
<!-- Add cats and interwikis to the /doc subpage, not here! -->
</noinclude>
a6c6d3b520e2018e19376e2f0e1a72801336d1df
Template:Strongbad
10
263
525
524
2024-06-03T23:46:21Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{FormattingError|Template:Strongbad is only for use in template documentation, guidelines and other Wikipedia-internal purposes. Do not use it in actual articles.}}|{{strong|1={{{1}}}|style=color:red;{{#if:{{{style}}}|{{{style}}}}} |role={{{role|}}} |class={{{class|}}} |id={{{id|}}} |title={{{title|}}} }}}}<noinclude>
{{documentation}}
<!-- Add cats and interwikis to the /doc subpage, not here! -->
</noinclude>
a1e194c3f4f1e924d5bef701c76e123c1f9fccd3
Template:Tag
10
264
527
526
2024-06-03T23:46:22Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<code class="{{#ifeq:{{{wrap|}}}|yes|wrap|nowrap}}" style="{{#ifeq:{{{style|}}}|plain|border:none;background:transparent;|{{{style|}}}}}"><!--
Opening tag
-->{{#switch:{{{2|pair}}}
|c|close =
|e|empty|s|single|v|void
|o|open
|p|pair = <{{#if:{{{link|}}}|[[HTML element#{{{1|tag}}}|{{{1|tag}}}]]|{{{1|tag}}}}}{{#if:{{{params|{{{attribs|}}}}}}| {{{params|{{{attribs}}}}}}}}
}}<!--
Content between tags
-->{{#switch:{{{2|pair}}}
|c|close = {{{content|}}}
|e|empty|s|single|v|void =  />
|o|open = >{{{content|}}}
|p|pair = {{#ifeq:{{{1|tag}}}|!--||>}}{{{content|...}}}
}}<!--
Closing tag
-->{{#switch:{{{2|pair}}}
|e|empty|s|single|v|void
|o|open =
|c|close
|p|pair = {{#ifeq:{{{1|tag}}}|!--|-->|</{{{1|tag}}}>}}
}}<!--
--></code><noinclude>
{{Documentation}}
</noinclude>
eae208bc1612c834de697fa3ee9b343966cf8602
Template:UF-hcard-person
10
265
529
528
2024-06-03T23:46:22Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[HCard|hCard microformat]], which makes the person's details [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia or via a browser tool operated by a reader, to (for example) add the subject to an address book or database. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
=== Sub-templates ===
Date-of-birth ("bday") information will only be included in the microformat if {{tl|birth date}}, or {{tl|birth date and age}} are used in the infobox. ([[Wikipedia:WikiProject Microformats/dates|Do not use these if the date is before 1583]]). Be cautious about using these if the person is still living, per [[WP:DOB]].
To include a URL, use {{Tl|URL}}.
'''Please do not remove instances of these sub-templates.'''
=== Classes ===
hCard uses HTML classes including:
{{Flatlist/microformat|
*adr
*agent
*bday
*birthplace
*category
*country-name
*deathdate
*deathplace
*extended-address
*family-name
*fn (required)
*given-name
*honorific-prefix
*honorific-suffix
*label
*locality
*n
*nickname
*note
*org
*role
*url
*vcard
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCards]]}} }}</includeonly><noinclude>
[[Category:Templates generating hCards]]
[[Category:Microformat (uF) message templates]]
</noinclude>
5dafe89ff41872fe4158b3f29f4acddee9a02fa3
Template:Ubl
10
266
531
530
2024-06-03T23:46:22Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Unbulleted list]]
{{R from template shortcut}}
546af378d5563ddf6497dfa858ac7a8c358c8458
Template:Var
10
267
533
532
2024-06-03T23:46:23Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<var {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} style="padding-right: 1px;{{{style|}}}" {{#if:{{{lang|}}}|lang="{{{lang}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</var><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.-->
{{Documentation}}
{{En-WP attribution notice|Template:Var}}
</noinclude>
59afb06cc7004d85cba8a5c3679d028138645bca
Template:Xt
10
268
535
534
2024-06-03T23:46:23Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="example" style="font-family: Georgia, 'DejaVu Serif', serif; color: #006400;" {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1|Example text}}}</span><noinclude>
{{Documentation}}
{{En-WP attribution notice|Template:Xt}}
</noinclude>
b9a6c54de1e9b30d154d31def6b7308ee7d0847f
Module:Anchor
828
269
537
536
2024-06-03T23:46:23Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
-- This module implements {{anchor}}.
local getArgs = require('Module:Arguments').getArgs
local tableTools = require('Module:TableTools')
local p = {}
function p.main(frame)
-- Get the positional arguments from #invoke, remove any nil values,
-- and pass them to p._main.
local args = getArgs(frame)
local argArray = tableTools.compressSparseArray(args)
return p._main(unpack(argArray))
end
function p._main(...)
-- Generate the list of anchors.
local anchors = {...}
local ret = {}
for _, anchor in ipairs(anchors) do
ret[#ret + 1] = '<span id="' .. anchor .. '"></span>'
end
return table.concat(ret)
end
return p
c750635da1a67721f879398480a67eeb25f899b9
Template:Infobox continent/doc
10
270
539
538
2024-06-03T23:46:24Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
=== Usage ===
<syntaxhighlight>
{{Infobox continent
|title =
|image =
|imagecaption =
|area =
|population =
|ethnic_groups =
|demonym =
|states =
|cities =
|footnotes =
}}
</syntaxhighlight>
=== Template data ===
{{TemplateData header}}
<templatedata>
{
"params": {
"title": {
"description": "The name of the article",
"type": "string"
},
"image": {
"description": "An image of the continent",
"type": "wiki-file-name"
},
"area": {
"description": "The total land area of the continent"
},
"population": {
"description": "The total population of the continent"
},
"demonym": {
"description": "A name for a resident of locality derived from the name of the continent",
"type": "string"
},
"states": {
"description": "The total number of states whose capital is located on the continent",
"type": "number"
},
"cities": {
"description": "The most notable and highly populated cities on the continent"
},
"footnotes": {}
},
"description": "A template used to give an overview of a continent."
}
</templatedata>
4e00c9d4bed6ea60a9ef30a8ca5c675bf4c61f8a
Template:Mbox
10
271
541
540
2024-06-03T23:46:24Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#invoke:Message box|mbox}}<noinclude>
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
c262e205f85f774a23f74119179ceea11751d68e
Template:Warning
10
272
543
542
2024-06-03T23:46:25Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Mbox
| name = Warning
| demospace = {{{demospace|}}}
| style = {{#if:{{{style|}}} |{{#if:{{{small|}}}||width:80%;}} {{{style}}} }}
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| type = content
| image = {{#if:{{{image|}}}| [[File:{{{image}}}|{{{imagesize|40px}}}|Warning]] }}
| small = {{{small|}}}
| smallimage = {{#if:{{{image|}}}| [[File:{{{image}}}|30px|Warning]]}}
| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
| textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
| text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
-->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
}}<noinclude>
<!-- Add categories to the /doc subpage; interwikis go to Wikidata. -->
{{Documentation}}
</noinclude>
69aba4841cf88381001597b31ca7596d2d733e58
Module:Transclusion count/data/I
828
273
545
544
2024-06-03T23:46:29Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
return {
["IAST"] = 6700,
["IBDB_name"] = 9200,
["ICD10"] = 4900,
["ICD9"] = 4400,
["ICS"] = 3000,
["IDN"] = 3500,
["IMDb_episode"] = 10000,
["IMDb_episodes"] = 2900,
["IMDb_name"] = 157000,
["IMDb_title"] = 194000,
["IMO_Number"] = 4200,
["IMSLP"] = 8400,
["INA"] = 2200,
["IND"] = 7800,
["INR"] = 6800,
["INRConvert"] = 5900,
["INRConvert/CurrentRate"] = 5800,
["INRConvert/USD"] = 5800,
["INRConvert/out"] = 5800,
["IOBDB_name"] = 2000,
["IP"] = 2700,
["IPA"] = 145000,
["IPA-de"] = 8300,
["IPA-es"] = 7900,
["IPA-fr"] = 44000,
["IPA-it"] = 5900,
["IPA-nl"] = 3900,
["IPA-pl"] = 4100,
["IPA-pt"] = 3300,
["IPA-sl"] = 6900,
["IPA-th"] = 3000,
["IPA_audio_link"] = 3500,
["IPA_link"] = 3900,
["IPAc-cmn"] = 2400,
["IPAc-en"] = 49000,
["IPAc-pl"] = 51000,
["IPC_athlete"] = 3300,
["IPSummary"] = 78000,
["IP_summary"] = 79000,
["IPtalk"] = 18000,
["IPuser"] = 7100,
["IPvandal"] = 2900,
["IRC"] = 7200,
["IRI"] = 2300,
["IRL"] = 5500,
["IRN"] = 3700,
["ISBN"] = 464000,
["ISBN?"] = 2200,
["ISBNT"] = 40000,
["ISBN_missing"] = 2700,
["ISFDB_name"] = 4100,
["ISFDB_title"] = 4600,
["ISL"] = 2200,
["ISO_15924/script-example-character"] = 2800,
["ISO_15924/wp-article"] = 2800,
["ISO_15924/wp-article/format"] = 2800,
["ISO_15924/wp-article/label"] = 2800,
["ISO_3166_code"] = 504000,
["ISO_3166_name"] = 16000,
["ISO_639_name"] = 8400,
["ISP"] = 4700,
["ISR"] = 4900,
["ISSN"] = 12000,
["ISSN_link"] = 31000,
["ISTAT"] = 8100,
["ISU_figure_skater"] = 2500,
["ITA"] = 18000,
["ITF"] = 6400,
["ITF_profile"] = 9100,
["ITIS"] = 4800,
["ITN_talk"] = 11000,
["ITN_talk/date"] = 11000,
["IUCN_banner"] = 15000,
["I_sup"] = 4300,
["Ice_hockey"] = 5400,
["Ice_hockey_stats"] = 19000,
["Icehockeystats"] = 12000,
["Icon"] = 588000,
["If"] = 283000,
["If_all"] = 6600,
["If_between"] = 3800,
["If_both"] = 133000,
["If_empty"] = 3750000,
["If_first_display_both"] = 73000,
["If_in_page"] = 12000,
["If_last_display_both"] = 31000,
["If_preview"] = 59000,
["If_then_show"] = 313000,
["Ifempty"] = 4000,
["Ifeq"] = 17000,
["Iferror_then_show"] = 3300,
["Ifexist_not_redirect"] = 1350000,
["Ifnotempty"] = 15000,
["Ifnumber"] = 39000,
["Ifsubst"] = 470000,
["Ih"] = 7600,
["Ill"] = 132000,
["Illm"] = 6400,
["Image_frame"] = 5200,
["Image_label"] = 4500,
["Image_label_begin"] = 3900,
["Image_label_end"] = 3800,
["Image_label_small"] = 2600,
["Image_needed"] = 4900,
["Image_other"] = 271000,
["Image_requested"] = 170000,
["Image_requested/Category_helper"] = 161000,
["Imbox"] = 925000,
["Imdb_name"] = 5300,
["Imdb_title"] = 3300,
["Import_style"] = 12000,
["Import_style/inputbox.css"] = 11000,
["Importance"] = 15000,
["Importance/colour"] = 30000,
["Importance_mask"] = 10600000,
["Improve_categories"] = 7800,
["Improve_documentation"] = 2800,
["In_class"] = 5600,
["In_lang"] = 363000,
["In_progress"] = 3300,
["In_string"] = 81000,
["In_title"] = 20000,
["Inactive_userpage_blanked"] = 4900,
["Include-USGov"] = 26000,
["Incomplete_list"] = 23000,
["Inconclusive"] = 2100,
["Increase"] = 46000,
["Incumbent_pope"] = 4300,
["Indent"] = 4700,
["IndexFungorum"] = 2200,
["Indian_English"] = 4400,
["Indian_Rupee"] = 11000,
["Indian_railway_code"] = 3200,
["Inflation"] = 22000,
["Inflation-fn"] = 5500,
["Inflation-year"] = 4600,
["Inflation/IN/startyear"] = 5800,
["Inflation/UK"] = 4500,
["Inflation/UK/dataset"] = 4500,
["Inflation/UK/startyear"] = 4500,
["Inflation/US"] = 13000,
["Inflation/US-GDP"] = 2500,
["Inflation/US-GDP/dataset"] = 2500,
["Inflation/US-GDP/startyear"] = 2500,
["Inflation/US/dataset"] = 13000,
["Inflation/US/startyear"] = 13000,
["Inflation/fn"] = 6400,
["Inflation/year"] = 27000,
["Info"] = 7100,
["Infobox"] = 3270000,
["Infobox/Columns"] = 2500,
["Infobox/mobileviewfix.css"] = 148000,
["Infobox3cols"] = 17000,
["Infobox_AFL_biography"] = 14000,
["Infobox_Aircraft_Begin"] = 5200,
["Infobox_Aircraft_Type"] = 4600,
["Infobox_Athletics_Championships"] = 2800,
["Infobox_Australian_place"] = 15000,
["Infobox_CFL_biography"] = 2100,
["Infobox_COA_wide"] = 3300,
["Infobox_Canada_electoral_district"] = 2500,
["Infobox_Canadian_Football_League_biography"] = 5700,
["Infobox_Canadian_Football_League_biography/position"] = 5600,
["Infobox_Chinese"] = 21000,
["Infobox_Chinese/Chinese"] = 2800,
["Infobox_Chinese/Footer"] = 8400,
["Infobox_Chinese/Header"] = 8400,
["Infobox_Chinese/Korean"] = 17000,
["Infobox_Christian_leader"] = 18000,
["Infobox_French_commune"] = 38000,
["Infobox_GAA_player"] = 2600,
["Infobox_Gaelic_games_player"] = 5100,
["Infobox_German_location"] = 13000,
["Infobox_German_place"] = 14000,
["Infobox_Grand_Prix_race_report"] = 2000,
["Infobox_Greece_place"] = 2900,
["Infobox_Greek_Dimos"] = 2900,
["Infobox_Hindu_temple"] = 2600,
["Infobox_Indian_constituency"] = 5200,
["Infobox_Indian_constituency/defaultdata"] = 5200,
["Infobox_Italian_comune"] = 8100,
["Infobox_Korean_name"] = 15000,
["Infobox_Korean_name/categories"] = 15000,
["Infobox_NASCAR_race_report"] = 2300,
["Infobox_NCAA_team_season"] = 17000,
["Infobox_NFL_biography"] = 29000,
["Infobox_NFL_player"] = 7500,
["Infobox_NFL_team_season"] = 3900,
["Infobox_NRHP"] = 73000,
["Infobox_NRHP/conv"] = 18000,
["Infobox_NRHP/locmapin2region"] = 66000,
["Infobox_Officeholder"] = 4500,
["Infobox_Olympic_event"] = 7400,
["Infobox_Olympic_event/games_text"] = 7400,
["Infobox_Pan_American_Games_event"] = 2300,
["Infobox_Paralympic_event"] = 2600,
["Infobox_Paralympic_event/games_text"] = 2600,
["Infobox_Politician"] = 2000,
["Infobox_Romanian_subdivision"] = 3200,
["Infobox_Russian_district"] = 2000,
["Infobox_Russian_inhabited_locality"] = 4500,
["Infobox_SCOTUS_case"] = 3700,
["Infobox_Site_of_Special_Scientific_Interest"] = 2000,
["Infobox_Swiss_town"] = 2800,
["Infobox_Switzerland_municipality"] = 2900,
["Infobox_Turkey_place"] = 19000,
["Infobox_U.S._county"] = 3000,
["Infobox_U.S._county/district"] = 3000,
["Infobox_UK_constituency"] = 2100,
["Infobox_UK_constituency/year"] = 2100,
["Infobox_UK_legislation"] = 3800,
["Infobox_UK_place"] = 26000,
["Infobox_UK_place/NoDialCode"] = 8100,
["Infobox_UK_place/NoPostCode"] = 3300,
["Infobox_UK_place/area"] = 2600,
["Infobox_UK_place/dens"] = 2200,
["Infobox_UK_place/dist"] = 2800,
["Infobox_UK_place/local"] = 26000,
["Infobox_UK_place/styles.css"] = 26000,
["Infobox_UN_resolution"] = 2300,
["Infobox_US_Supreme_Court_case"] = 3900,
["Infobox_US_Supreme_Court_case/courts"] = 3900,
["Infobox_Wikipedia_user"] = 10000,
["Infobox_YouTube_personality"] = 2900,
["Infobox_YouTube_personality/styles.css"] = 2900,
["Infobox_academic"] = 15000,
["Infobox_aircraft_begin"] = 14000,
["Infobox_aircraft_occurrence"] = 2400,
["Infobox_aircraft_type"] = 13000,
["Infobox_airline"] = 4600,
["Infobox_airport"] = 15000,
["Infobox_airport/datatable"] = 15000,
["Infobox_album"] = 163000,
["Infobox_album/color"] = 195000,
["Infobox_album/link"] = 163000,
["Infobox_anatomy"] = 4500,
["Infobox_ancient_site"] = 5600,
["Infobox_animanga/Footer"] = 7000,
["Infobox_animanga/Header"] = 7000,
["Infobox_animanga/Print"] = 5700,
["Infobox_animanga/Video"] = 4800,
["Infobox_architect"] = 3800,
["Infobox_artist"] = 29000,
["Infobox_artist_discography"] = 6000,
["Infobox_artwork"] = 12000,
["Infobox_athlete"] = 2800,
["Infobox_automobile"] = 8500,
["Infobox_award"] = 13000,
["Infobox_badminton_player"] = 3200,
["Infobox_baseball_biography"] = 28000,
["Infobox_baseball_biography/style"] = 28000,
["Infobox_baseball_biography/styles.css"] = 28000,
["Infobox_baseball_team_season"] = 3300,
["Infobox_baseball_team_season/leagueseason"] = 3300,
["Infobox_baseball_team_season/season"] = 3300,
["Infobox_baseball_team_season/styles.css"] = 3300,
["Infobox_basketball_biography"] = 21000,
["Infobox_basketball_biography/style"] = 21000,
["Infobox_basketball_club"] = 3100,
["Infobox_basketball_club/styles.css"] = 3100,
["Infobox_beauty_pageant"] = 2400,
["Infobox_bilateral_relations"] = 4500,
["Infobox_body_of_water"] = 18000,
["Infobox_book"] = 53000,
["Infobox_boxer"] = 5800,
["Infobox_bridge"] = 6100,
["Infobox_building"] = 28000,
["Infobox_character"] = 7600,
["Infobox_chess_biography"] = 4100,
["Infobox_chess_player"] = 3400,
["Infobox_church"] = 15000,
["Infobox_church/denomination"] = 15000,
["Infobox_church/font_color"] = 15000,
["Infobox_civil_conflict"] = 2500,
["Infobox_civilian_attack"] = 5900,
["Infobox_college_coach"] = 12000,
["Infobox_college_football_game"] = 2100,
["Infobox_college_football_player"] = 2400,
["Infobox_college_sports_team_season"] = 41000,
["Infobox_college_sports_team_season/link"] = 41000,
["Infobox_college_sports_team_season/name"] = 41000,
["Infobox_college_sports_team_season/succession"] = 41000,
["Infobox_college_sports_team_season/team"] = 41000,
["Infobox_comic_book_title"] = 3100,
["Infobox_comics_character"] = 3600,
["Infobox_comics_creator"] = 3500,
["Infobox_comics_creator/styles.css"] = 3500,
["Infobox_company"] = 84000,
["Infobox_computing_device"] = 2400,
["Infobox_concert"] = 3400,
["Infobox_constituency"] = 5700,
["Infobox_country"] = 6600,
["Infobox_country/formernext"] = 6200,
["Infobox_country/imagetable"] = 5400,
["Infobox_country/multirow"] = 8500,
["Infobox_country/status_text"] = 2800,
["Infobox_country/styles.css"] = 6600,
["Infobox_country_at_games"] = 16000,
["Infobox_country_at_games/core"] = 16000,
["Infobox_country_at_games/see_also"] = 12000,
["Infobox_court_case"] = 4800,
["Infobox_court_case/images"] = 2600,
["Infobox_cricket_tournament"] = 2400,
["Infobox_cricketer"] = 32000,
["Infobox_cricketer/career"] = 32000,
["Infobox_cricketer/national_side"] = 7600,
["Infobox_criminal"] = 6600,
["Infobox_curler"] = 2700,
["Infobox_cycling_race_report"] = 4600,
["Infobox_cyclist"] = 16000,
["Infobox_dam"] = 5700,
["Infobox_deity"] = 2100,
["Infobox_deity/color"] = 2000,
["Infobox_designation_list"] = 20000,
["Infobox_designation_list/entry"] = 18000,
["Infobox_dim"] = 7000,
["Infobox_dim/core"] = 7000,
["Infobox_diocese"] = 3900,
["Infobox_drug"] = 10000,
["Infobox_drug/chemical_formula"] = 10000,
["Infobox_drug/data_page_link"] = 10000,
["Infobox_drug/formatATC"] = 10000,
["Infobox_drug/formatCASnumber"] = 10000,
["Infobox_drug/formatChEBI"] = 10000,
["Infobox_drug/formatChEMBL"] = 10000,
["Infobox_drug/formatChemDBNIAID"] = 10000,
["Infobox_drug/formatChemSpider"] = 10000,
["Infobox_drug/formatCompTox"] = 10000,
["Infobox_drug/formatDrugBank"] = 10000,
["Infobox_drug/formatIUPHARBPS"] = 10000,
["Infobox_drug/formatJmol"] = 10000,
["Infobox_drug/formatKEGG"] = 10000,
["Infobox_drug/formatPDBligand"] = 9600,
["Infobox_drug/formatPubChemCID"] = 10000,
["Infobox_drug/formatPubChemSID"] = 10000,
["Infobox_drug/formatUNII"] = 10000,
["Infobox_drug/legal_status"] = 11000,
["Infobox_drug/licence"] = 10000,
["Infobox_drug/maintenance_categories"] = 10000,
["Infobox_drug/non-ref-space"] = 4600,
["Infobox_drug/pregnancy_category"] = 10000,
["Infobox_drug/title"] = 10000,
["Infobox_election"] = 31000,
["Infobox_election/row"] = 31000,
["Infobox_election/shortname"] = 29000,
["Infobox_enzyme"] = 5100,
["Infobox_ethnic_group"] = 7400,
["Infobox_event"] = 5800,
["Infobox_family"] = 2200,
["Infobox_figure_skater"] = 4200,
["Infobox_film"] = 160000,
["Infobox_film/short_description"] = 156000,
["Infobox_film_awards"] = 2700,
["Infobox_film_awards/link"] = 2700,
["Infobox_film_awards/style"] = 2700,
["Infobox_food"] = 7000,
["Infobox_football_biography"] = 209000,
["Infobox_football_club"] = 28000,
["Infobox_football_club_season"] = 21000,
["Infobox_football_league"] = 2600,
["Infobox_football_league_season"] = 20000,
["Infobox_football_match"] = 6000,
["Infobox_football_tournament_season"] = 8200,
["Infobox_former_subdivision"] = 3500,
["Infobox_former_subdivision/styles.css"] = 3500,
["Infobox_galaxy"] = 2100,
["Infobox_game"] = 2600,
["Infobox_game_score"] = 3600,
["Infobox_gene"] = 13000,
["Infobox_given_name"] = 4100,
["Infobox_golfer"] = 4500,
["Infobox_golfer/highest_ranking"] = 4500,
["Infobox_government_agency"] = 11000,
["Infobox_government_cabinet"] = 2800,
["Infobox_gridiron_football_person"] = 2300,
["Infobox_gridiron_football_person/position"] = 5600,
["Infobox_gymnast"] = 3600,
["Infobox_handball_biography"] = 5000,
["Infobox_historic_site"] = 12000,
["Infobox_horseraces"] = 2600,
["Infobox_hospital"] = 6400,
["Infobox_hospital/care_system"] = 6400,
["Infobox_hospital/lists"] = 6400,
["Infobox_ice_hockey_biography"] = 20000,
["Infobox_ice_hockey_player"] = 19000,
["Infobox_ice_hockey_team"] = 3100,
["Infobox_ice_hockey_team_season"] = 2000,
["Infobox_international_football_competition"] = 5900,
["Infobox_islands"] = 9000,
["Infobox_islands/area"] = 9400,
["Infobox_islands/density"] = 9400,
["Infobox_islands/length"] = 9000,
["Infobox_islands/styles.css"] = 9000,
["Infobox_journal"] = 9800,
["Infobox_journal/Abbreviation_search"] = 9600,
["Infobox_journal/Bluebook_check"] = 9500,
["Infobox_journal/Former_check"] = 9500,
["Infobox_journal/ISO_4_check"] = 9500,
["Infobox_journal/ISSN-eISSN"] = 9500,
["Infobox_journal/Indexing_search"] = 9600,
["Infobox_journal/MathSciNet_check"] = 9500,
["Infobox_journal/NLM_check"] = 9500,
["Infobox_journal/frequency"] = 8700,
["Infobox_lake"] = 4200,
["Infobox_language"] = 9600,
["Infobox_language/family-color"] = 11000,
["Infobox_language/genetic"] = 6600,
["Infobox_language/linguistlist"] = 9600,
["Infobox_language/ref"] = 7100,
["Infobox_law_enforcement_agency"] = 2000,
["Infobox_legislation"] = 2100,
["Infobox_legislature"] = 3800,
["Infobox_library"] = 2200,
["Infobox_lighthouse"] = 2600,
["Infobox_lighthouse/light"] = 2600,
["Infobox_locomotive"] = 5000,
["Infobox_magazine"] = 7700,
["Infobox_manner_of_address"] = 3400,
["Infobox_mapframe"] = 83000,
["Infobox_martial_artist"] = 5700,
["Infobox_martial_artist/record"] = 5700,
["Infobox_medal_templates"] = 427000,
["Infobox_medical_condition"] = 10000,
["Infobox_medical_condition_(new)"] = 8100,
["Infobox_medical_details"] = 2100,
["Infobox_medical_person"] = 2000,
["Infobox_military_conflict"] = 23000,
["Infobox_military_installation"] = 9900,
["Infobox_military_person"] = 46000,
["Infobox_military_unit"] = 26000,
["Infobox_mine"] = 2200,
["Infobox_model"] = 2300,
["Infobox_monument"] = 2100,
["Infobox_mountain"] = 28000,
["Infobox_multi-sport_competition_event"] = 2400,
["Infobox_museum"] = 11000,
["Infobox_musical_artist"] = 123000,
["Infobox_musical_artist/color"] = 123000,
["Infobox_musical_artist/hCard_class"] = 320000,
["Infobox_musical_composition"] = 3000,
["Infobox_name"] = 7600,
["Infobox_name_module"] = 7400,
["Infobox_newspaper"] = 9900,
["Infobox_nobility"] = 2300,
["Infobox_noble"] = 7400,
["Infobox_officeholder"] = 229000,
["Infobox_officeholder/office"] = 235000,
["Infobox_official_post"] = 8300,
["Infobox_organization"] = 37000,
["Infobox_pageant_titleholder"] = 3000,
["Infobox_park"] = 7800,
["Infobox_person"] = 493000,
["Infobox_person/Wikidata"] = 4600,
["Infobox_person/height"] = 105000,
["Infobox_person/length"] = 7100,
["Infobox_person/weight"] = 68000,
["Infobox_philosopher"] = 3500,
["Infobox_planet"] = 4700,
["Infobox_play"] = 4200,
["Infobox_political_party"] = 14000,
["Infobox_power_station"] = 3100,
["Infobox_prepared_food"] = 2900,
["Infobox_professional_wrestler"] = 4400,
["Infobox_professional_wrestling_event"] = 2800,
["Infobox_protected_area"] = 14000,
["Infobox_protein_family"] = 2100,
["Infobox_publisher"] = 2400,
["Infobox_racehorse"] = 5600,
["Infobox_racing_driver"] = 4300,
["Infobox_racing_driver_series_section"] = 2400,
["Infobox_radio_show"] = 2100,
["Infobox_radio_station"] = 22000,
["Infobox_rail"] = 3000,
["Infobox_rail_line"] = 7400,
["Infobox_rail_service"] = 3000,
["Infobox_rail_service/doc"] = 3000,
["Infobox_reality_competition_season"] = 3700,
["Infobox_record_label"] = 4000,
["Infobox_recurring_event"] = 6600,
["Infobox_religious_biography"] = 5500,
["Infobox_religious_building"] = 13000,
["Infobox_religious_building/color"] = 18000,
["Infobox_restaurant"] = 3200,
["Infobox_river"] = 30000,
["Infobox_river/calcunit"] = 30000,
["Infobox_river/discharge"] = 30000,
["Infobox_river/row-style"] = 30000,
["Infobox_river/source"] = 30000,
["Infobox_road"] = 24000,
["Infobox_road/meta/mask/category"] = 24000,
["Infobox_road/meta/mask/country"] = 24000,
["Infobox_road/styles.css"] = 25000,
["Infobox_road_small"] = 2400,
["Infobox_rockunit"] = 6400,
["Infobox_royalty"] = 22000,
["Infobox_royalty/short_description"] = 12000,
["Infobox_rugby_biography"] = 17000,
["Infobox_rugby_biography/correct_date"] = 17000,
["Infobox_rugby_biography/depcheck"] = 16000,
["Infobox_rugby_league_biography"] = 10000,
["Infobox_rugby_league_biography/PLAYER"] = 9900,
["Infobox_rugby_team"] = 2600,
["Infobox_sailboat_specifications"] = 2300,
["Infobox_saint"] = 5100,
["Infobox_school"] = 38000,
["Infobox_school/short_description"] = 38000,
["Infobox_school_district"] = 5700,
["Infobox_school_district/styles.css"] = 5700,
["Infobox_scientist"] = 49000,
["Infobox_service_record"] = 2600,
["Infobox_settlement"] = 565000,
["Infobox_settlement/areadisp"] = 241000,
["Infobox_settlement/columns"] = 96000,
["Infobox_settlement/columns/styles.css"] = 96000,
["Infobox_settlement/densdisp"] = 441000,
["Infobox_settlement/impus"] = 83000,
["Infobox_settlement/lengthdisp"] = 170000,
["Infobox_settlement/link"] = 96000,
["Infobox_settlement/metric"] = 213000,
["Infobox_settlement/pref"] = 296000,
["Infobox_settlement/styles.css"] = 565000,
["Infobox_ship_begin"] = 41000,
["Infobox_ship_career"] = 37000,
["Infobox_ship_characteristics"] = 41000,
["Infobox_ship_class_overview"] = 4100,
["Infobox_ship_image"] = 40000,
["Infobox_shopping_mall"] = 3500,
["Infobox_short_story"] = 2400,
["Infobox_skier"] = 2600,
["Infobox_soap_character"] = 2900,
["Infobox_software"] = 14000,
["Infobox_software/simple"] = 14000,
["Infobox_song"] = 77000,
["Infobox_song/color"] = 77000,
["Infobox_song/link"] = 77000,
["Infobox_spaceflight"] = 3600,
["Infobox_spaceflight/styles.css"] = 3600,
["Infobox_sport_event"] = 2200,
["Infobox_sports_competition_event"] = 18000,
["Infobox_sports_competition_event/medalrow"] = 12000,
["Infobox_sports_league"] = 5100,
["Infobox_sports_season"] = 5600,
["Infobox_sports_team"] = 2300,
["Infobox_sportsperson"] = 109000,
["Infobox_stadium"] = 3200,
["Infobox_station"] = 55000,
["Infobox_station/doc"] = 55000,
["Infobox_station/services"] = 55000,
["Infobox_station/styles.css"] = 55000,
["Infobox_street"] = 3600,
["Infobox_swimmer"] = 10000,
["Infobox_television"] = 58000,
["Infobox_television/Short_description"] = 56000,
["Infobox_television_channel"] = 6300,
["Infobox_television_episode"] = 12000,
["Infobox_television_episode/styles.css"] = 12000,
["Infobox_television_season"] = 9800,
["Infobox_television_station"] = 3400,
["Infobox_tennis_biography"] = 11000,
["Infobox_tennis_event"] = 2700,
["Infobox_tennis_tournament_event"] = 19000,
["Infobox_tennis_tournament_year"] = 9500,
["Infobox_tennis_tournament_year/color"] = 29000,
["Infobox_tennis_tournament_year/footer"] = 29000,
["Infobox_tournament_season"] = 11000,
["Infobox_train"] = 2300,
["Infobox_university"] = 26000,
["Infobox_user"] = 2700,
["Infobox_venue"] = 18000,
["Infobox_video_game"] = 28000,
["Infobox_video_game/styles.css"] = 28000,
["Infobox_volleyball_biography"] = 5600,
["Infobox_weapon"] = 7400,
["Infobox_weather_event"] = 2100,
["Infobox_weather_event/Effects"] = 2100,
["Infobox_weather_event/Footer"] = 2100,
["Infobox_weather_event/History"] = 2000,
["Infobox_weather_event/meteorology"] = 2000,
["Infobox_weather_event/styles.css"] = 2100,
["Infobox_website"] = 7700,
["Infobox_writer"] = 40000,
["Information"] = 97000,
["Information/styles.css"] = 97000,
["Inline"] = 2100,
["Inline_block"] = 4800,
["Inprogress"] = 2500,
["Input_link"] = 32000,
["Instagram"] = 12000,
["Interlanguage_link"] = 170000,
["Interlanguage_link_multi"] = 17000,
["Internet_Archive_author"] = 19000,
["Internet_Archive_film"] = 2600,
["Intitle"] = 13000,
["Iptalk"] = 17000,
["IranCensus2006"] = 45000,
["IranNCSGN"] = 3200,
["Iran_Census_2006"] = 45000,
["Irc"] = 2100,
["Irish_place_name"] = 2700,
["IsIPAddress"] = 37000,
["IsValidPageName"] = 2700,
["Is_MLB_league"] = 3200,
["Is_NPB_league"] = 3300,
["Is_country_in_Central_America"] = 13000,
["Is_country_in_the_Caribbean"] = 14000,
["Is_interwiki_link"] = 6000,
["Is_italic_taxon"] = 510000,
["Is_redirect"] = 28000,
["Isbn"] = 8300,
["Isfdb_name"] = 3400,
["Isfdb_title"] = 4300,
["Isnum"] = 2000,
["Isnumeric"] = 145000,
["Iso2continent"] = 37000,
["Iso2country"] = 24000,
["Iso2country/article"] = 23000,
["Iso2country/data"] = 24000,
["Iso2nationality"] = 207000,
["Issubst"] = 71000,
["Isu_name"] = 2200,
["Italic_dab2"] = 5300,
["Italic_title"] = 271000,
["Italic_title_prefixed"] = 8700,
["Italics_colon"] = 3900,
["Italictitle"] = 3800,
["Ivm"] = 5700,
["Ivm/styles.css"] = 5700,
["Ivmbox"] = 125000,
["Ivory_messagebox"] = 148000,
["Module:I18n/complex_date"] = 68000,
["Module:IP"] = 133000,
["Module:IPA"] = 145000,
["Module:IPA/data"] = 131000,
["Module:IPA/styles.css"] = 117000,
["Module:IPA_symbol"] = 5200,
["Module:IPA_symbol/data"] = 5300,
["Module:IPAc-en"] = 49000,
["Module:IPAc-en/data"] = 49000,
["Module:IPAc-en/phonemes"] = 49000,
["Module:IPAc-en/pronunciation"] = 49000,
["Module:IPAddress"] = 189000,
["Module:ISO_3166"] = 1030000,
["Module:ISO_3166/data/AT"] = 2500,
["Module:ISO_3166/data/BA"] = 3400,
["Module:ISO_3166/data/CA"] = 2600,
["Module:ISO_3166/data/CN"] = 2200,
["Module:ISO_3166/data/DE"] = 15000,
["Module:ISO_3166/data/ES"] = 3700,
["Module:ISO_3166/data/FR"] = 38000,
["Module:ISO_3166/data/GB"] = 6400,
["Module:ISO_3166/data/GR"] = 3100,
["Module:ISO_3166/data/IN"] = 29000,
["Module:ISO_3166/data/IR"] = 9900,
["Module:ISO_3166/data/National"] = 1030000,
["Module:ISO_3166/data/PL"] = 7500,
["Module:ISO_3166/data/RS"] = 3200,
["Module:ISO_3166/data/RU"] = 25000,
["Module:ISO_3166/data/US"] = 85000,
["Module:ISO_639_name"] = 20000,
["Module:ISOdate"] = 68000,
["Module:Icon"] = 594000,
["Module:Icon/data"] = 594000,
["Module:If_any_equal"] = 2800,
["Module:If_empty"] = 3770000,
["Module:If_in_page"] = 12000,
["Module:If_preview"] = 303000,
["Module:If_preview/configuration"] = 303000,
["Module:If_preview/styles.css"] = 303000,
["Module:Import_style"] = 12000,
["Module:In_lang"] = 363000,
["Module:Indent"] = 4700,
["Module:Infobox"] = 4190000,
["Module:Infobox/dates"] = 70000,
["Module:Infobox/styles.css"] = 4450000,
["Module:Infobox3cols"] = 302000,
["Module:InfoboxImage"] = 4520000,
["Module:Infobox_body_of_water_tracking"] = 18000,
["Module:Infobox_cyclist_tracking"] = 16000,
["Module:Infobox_gene"] = 13000,
["Module:Infobox_mapframe"] = 422000,
["Module:Infobox_military_conflict"] = 23000,
["Module:Infobox_military_conflict/styles.css"] = 23000,
["Module:Infobox_multi-lingual_name"] = 21000,
["Module:Infobox_multi-lingual_name/data"] = 21000,
["Module:Infobox_power_station"] = 3100,
["Module:Infobox_road"] = 26000,
["Module:Infobox_road/browselinks"] = 25000,
["Module:Infobox_road/errors"] = 24000,
["Module:Infobox_road/length"] = 25000,
["Module:Infobox_road/locations"] = 24000,
["Module:Infobox_road/map"] = 25000,
["Module:Infobox_road/route"] = 26000,
["Module:Infobox_road/sections"] = 24000,
["Module:Infobox_television"] = 58000,
["Module:Infobox_television_disambiguation_check"] = 65000,
["Module:Infobox_television_episode"] = 12000,
["Module:Infobox_television_season_disambiguation_check"] = 9300,
["Module:Infobox_television_season_name"] = 9800,
["Module:Internet_Archive"] = 19000,
["Module:IrelandByCountyCatNav"] = 3400,
["Module:Is_article"] = 2000,
["Module:Is_infobox_in_lead"] = 380000,
["Module:Is_instance"] = 329000,
["Module:Italic_title"] = 1140000,
["Module:Italic_title2"] = 5300,
}
3da13f86a7ccd60f530629ea56764dbf3fc10efa
Template:Abbr
10
274
547
546
2024-06-03T23:46:31Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<abbr {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{style|}}}|style="{{{style}}}"}} title="{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|"|"}}}}">{{{1|}}}</abbr><noinclude>{{Documentation}}
</noinclude>
5fd53aa19ba927ce3eea9092a4fa31f881df0a6e
Template:Big
10
275
549
548
2024-06-03T23:46:32Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="font-size: 120%;">{{{1}}}</span><noinclude>
{{Documentation}}
<!-- Please add categories to the /doc subpage; interwikis go to Wikidata, thank you. -->
</noinclude>
921a29fc5d6c9a23b246400fe247ba4f2e0f2aaf
Template:Blue
10
276
551
550
2024-06-03T23:46:32Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span style="color:blue">{{{1}}}</span><noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}</noinclude>
89f3353953a76d63c4ba5cd23af400b64ef178f4
Template:Campaign/doc
10
277
553
552
2024-06-03T23:46:33Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Campaignbox/doc]]
96204735bd25c964b25be72f9fe56c67b3302279
Template:Campaignbox
10
278
555
554
2024-06-03T23:46:33Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{Military navigation
|name = {{#if:{{{raw_name|}}} |{{{raw_name|}}} |{{#if:{{{title|}}} |{{{name|}}} |}} }}
|state = {{{state|}}}
|border = {{{border|}}}
|title = <span style="line-height:1.6em">{{#if:{{{title|}}}|{{{title}}}|{{{name}}}}}</span>
|bodyclass = {{{bodyclass|}}}
|listclass = {{{listclass|}}}
|list1 = {{{battles|}}}
|below = {{{notes|}}}
}}{{#ifeq:{{NAMESPACE}}|Template|[[Category:Campaignbox templates]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
bd5acf07aa1526d63d10975ff20fe9d70de2f838
Template:Campaignbox/doc
10
279
557
556
2024-06-03T23:46:33Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes |
| {{Documentation subpage}}
== Usage ==
}}
{{#switch:{{ARTICLESPACE}}
| Wikipedia =
====Campaignboxes====
| #default =
===Campaignboxes===
}}
One common type of navigational template in articles concerning conflicts, wars and related topics is the '''campaignbox''' template, intended to provide context and convenient navigation among articles on the [[battles]] in a [[Military campaign|campaign]], [[Front (military)|front]], [[Theater (warfare)|theater]] or [[war]] (or, more rarely, among several campaigns or wars).
<div style="float:right;width:26.7em;margin-bottom:1.0em;">
{{Campaignbox Second Punic War}}
{{Campaignbox Punic Wars}}
</div>
If the article includes an [[Help:Infobox|infobox]], the campaignbox/es are usually placed immediately after it (i.e. just below it). If available, as with infoboxes such as {{tl|Infobox military conflict}}, use the infobox's {{para|campaignbox}} parameter:
<div style="width:25.0em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<pre>
{{Infobox military conflict
...
}}
{{Campaignbox XXXX}}
</pre>or<pre>
{{Infobox military conflict
...
| campaignbox = {{campaignbox XXXX}}
}}
</pre></div>
Articles may include multiple campaignboxes; typically, these are stacked under the infobox. The most common scenario occurs when two levels of campaignboxes are present – for example, an article about a battle can include both a campaignbox listing the battle itself and an "enclosing" campaignbox listing the campaign, theater or war during which the battle took place. Similarly, an article about a war can include both a campaignbox listing the war (among a series of wars) and a campaignbox for the war itself, listing the battles that took place during it.
=== Creating campaignboxes ===
Existing campaignboxes may be viewed through the [[:Category:Campaignbox templates|Campaignbox template category]] to which campaignboxes are added automatically. If a new campaignbox becomes necessary, it should be named ''Template:Campaignbox XXXX'' (where XXXX is the (shortened) name of the campaign) and should use {{tlf|Campaignbox}} thus:
<div style="width:16.7em;border:1px solid black;background:#ddd;padding:0.5em 1.0em;">
<pre>
{{Campaignbox
| name =
| title =
| battles =
| notes =
}}
</pre>
</div>
==== Parameters ====
; ''name'' : The name by which Wikipedia refers to the template, i.e. "Template:Campaignbox XXXX". This can be produced by using <code><nowiki>{{subst:PAGENAME}}</nowiki></code>.
; ''title'' : The name of the campaign or war, which, if an article about the campaign or war exists, should link to it. Dates should not be indicated unless needed for clarity. Note that long links may cause alignment problems; see [[WP:MILMOS#NAVPROBLEMS|the troubleshooting guide]] for more information.
; ''battles'' : A chronological list of battles and operations in the campaign, linked as <code><nowiki>[[Battle of YYYY|YYYY]]</nowiki></code>. A convenient and accessible way to separate the items in the list is to add <code>| listclass = hlist</code> and then use the standard <kbd>*</kbd> (asterisk)-based [[Help:List|listing format]].
; ''notes'' : (optional) Any explanatory notes needed to clarify the list. This option should be used sparingly.
; (''raw_name'') : (optional; deprecated) This parameter overrides the use of the title in determining the template name and exists for the sake of backward compatibility. When creating a new campaignbox, both title and name should be specified as above and this parameter omitted.
The following optional parameters are passed on to the templates {{tl|Military navigation}} or {{tl|Navbox}} used to create campaignboxes and so can affect their styling. See these two templates' documentation pages for further details.
; ''state'' : To set whether the campaignbox appears fully visible or collapsed (to titlebar only) when it is first presented by a page.
; ''bodyclass'' : CSS styling to affect the whole template.
; ''listclass'' : CSS styling to affect the list of battles, operations, etc. (e.g. to affect {{para|battles}}).
The use of special formatting (such as bolding or changes in font size) in the list of battles{{spaced ndash}}particularly to mark battles as "important"{{spaced ndash}}is generally discouraged; while there are a ''few'' cases where such approaches may be both helpful to the reader and sufficiently well-sourced that they do not constitute original research, they are usually both unnecessary and potentially confusing. Similarly, dividing the list of battles into multiple blocks by inserting heading-like separations should be exceptional; if such a division is felt to be needed, a better solution may be to split the one campaignbox into two or more.<noinclude>
[[Category:WikiProject Military history template instructions|Campaignbox]]
</noinclude><includeonly>{{Sandbox other||
[[Category:Campaignbox templates| ]]
[[Category:Exclude in print]]
{{#ifeq:{{{noheader|}}}|yes | |
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes|Campaignbox]]
[[Category:Templates that add a category]]
}}}}</includeonly>
4e121140866d6bb53b2bff8342df0cb90c170bd6
Template:Campaignbox Punic Wars
10
280
559
558
2024-06-03T23:46:34Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Punic Wars
| title = [[Punic Wars]]
| listclass = hlist
| battles =
* [[First Punic War|First]]
* [[Mercenary War|Mercenary]]
* [[Second Punic War|Second]]
* [[Third Punic War|Third]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Punic wars]]
</noinclude>
68f988c5de0f66decd657e0721bfd60f1b4c7798
Template:Campaignbox Second Punic War
10
281
561
560
2024-06-03T23:46:34Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Campaignbox
| name = Campaignbox Second Punic War
| title = [[Second Punic War|{{Wrap|Second Punic War}}]]
| listclass = hlist
| battles =
; Prelude
* [[Siege of Saguntum|Saguntum]]
* [[Battle of Rhone Crossing|Rhone]]
* [[Hannibal's crossing of the Alps|Crossing of the Alps]]
; Italy
* [[Battle of Ticinus|Ticinus]]
* [[Battle of the Trebia|Trebia]]
* [[Siege of Mutina (218 BC)|Mutina]]
* [[Battle of Placentia (217 BC)|Placentia]]
* [[Battle of Victumulae|Victumulae]]
* [[Battle of Lake Trasimene|Lake Trasimene]]
* [[Battle of Umbrian Lake|Umbrian Lake]]
* [[Hannibal's crossing of the Apennines|Crossing of the Apennines]]
* [[Battle of Ager Falernus|Ager Falernus]]
* [[Battle of Geronium|Geronium]]
* [[Battle of Cannae|Cannae]]
* [[Battle of Silva Litana|Silva Litana]]
* [[Battle of Nola (216 BC)|1st Nola]]
* [[Siege of Nuceria Alfaterna|Nuceria Alfaterna]]
* [[Siege of Casilinum (216–215 BC)|1st Casilinum]]
* [[Battle of Hamae|Hamae]]
* [[Siege of Petelia|1st Petelia]]
* [[Battle of Cumae (215 BC)|Cumae]]
* [[Battle of Nola (215 BC)|2nd Nola]]
* [[Battle of Beneventum (214 BC)|1st Beneventum]]
* [[Battle of Nola (214 BC)|3rd Nola]]
* [[Siege of Casilinum (214 BC)|2nd Casilinum]]
* [[Battle of Lucania|Lucania]]
* [[Siege of Arpi|Arpi]]
* [[Battle of Tarentum (212 BC)|1st Tarentum]]
* [[Battle of Beneventum (212 BC)|2nd Beneventum]]
* [[Battle of Campi Veteres|Campi Veteres]]
* [[Battle of Capua|1st Capua]]
* [[Battle of the Silarus|Silarus]]
* [[Battle of Herdonia (212 BC)|1st Herdonia]]
* [[Siege of Capua (211 BC)|2nd Capua]]
* [[Hannibal's raid to Rome|Rome]]
* [[Battle of Sapriportis|Sapriportis]]
* [[Battle of Herdonia (210 BC)|2nd Herdonia]]
* [[Battle of Numistro|Numistro]]
* [[Battle of Canusium|Canusium]]
* [[Siege of Manduria|Manduria]]
* [[Siege of Caulonia|Caulonia]]
* [[Battle of Tarentum (209 BC)|2nd Tarentum]]
* [[Battle of Locri (208 BC)|Locri]]
* [[Battle of Petelia|2nd Petelia]]
* [[Battle of Venusia|Venusia]]
* [[Battle of Grumentum|Grumentum]]
* [[Battle of the Metaurus|Metaurus]]
* [[Battle of Crotona|Crotona]]
* [[Battle of Insubria|Insubria]]
; Iberia
* [[Battle of Cissa|Cissa]]
* [[Battle of Ebro River|Ebro River]]
* [[Battle of Ibera|Ibera]]
* [[Siege of Illiturgis|Illiturgis]]
* [[Battle of Munda (214 BC)|Munda]]
* [[Battle of Orongi|Orongi]]
* [[Battle of the Upper Baetis|Upper Baetis]]
* [[Battle of Cartagena (209 BC)|1st New Carthage]]
* [[Battle of Baria|Baria]]
* [[Battle of Baecula|Baecula]]
* [[Battle of Carmona|Carmona]]
* [[Battle of Ilipa|Ilipa]]
* [[Mutiny at Sucro|Sucro]]
* [[Battle of Carteia|1st Carteia]]
* [[Battle of Carteia (naval)|2nd Carteia]]
* [[Battle of Cartagena (206 BC)|2nd New Carthage]]
; Sicily and Sardinia
* [[Battle of Lilybaeum|Lilybaeum]]
* [[Capture of Malta (218 BC)|Malta]]
* [[Battle of Decimomannu|Decimomannu]]
* [[Battle of Leontini|Leontini]]
* [[Siege of Syracuse (213–212 BC)|Syracuse]]
* [[Battle of Himera (211 BC)|Himera]]
* [[Siege of Agrigentum (210 BC)|Agrigentum]]
; North Africa
* [[Battle of Clupea|Clupea]]
* [[Siege of Utica (204 BC)|1st Utica]]
* [[Battle of Utica (203 BC)|2nd Utica]]
* [[Battle of the Great Plains|Great Plains (Bagradas)]]
* [[Battle of Cirta|Cirta]]
* [[Battle of Zama|Zama]]
}}<noinclude>
[[Category:Punic Wars navigational boxes|Second Punic War]]
[[Category:Ancient Rome campaignbox templates|Campaign]]
</noinclude>
da197d04be3bb328fd8ec7bd3e37e2254141a9b3
Template:Convert to use Infobox
10
282
563
562
2024-06-03T23:46:34Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Ombox
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| small = {{{small|}}}
| type = style
| image = [[File:Template-info.png|45px|]]
| text = This template may be suitable for conversion to use {{Tl|Infobox}} as a base.
}}<includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:10}}|{{When on basepage|[[Category:Templates suitable for conversion to use Template:Infobox]]}}}}</includeonly><noinclude>
{{documentation}}</noinclude>
f990edfd50e312fc7c407de1328dd09c0b1fe41b
Template:Country data Electorate of Saxony
10
283
565
564
2024-06-03T23:46:35Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Electorate of Saxony
| shortname alias = Saxony
| flag alias = Flag of Electoral Saxony.svg
| size = {{{size|}}}
| name = {{{name|}}}
<noinclude>
| related1 = Kingdom of Saxony
| related2 = Saxony
| cat = Saxony electorate
</noinclude>
}}
92d992249b05224909f6fc125f5b07f9889af451
Template:Country data Holy Roman Empire
10
284
567
566
2024-06-03T23:46:35Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{ {{{1<noinclude>|country showdata</noinclude>}}}
| alias = Holy Roman Empire
| flag alias = Banner of the Holy Roman Emperor (after 1400).svg
| flag alias-1200 = Flag of the Holy Roman Empire (1200-1350).svg
| flag alias-old = Heiliges Römisches Reich - Reichssturmfahne vor 1433.svg
| size = {{{size|}}}
| name = {{{name|}}}
| variant = {{{variant|}}}
<noinclude>
| var1 = 1200
| var2 = old
</noinclude>
}}
c24cc53598b544658ee4420e6aa0370eca6c4d78
Template:DOW
10
285
569
568
2024-06-03T23:46:35Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
[[Killed in action|({{abbr|DOW|Died of wounds}})]]<noinclude>
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{Documentation}}
</noinclude>
945cfa24d42c2b4cb9ad9be625edaad13a09b10c
Template:Dummy reference
10
286
571
570
2024-06-03T23:46:36Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<sup class="reference nowrap ltr" style="color:#002bb8;">[{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|<span style="font-style:italic">}}{{#if:{{{txtcol|}}}|<span style="color:{{{txtcol|}}}">}}{{{1|1}}}{{#if:{{{txtcol|}}}|</span>}}{{#ifeq:{{yes/no|{{{txtital|}}}}}|yes|</span>}}]</sup><noinclude>
{{documentation}}
</noinclude>
7be6798eb28af3f887fa775b50dc87e0c575cde9
Template:Fakeref
10
287
573
572
2024-06-03T23:46:36Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Dummy reference]]
c85c391fe2de3ebfd2154c56303a2085c57e9dd2
Template:Flagicon image
10
288
575
574
2024-06-03T23:46:36Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<span class="flagicon">[[File:{{#if:{{{1|}}}|{{{1}}}|Flag placeholder.svg}}|{{{size|23x15px}}}|{{{border|{{#if:{{{1|}}}|border}}}}} |alt=|link={{{link|}}}]]</span><noinclude>{{documentation}}</noinclude>
057d0b94a9367359ad010c3da1fcdcb1e880dcb5
Template:FromWikipedia
10
289
577
576
2024-06-03T23:46:37Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Warning|1=This page contains '''imported content from Wikipedia''' and was not made specifically for the Alathra Wiki. Page links and scripts may be broken. '''This is normal.'''|heading=Wikipedia content}}
eadcfbf45f06ceb9bf98c32f20413adde5e083fd
Template:Infobox military conflict/doc
10
290
579
578
2024-06-03T23:46:37Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
{{High-use|16,100}}
{{Convert to use Infobox}}
{{Template:FromWikipedia}}
{{Lua|Module:Infobox military conflict}}
{{Uses TemplateStyles|Module:Infobox military conflict/styles.css}}
__TOC__
==Usage==
{{Infobox military conflict
| conflict = Battle of Lützen
| partof = the [[Thirty Years' War]]
| image = Battle of Lutzen.jpg
| alt = Battle of Lutzen by Carl Whalbom depicting King Gustavus Aolphus falling from a horse mortally wounded in a melee
| image_size = 300px
| caption = The '' '''Battle of Lützen''' '' by [[Carl Wahlbom]] shows the death of King [[Gustavus Adolphus]] on 16 November 1632.
| date = 6 November ([[Old Style and New Style dates|O.S.]]) or 16 November ([[Old Style and New Style dates|N.S.]]), 1632
| place = Near [[Lützen]], southwest of [[Leipzig]]<br />(present-day [[Germany]])
| coordinates = {{coord|51|15|N|12|08|E|region:DE_type:city}}
| result = Protestant victory <br />(see {{blue|Aftermath}} section)
| combatant1 = {{flagicon|Sweden|1562}} [[Swedish Empire|Sweden]]<br />[[Protestant Union]]
| combatant2 = {{flag|Holy Roman Empire}}<br/>{{flagicon image|Catholic League (Germany).svg}} [[Catholic League (German)|Catholic League]]
| commander1 = {{flagicon|Sweden|1562}} [[Gustavus Adolphus]]{{KIA}}<br/>{{flagicon|Sweden|1562}} [[Dodo zu Innhausen und Knyphausen|Dodo von Knyphausen]]<br/>{{Flagicon|Electorate of Saxony}} [[Bernhard of Saxe-Weimar]]<br/>{{flagicon|Sweden|1562}} [[Robert Munro, 18th Baron of Foulis]]
| commander2 = {{flagicon|Holy Roman Empire}} [[Albrecht von Wallenstein]]<br/>{{flagicon|Holy Roman Empire}} [[Heinrich Holk]]<br/>{{flagicon|Holy Roman Empire}} [[Gottfried zu Pappenheim|Count Gottfried zu Pappenheim]]{{DOW}}
| strength1 = 12,800 infantry<br />6,200 cavalry<br />60 guns
| strength2 = 10,000 infantry<br />7,000 cavalry, plus 3,000 infantry and 2,000 cavalry on arrival<br />24 guns
| casualties1 = 3,400 dead and 1,600 wounded or missing
| casualties2 = Probably about the same as Swedish casualties{{fakeref|1}}
}}
A military conflict infobox (sometimes referred to as a warbox) may be used to summarize information about a particular military conflict (a battle, campaign, war, or group of related wars) in a standard manner.
Information summarized in an infobox should follow the general guidance for writing a [[Wikipedia:Manual of Style/Lead section|lead section]]. It should not "make claims" or present material not covered by the article. As with a lead section, there is some discretion in citing information in an infobox. The same guidance should be applied to an infobox as given for [[Wikipedia:Manual of Style/Lead section#Citations|citations in a lead section]]. Information in an infobox must conform with [[Wikipedia:Verifiability|verifiability]], [[Wikipedia:Neutral point of view|point-of-view]] and other policies.
Information in the infobox should not be "controversial". Refer the reader to an appropriate section in the article or leave the parameter blank rather than make an unsubstantiated or doubtful claim.
The infobox should be added using the {{tl|infobox military conflict}} template, as shown below:
<div style="width:250px;background:#dddddd;border: 1px solid black;padding:0.5em 1em 0.5em 1em"><pre>
{{Infobox military conflict
| conflict =
| width =
| partof =
| image =
| image_size =
| alt =
| caption =
| date =
| place =
| coordinates = <!--Use the {{coord}} template -->
| map_type =
| map_relief =
| map_size =
| map_marksize =
| map_caption =
| map_label =
| territory =
| result =
| status =
| combatants_header =
| combatant1 =
| combatant2 =
| combatant3 =
| commander1 =
| commander2 =
| commander3 =
| units1 =
| units2 =
| units3 =
| strength1 =
| strength2 =
| strength3 =
| casualties1 =
| casualties2 =
| casualties3 =
| notes =
| campaignbox =
}}
</pre></div>
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
===Parameters===
* '''conflict''' – the name of the conflict being described (e.g. "Battle of Lützen" or "World War I").
* '''width''' – ''optional'' – the width of the infobox, e.g. "400px"; defaults to: "315px".
* '''partof''' – ''optional'' – the larger conflict containing the event described in the article. For battles or campaigns, this should be the war during which the event takes place; for particularly large wars, this may include a theatre (e.g. "the Eastern Front of World War II"). For wars, the parameter may be used to link to a larger group of wars (e.g. the [[Italian War of 1521–26]] to the [[Italian Wars]]). It may be necessary to insert "the" before the name of the war for proper grammar.
* '''image''' – ''optional'' – an image for the warbox. Given in the form <code>Example.jpg</code>
* '''image_size''' – ''optional'' – a size for the image
* '''alt''' – ''optional'' – [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' – ''optional'' – the text to be placed below the image.
* '''date''' – ''optional'' – the date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.
* '''place''' – the location of the conflict. For conflicts covering a wide area, a general description (e.g. "France", or "Europe", or "Worldwide") may be used.
* '''coordinates''' – ''optional'' – the location of the structure, given as a coordinate pair by using {{tl|coord}} with ''display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_relief''' – ''optional'' – "yes" if the location map is a relief map; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_mark''' – ''optional'' – the name of a file to use as the location map marker, e.g. Green_pog.svg; defaults to: "Red_pog.svg".
* '''map_marksize''' – ''optional'' – width of the location map marker in pixels (px), e.g. "10"; defaults to: "8".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''territory''' – ''optional'' – any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.
* '''action''' – ''optional'' – In case of Coup d'État, short description of ''modus operandi'', e.g. "...marched over the city...", "...dissolving the Congress of the Republic...", "...take the government hostage ...", "...put the country under military control ...", etc.
* '''result''' – ''optional'' – this parameter may use one of two standard terms: "X victory" or "Inconclusive". The term used is for the "immediate" outcome of the "subject" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as "See the {{blue|Aftermath}} section"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the "immediate" result. Do not introduce non-standard terms like "decisive", "marginal" or "tactical", or contradictory statements like "decisive tactical victory but strategic defeat". Omit this parameter altogether rather than engage in [[WP:NOR|speculation]] about which side won or by how much.
* '''status''' – ''optional'' – for ongoing conflicts, the current status of the conflict. This should not be used if a final result (above) is provided.
* '''combatants_header''' – ''optional'' – sets the header text for the combatants section. Default is "Belligerents". In case of Coup d'État, use "Government-Insurgents "
* '''combatant1'''/'''combatant2'''/'''combatant3''' – ''optional'' – the parties participating in the conflict. This is most commonly the countries whose forces took part in the conflict; however, larger groups (such as alliances or international organizations) or smaller ones (such as particular units, formations, or groups) may be indicated if doing so improves reader understanding. When there is a large number of participants, it may be better to list only the three or four major groups on each side of the conflict, and to describe the rest in the body of the article. The '''combatant3''' field may be used if a conflict has three distinct "sides", and should be left blank on other articles. Combatants should be listed in order of importance to the conflict, be it in terms of military contribution, political clout, or a recognized chain of command. If differing metrics can support alternative lists, then ordering is left to the editors of the particular article.
** '''combatant1a'''/'''combatant2a'''/'''combatant3a''' – ''optional'' – in cases where the parties significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''combatant''N''''' fields (above).
** '''combatant1b'''/'''combatant2b'''/'''combatant3b''' – ''optional'' – additional row, as above.
** '''combatant1c'''/'''combatant2c'''/'''combatant3c''' – ''optional'' – additional row, as above.
** '''combatant1d'''/'''combatant2d'''/'''combatant3d''' – ''optional'' – additional row, as above.
** '''combatant1e'''/'''combatant2e'''/'''combatant3e''' – ''optional'' – additional row, as above.
* '''commander1'''/'''commander2'''/'''commander3''' – ''optional'' – the commanders of the military forces involved. For battles, this should include military commanders (and other officers as necessary). For wars, only prominent or notable leaders should be listed, with an upper limit of about seven per combatant column recommended. Ranks and position titles should be omitted. The {{tl|KIA}} and {{tl|POW}} templates may be included immediately after the names of commanders who were killed in action or surrendered and were taken prisoner, respectively. The '''commander3''' field can only be used if the '''combatant3''' field is set.
** '''commander1a'''/'''commander2a'''/'''commander3a''' – ''optional'' – in cases where the commanders significantly changed over the course of the conflict, these subsidiary fields may be used to provide additional rows for the '''commander''N''''' fields (above).
** '''commander1b'''/'''commander2b'''/'''commander3b''' – ''optional'' – additional row, as above.
** '''commander1c'''/'''commander2c'''/'''commander3c''' – ''optional'' – additional row, as above.
** '''commander1d'''/'''commander2d'''/'''commander3d''' – ''optional'' – additional row, as above.
** '''commander1e'''/'''commander2e'''/'''commander3e''' – ''optional'' – additional row, as above.
* '''units1'''/'''units2'''/'''units3''' – ''optional'' – the units or formations involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field. The '''units3''' field can only be used if the '''combatant3''' field is set.
* '''strength1'''/'''strength2''' – ''optional'' – the numerical strength of the units involved.
:* '''polstrength1'''/'''polstrength2''' – ''optional'' – In case of Coup d'Etat, political organizations that supported the government (1) respective the insurgents (2).
:* '''milstrength1'''/'''milstrength2''' – ''optional'' – In case of Coup d'Etat, military units that supported the government (1) respective the insurgents (2).
* '''strength3''' – ''optional'' – if '''combatant3''' is set, this is a third strength field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total participation in a conflict is known.
* '''casualties1'''/'''casualties2''' – ''optional'' – casualties suffered (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Note that this section of the infobox is headed "Casualties and losses". Terms such as "dead" (or "killed"), "wounded", or "captured" should be used in place of abbreviations such as "KIA" or "POW". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.
* '''casualties3''' – ''optional'' – if '''combatant3''' is set, this is a third casualty field identical to the two above; if it is '''''not''''' set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.
* '''notes''' – ''optional'' – optional field for further notes; this should only be used in exceptional circumstances.
* '''campaignbox''' – ''optional'' – optional field for appending a [[WP:CAMPAIGN|campaignbox template]] to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format <nowiki>{{Campaignbox XYZ}}</nowiki>.<noinclude>
[[Category:WikiProject Military history template instructions|Military conflict infobox]]
</noinclude>{{Campaign/doc|noheader=yes}}
{{Operational plan/doc|noheader=yes}}
==Microformat==
{{UF-hcal-geo}}
==TemplateData==
{{Collapse top|title=[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
{{TemplateData header|noheader=1}}
<templatedata>
{
"description": "Summarize information about a particular military conflict (a battle, campaign, war, or group of related wars).",
"format": "{{_\n| _________________ = _\n}}\n",
"params": {
"conflict": {
"label": "Conflict",
"description": "The name of the conflict being described.",
"type": "string/line",
"required": true
},
"width": {
"label": "Width",
"description": "Width of the infobox.",
"type": "string",
"default": "315px",
"required": false
},
"partof": {
"label": "Part of",
"description": "The larger conflict containing the event described in the article.",
"type": "wiki-page-name",
"required": false
},
"image": {
"label": "Image",
"description": "An image for the warbox given in the form Example.jpg.",
"type": "string",
"required": false
},
"image_size": {
"label": "Image size",
"description": "The size of the image",
"type": "string",
"required": false
},
"alt": {
"label": "Alt",
"description": "Alternative textual description of the image",
"type": "string",
"required": false
},
"caption": {
"label": "Caption",
"description": "The text to be placed below the image.",
"type": "string",
"required": false
},
"date": {
"label": "Date",
"description": "The date of the conflict described. Convention is to give the actual date for battles and the years for wars, but this does not always apply.",
"type": "string",
"required": false
},
"place": {
"label": "Place",
"description": "The location of the conflict.",
"type": "string",
"required": true
},
"coordinates": {
"label": "Coordinates",
"description": "The location of the structure, given as a coordinate pair by using {{coord}} with display=inline,title.",
"type": "string",
"required": false
},
"map_type": {
"label": "Map Type",
"description": "The base map to be used for the location map, e.g. \"Scotland\"; see {{location map}} for more details.",
"type": "string",
"required": false
},
"map_relief": {
"label": "Map Relief",
"description": "\"yes\" if the location map is a relief map.",
"type": "string",
"required": false
},
"map_size": {
"label": "Map Size",
"description": "Width of the location map in pixels (px).",
"type": "number",
"default": "220",
"required": false
},
"map_mark": {
"label": "Map Marker",
"description": "File to use as the location map marker.",
"type": "string",
"default": "red_pog.svg",
"required": false
},
"map_marksize": {
"label": "Map Marker Size",
"description": "Width of the location map marker in pixels (px).",
"type": "number",
"default": "8",
"required": false
},
"map_caption": {
"label": "Map Caption",
"description": "Caption displayed below the location map.",
"type": "string",
"default": "Location within {{{map_type}}}",
"required": false
},
"map_label": {
"label": "Map Label",
"description": "The label placed next to the marker on the location map.",
"type": "string/line",
"required": false
},
"territory": {
"label": "Territory",
"description": "Any changes in territorial control as a result of the conflict; this should not be used for overly lengthy descriptions of the peace settlement.",
"type": "string",
"required": false
},
"result": {
"label": "Result",
"description": "This parameter may use one of two standard terms: \"X victory\" or \"Inconclusive\". The term used is for the \"immediate\" outcome of the \"subject\" conflict and should reflect what the sources say. In cases where the standard terms do not accurately describe the outcome, a link or note should be made to the section of the article where the result is discussed in detail (such as \"See the Aftermath section\"). Such a note can also be used in conjunction with the standard terms but should not be used to conceal an ambiguity in the \"immediate\" result. Do not introduce non-standard terms like \"decisive\", \"marginal\" or \"tactical\", or contradictory statements like \"decisive tactical victory but strategic defeat\". Omit this parameter altogether rather than engage in speculation about which side won or by how much.",
"type": "string/line",
"required": false
},
"status": {
"label": "Status",
"description": "For ongoing conflicts, the current status of the conflict.",
"type": "string/line",
"required": false
},
"combatants_header": {
"label": "\"Combatants\" Header Text",
"description": "Sets the header text for the combatants section.",
"type": "string/line",
"default": "Belligerents",
"required": false
},
"combatant1": {
"label": "Combatant 1",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant2": {
"label": "Combatant 2",
"description": "A party participating in the conflict.",
"type": "string",
"required": false
},
"combatant3": {
"label": "Combatant 3",
"description": "A party participating in the conflict. (only if the conflict has three distinct \"sides\")",
"type": "string",
"required": false
},
"combatant1a": {
"label": "Combatant 1a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2a": {
"label": "Combatant 2a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3a": {
"label": "Combatant 3a",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1b": {
"label": "Combatant 1b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2b": {
"label": "Combatant 2b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3b": {
"label": "Combatant 3b",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1c": {
"label": "Combatant 1c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2c": {
"label": "Combatant 2c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3c": {
"label": "Combatant 3c",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"combatant1d": {
"label": "Combatant 1d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 1 field.",
"type": "string",
"required": false
},
"combatant2d": {
"label": "Combatant 2d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 2 field.",
"type": "string",
"required": false
},
"combatant3d": {
"label": "Combatant 3d",
"description": "In cases where the parties significantly changed over the course of the conflict, this field may be used to provide additional rows for the Combatant 3 field.",
"type": "string",
"required": false
},
"commander1": {
"label": "Commander of Combatant 1",
"description": "The commanders of the military forces of Combatant (1) involved.",
"type": "string",
"required": false
},
"commander2": {
"label": "Commander of Combatant 2",
"description": "The commanders of the military forces of Combatant 2 involved.",
"type": "string",
"required": false
},
"commander3": {
"label": "Commander of Combatant 3",
"description": "The commanders of the military forces of Combatant 3 involved.",
"type": "string",
"required": false
},
"units1": {
"label": "Units of Combatant 1",
"description": "The units or formations of Combatant 1 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units2": {
"label": "Units of Combatant 2",
"description": "The units or formations of Combatant 2 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"units3": {
"label": "Units of Combatant 3",
"description": "The units or formations of Combatant 3 involved. If a large number of distinct formations is present, it may be better to reference an order of battle in the body of the article than to include the entire list in this field.",
"type": "string",
"required": false
},
"strength1": {
"label": "Strength of Combatant 1",
"description": "The numerical strength of Combatant 1.",
"type": "string",
"required": false
},
"strength2": {
"label": "Strength of Combatant 2",
"description": "The numerical strength of Combatant 2.",
"type": "string",
"required": false
},
"strength3": {
"label": "Strength of Combatant 3",
"description": "If Combatant 3 is set, this field is for the numerical strength of Combatant 3. If Combatant 3 is not set, this is an alternate combined field for use where only the total participation in a conflict is known.",
"type": "string",
"required": false
},
"casualties1": {
"label": "Casualties of Combatant 1",
"description": "Casualties suffered by Combatant 1 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties2": {
"label": "Casualties of Combatant 2",
"description": "Casualties suffered by Combatant 2 (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc.",
"type": "string",
"required": false
},
"casualties3": {
"label": "Casualties of Combatant 3",
"description": "If Combatant 3 is set, this field is for the casualties suffered by Combatant 3, (including: dead, wounded, missing, captured and civilian deaths) and equipment losses. Terms such as \"dead\" (or \"killed\"), \"wounded\", or \"captured\" should be used in place of abbreviations such as \"KIA\" or \"POW\". Where equipment losses are reported, this should be confined to major or significant types of equipment broadly categorized such as: tanks, guns (artillery pieces), aircraft, destroyers etc. If combatant3 is not set, this is an alternate combined field for use where only the total casualties of a conflict are known, or where civilian casualties cannot be directly attributed to either side.",
"type": "string",
"required": false
},
"notes": {
"label": "Notes",
"description": "Optional field for further notes; this should only be used in exceptional circumstances.",
"type": "string",
"required": false
},
"campaignbox": {
"label": "Campaignbox",
"description": "Optional field for appending a campaignbox template to the bottom of the infobox, which allows both boxes to float as a single element (useful if there are subsequent left floating images, which would otherwise not be able to float above the campaign box); the template must be specified in the format {{Campaignbox XYZ}}.",
"type": "string",
"required": false
}
}
}</templatedata>
{{Collapse bottom}}
==See also==
*{{tl|Infobox military operation}}
*{{tl|Infobox civil conflict}}
*{{tl|Infobox civilian attack}}
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Military infobox templates|Conflict]]
[[Category:Lua-based infobox templates]]
}}</includeonly>
dbf7c8bccf060e1cc4ffcebaecc25cdcb142845d
Template:Infobox military operation
10
291
581
580
2024-06-03T23:46:38Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{infobox
|bodyclass = vevent
|bodystyle = {{WPMILHIST Infobox style|main_box_raw}}
|abovestyle = {{WPMILHIST Infobox style|header_raw}}
|aboveclass = summary
| headerstyle = {{WPMILHIST Infobox style|header_raw}}
|above = {{if empty|{{{title|}}}|{{{name|}}}|{{PAGENAMEBASE}}}}
|subheaderstyle = {{WPMILHIST Infobox style|sub_header_raw}}
|subheader = {{br separated entries|{{{subtitle|}}}|{{#if:{{{partof|}}}{{{conflict|}}}|Part of {{if empty|{{{conflict|}}}|{{{partof|}}}}} }}}}
|labelstyle = padding-right: 1em;
|imagestyle = {{WPMILHIST Infobox style|image_box_raw}}
|image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|upright={{{image_upright|1}}}|alt={{{alt|}}}}}
|caption = {{{caption|}}}
| label1 = {{#if:{{{scope|}}}|Operational scope|Type}}
| data1 = {{if empty|{{{scope|}}}|{{{type|}}}}}
| label2 = Location{{#if:{{{location2|}}}|s}}
| data2 = {{br separated entries
|1 = {{#if:{{{location|{{{place|}}}}}}|<div style="display:inline;" class="location">{{{location|{{{place|}}}}}}</div>}}
|2 = {{{coordinates|}}}
|3 = {{#if:{{{location2|}}}|<div style="display:inline;" class="location">{{{location2|}}}</div>}}
|4 = {{#if:{{{location2|}}}|{{{coordinates2|}}}</div>}}
|5 = {{#if:{{{location3|}}}|<div style="display:inline;" class="location">{{{location3|}}}</div>}}
|6 = {{#if:{{{location3|}}}|{{{coordinates3|}}}</div>}}
|7 = {{#if:{{{location4|}}}|<div style="display:inline;" class="location">{{{location4|}}}</div>}}
|8 = {{#if:{{{location4|}}}|{{{coordinates4|}}}</div>}}
|9 = {{#if:{{{location5|}}}|<div style="display:inline;" class="location">{{{location5|}}}</div>}}
|10= {{#if:{{{location5|}}}|{{{coordinates5|}}}</div>}}
|11= {{#if:{{{location6|}}}|<div style="display:inline;" class="location">{{{location6|}}}</div>}}
|12= {{#if:{{{location6|}}}|{{{coordinates6|}}}</div>}}
|13= {{#if:{{{location7|}}}|<div style="display:inline;" class="location">{{{location7|}}}</div>}}
|14= {{#if:{{{location7|}}}|{{{coordinates7|}}}</div>}}
|15= {{#if:{{{location8|}}}|<div style="display:inline;" class="location">{{{location8|}}}</div>}}
|16= {{#if:{{{location8|}}}|{{{coordinates8|}}}</div>}}
|17= {{#if:{{{location9|}}}|<div style="display:inline;" class="location">{{{location9|}}}</div>}}
|18= {{#if:{{{location9|}}}|{{{coordinates9|}}}</div>}}
|19= {{#if:{{{location10|}}}|<div style="display:inline;" class="location">{{{location10|}}}</div>}}
|20= {{#if:{{{location10|}}}|{{{coordinates10|}}}</div>}}
}}
| label3 = Planned
| data3 = {{{planned|}}}
| label4 = Planned by
| data4 = {{{planned_by|}}}
| label5 = Commanded by
| data5 = {{{commanded_by|}}}
| label6 = {{#if:{{{target|}}}|Target|Objective}}
| data6 = {{if empty|{{{target|}}}|{{{objective|}}}}}
| label7 = Date
| data7 = {{br separated entries
|1 = {{if empty|{{{executed|}}}|{{{date|}}}}}
|2 = {{{time|}}}
|3 = {{#if:{{{time-begin|}}}|{{{time-begin}}} – {{{time-end|}}}}}
}} {{#if:{{{timezone|}}}|({{{timezone}}})}}
| label8 = Executed by
| data8 = {{if empty|{{{instigator|}}}|{{{executed_by|}}}}}
| label9 = Outcome
| data9 = {{{outcome|}}}
| label10 = Casualties
| data10 = {{if empty|{{{casualties|}}}|{{br separated entries
|1 = {{#if:{{{fatalities|}}}|{{{fatalities|}}} killed}}
|2 = {{#if:{{{injuries|}}}|{{{injuries|}}} injured}}
}} }}
| header27 = {{#if:{{{map_type|}}}|<nowiki />}}
| data28 = {{#if:{{{map_type|}}}|
{{#if:{{{coordinates2|}}}|
{{Location map many|{{{map_type}}}|coordinates1={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label1={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}}
|coordinates2={{{coordinates2|}}}|label2={{{map_label2|}}}
{{#if:{{{coordinates3|}}}|{{!}}coordinates3={{{coordinates3|}}}{{!}}label3={{{map_label3|}}} }}
{{#if:{{{coordinates4|}}}|{{!}}coordinates4={{{coordinates4|}}}{{!}}label4={{{map_label4|}}} }}
{{#if:{{{coordinates5|}}}|{{!}}coordinates5={{{coordinates5|}}}{{!}}label5={{{map_label5|}}} }}
{{#if:{{{coordinates6|}}}|{{!}}coordinates6={{{coordinates6|}}}{{!}}label6={{{map_label6|}}} }}
{{#if:{{{coordinates7|}}}|{{!}}coordinates7={{{coordinates7|}}}{{!}}label7={{{map_label7|}}} }}
{{#if:{{{coordinates8|}}}|{{!}}coordinates8={{{coordinates8|}}}{{!}}label8={{{map_label8|}}} }}
{{#if:{{{coordinates9|}}}|{{!}}coordinates9={{{coordinates9|}}}{{!}}label9={{{map_label9|}}} }}
{{#if:{{{coordinates10|}}}|{{!}}coordinates10={{{coordinates10|}}}{{!}}label10={{{map_label10|}}} }}
}}
|{{Location map|{{{map_type}}}|coordinates={{if empty|{{{map_coord|}}} | {{{coordinates|}}} }}|width={{{map_size|220}}}|float=center|border=infobox|label={{{map_label|}}}|caption={{{map_caption|Location within {{#invoke:Location map|data|{{{map_type}}}|name}} }}} }}
}}
}}
}}{{{campaignbox|}}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox military operation with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox military operation]] with unknown parameter "_VALUE_"|ignoreblank=y| alt | campaignbox | caption | casualties | commanded_by | conflict | coordinates | date | executed | executed_by | fatalities | image | image_size | image_upright | injuries | instigator | location | map_caption | map_coord | map_label | map_size | map_type | name | objective | outcome | partof | planned | planned_by | scope | target | time | time-begin | time-end | timezone | title | type | coordinates2 | coordinates3 | coordinates4 | coordinates5 | coordinates6 | coordinates7 | coordinates8 | coordinates9 | coordinates10 | map_label2 | map_label3 | map_label4 | map_label5 | map_label6 | map_label7 | map_label8 | map_label9 | map_label10 | location2 | location3 | location4 | location5 | location6 | location7 | location8 | location9 | location10 }}<noinclude>
{{template doc}}
</noinclude>
42edcbcfd7a943e543c35cd3640094e83b834ddc
Template:Infobox military operation/doc
10
292
583
582
2024-06-03T23:46:38Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{#ifeq:{{{noheader|}}}|yes||{{Documentation subpage}}
{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
}}
This infobox may be used to describe a particular planned or executed military operation or attack. For operations that resulted in combat, it can be used as an auxiliary template to the {{tl|infobox military conflict}}, if necessary; for other types of operations, including those that were planned but never executed, it may be used alone. In the case of conflicts that consisted of multiple independent operations, multiple copies of the box may be used on a single article.
__TOC__
=== Usage ===
{{Parameter names example|_template = Infobox military operation |title |name |partof |conflict |image |image_size |image_upright |alt |caption |coordinates = {{coord|0|0}} |map_type=Earth |map_size= |map_label |map_caption |scope |type |location |coordinates |planned |planned_by |commanded_by |target |objective |date |time |time-begin |time-end |timezone |executed_by |outcome |casualties |fatalities |injuries}}
<pre style="overflow:auto;">
{{Infobox military operation
|name = Eastern European War
|partof = War on Communism
|subtitle =
|image =
|image_upright =
|alt =
|caption =
|scope =
|type =
|location =
|location2 = <!-- 2 through 10 for more locations -->
|coordinates =
|coordinates2 = <!-- 2 through 10 for more locations -->
|map_type =
|map_size =
|map_caption =
|map_label =
|map_label2 = <!-- 2 through 10 for more locations -->
|planned =
|planned_by =
|commanded_by =
|objective =
|target =
|date = <!-- {{start date|YYYY|MM|DD|df=y}} -->
|time =
|time-begin =
|time-end =
|timezone =
|executed_by =
|outcome =
|casualties =
|fatalities =
|injuries =
}}</pre>
=== Example ===
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}
<pre style="overflow:auto;">
{{Infobox military operation
|name = Case Blue
|scope = Strategic offensive
|planned_by = ''[[Wehrmacht]]''
|objective = Capture of [[Caucasus]] oil fields
|executed = Began {{start date|1942|06|28|df=y}}
|executed_by = [[Army Group South]]
}}</pre>
=== Parameters ===
'''Note''': When using parameters, avoid the ambiguous abbreviation "N/A", and instead use "unknown" or "none". All subjective or qualitative judgements and numerical quantities or statistics must be cited to a reliable source (see [[WP:MILMOS#CITE]]).
* '''name''' – the name of the operational plan; names in multiple languages may be provided.
* '''subtitle''' – alternative name of the conflict being described.
* '''partof''' – ''optional'' – the larger conflict containing the event described in the article.
* '''image''' – ''optional'' – an image for the warbox. Given in the form <code>File:Example.jpg</code>
* '''image_upright''' – ''optional'' – image upright scaling factor.
* '''alt''' – ''optional'' – [[Wikipedia:Manual of Style/Accessibility/Alternative text for images|Alternative text for image]] that is accessible to [[screen reader]]s to help the [[visually impaired]]
* '''caption''' – ''optional'' – the text to be placed below the image.
* '''location''' – ''optional'' – the location of the operation.
* '''coordinates''' – ''optional'' – the coordinates for the location above, given as {{tl|coord}} with ''|display=inline,title''. Used to display the geographic location of the conflict and the location on a map added with the <code>map_type</code> parameter. If coordinates for several locations are given, consider if hany shall have the title display.
* '''map_type''' – ''optional'' – the base map to be used for the location map, e.g. "Scotland"; see {{tl|location map}} for more details.
* '''map_size''' – ''optional'' – width of the location map in pixels (px), e.g. "150"; defaults to: "220".
* '''map_caption''' – ''optional'' – caption displayed below the location map; defaults to "Location within {{{map_type}}}", e.g. "Location within Scotland".
* '''map_label''' – ''optional'' – the label placed next to the marker on the location map.
* '''scope''' – ''optional'' – the scope of the operation, such as "Strategic", "Operational", or "Tactical".
* '''type''' – ''optional'' – as an alternative to the '''scope''' field above, the type of operation, such as "Suicide attack" or "Ambush".
* '''planned''' – ''optional'' – the date(s) on which the plan was developed.
* '''planned_by''' – ''optional'' – the person or group responsible for developing the plan.
* '''commanded_by''' – ''optional'' – the person commanding the operation.
* '''objective''' – ''optional'' – the objective(s) of the operation.
* '''target''' – ''optional'' – as an alternative to the '''objective''' field above, the target(s) of the operation.
* '''date''' – ''optional'' – the date(s), if any, on which the operation was executed. use {{Tl|Start date}} (and {{Tl|End date}} if required)
* '''time''' – ''optional'' – the time, if any, at which the operation was executed.
* '''time-begin''' and '''time-end''' – ''optional'' – as an alternative to the '''time''' field above, the start and end times, respectively.
* '''timezone''' – ''optional'' – the timezone of the location of the operation; [[UTC]]+X, [[UTC]]-X, or [[UTC]] (i.e. offset from [[UTC]]) is preferred.
* '''executed_by''' – ''optional'' – the people, groups, units, or formations responsible for executing the operation.
* '''outcome''' – ''optional'' – the outcome of the operation from the perspective of the planners.
* '''casualties''' – ''optional'' – any casualties occurring during the execution of the operation.
* '''fatalities''' – ''optional'' – as an alternative to the '''casualties''' field above, the number of fatalities occurring during the execution of the operation.
* '''injuries''' – ''optional'' – as an alternative to the '''casualties''' field above, the number of injuries occurring during the execution of the operation.
=== Microformat ===
{{UF-hcal}}
=== See also ===
* {{tl|Infobox civil conflict}}
* {{tl|Infobox civilian attack}}
* {{tl|Infobox military conflict}}<noinclude>
[[Category:WikiProject Military history template instructions|Military operation]]
</noinclude><includeonly>{{Sandbox other||{{#ifeq:{{{noheader|}}}|yes||
[[Category:Military auxiliary infobox templates|Military operation]]
[[Category:Templates that add a tracking category]]
}}}}</includeonly>
73201007b374b23cccc982f6d8d1ce14cfa81cbf
Template:KIA
10
293
585
584
2024-06-03T23:46:39Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
[[<!---(link:)-->{{{1|Killed in action}}}<!--
-->|<!--(label:)-->{{#ifeq:{{{alt|}}}|yes |(KIA) |<span style="font-family:'Times New Roman','Old English Text MT',serif">{{#ifeq:{{{bold|}}}|no |† |'''†'''}}</span>}}<!--
-->]]<noinclude>
{{Documentation}}
</noinclude>
40db638380717ea2f21d23962d35f009deec5b20
Template:Longitem
10
294
587
586
2024-06-03T23:46:39Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<div style="display:inline-block; padding:0.1em 0;line-height:1.2em;{{{style|}}}">{{{1}}}</div><includeonly>{{#if:{{{2|}}}|[[Category:Pages using Template:Longitem with unnamed style parameter]]}}</includeonly><noinclude>
{{documentation}}
</noinclude>
603b32e39380822d40ff4fa75e8b2759cc4280e7
Template:Microformat message
10
295
589
588
2024-06-03T23:46:39Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
The [[Help:HTML in wikitext|HTML mark-up]] produced by this template includes {{#if:{{{type|}}} |{{{type}}} |an [[{{{format}}} microformat]]}} that makes {{{data}}} readily [[Parsing|parsable]] by computer programs. This aids tasks such as the cataloguing of articles and maintenance of databases. For more information about the use of microformats on Wikipedia, please visit [[Wikipedia:WikiProject Microformats|the Microformat WikiProject]].<!--
-->{{#if:{{{subtemplates<includeonly>|</includeonly>}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{big|Subtemplates}}
{{{subtemplates}}}
'''''Please do not remove instances of these subtemplates.'''''
</div>}}<!--
-->{{#if:{{{subsection1|}}}
| <div style="margin-top:0.5em;margin-bottom:0.65em;"><!--(newline in case subsection begins with heading:)-->
{{{subsection1}}}
</div>}}<!--
-->{{#if:{{{1<includeonly>|</includeonly>}}} <!--(i.e. if at least one unnamed parameter supplied:)-->
| <div style="margin-top:0.5em;margin-bottom:0.65em;">
; {{big|Classes used}}
The [[HTML attribute|HTML class]]es of this microformat include:
: {{hlist
|item_style=font-size:110%;{{{itemstyle|}}}
|{{{1}}} |{{{2<includeonly>|</includeonly>}}} |{{{3|<noinclude>{{nobold|……}}</noinclude>}}}
|{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}}
}} </div>
{{longitem|style=line-height:1.3em|'''''Please do not rename or remove these classes{{#if:{{{nocollapse<includeonly>|</includeonly>}}} |<br/>nor collapse nested elements which use them}}.'''''}}<!--
-->}}<!--(end #if:[1])--><noinclude>
{{Documentation}}
</noinclude>
bfb8605b8917ea8a940634ca79c9c1a4c9c50ef0
Template:Military navigation
10
296
591
590
2024-06-03T23:46:40Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#invoke:Military navigation|main}}</includeonly><noinclude>
{{Documentation|Wikipedia:WikiProject Military history/Military navigation}}
[[Category:Navigational box wrapper templates]]
[[Category:Military navigational boxes| ]]
</noinclude>
a97cde0f2435f325e6cebabd17c16bb26a783300
Template:Operational plan/doc
10
297
593
592
2024-06-03T23:46:40Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Infobox military operation/doc]]
10b255654acded6663dadad8d9084ba41f66bd68
Template:Spaced en dash
10
298
595
594
2024-06-03T23:46:41Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<noinclude>{{Template for discussion/dated|action=|page=Spaced en dash|otherpage=|link=Wikipedia:Templates for discussion/Log/2021 June 5#Template:Spaced en dash|type=tiny|help=off|bigbox={{#invoke:Noinclude|noinclude|text=yes}}}}</noinclude> – <noinclude>
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
162f72ca1872e84ce0cdc6d557639dd1b26d8bda
Template:Spaced ndash
10
299
597
596
2024-06-03T23:46:41Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Spaced en dash]]
{{R from move}}
943ce837a48a4907650d7398e8d10271b21dde62
Template:Start date
10
300
599
598
2024-06-03T23:46:41Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#if: {{{4|}}}
|{{#if: {{{5|}}}
|{{padleft:{{{4}}}|2|0}}:{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
|:{{padleft:{{{6}}}|2|0}} }}, }} }}<!--ABOVE FOR TIME; BELOW FOR DATE
-->{{#if: {{{1|}}}
|{{#if: {{{2|}}}
|{{#if: {{{3|}}}
|{{#if: {{{df|}}}|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},}} {{{1}}}|{{MONTHNAME|{{{2}}}}} {{{1}}}}}|{{{1}}}}}}}{{#if: {{{7|}}}
| ({{#ifeq: {{{7}}}|Z|UTC|{{{7}}}}})}}<!-- BELOW FOR hCalendar
--><span style="display:none"> (<span class="bday dtstart published updated">{{#if: {{{1|}}}
| {{{1}}}{{#if: {{{2|}}}
| -{{padleft:{{{2}}}|2|0}}{{#if: {{{3|}}}
| -{{padleft:{{{3}}}|2|0}} }} }}<!--
-->{{#if: {{{4|}}}
| T{{padleft:{{{4}}}|2|0}}{{#if: {{{5|}}}
| :{{padleft:{{{5}}}|2|0}}{{#if: {{{6|}}}
| :{{padleft:{{{6}}}|2|0}} }} }} }} }}{{{7|}}}</span>)</span></includeonly><noinclude>
{{documentation}}
</noinclude>
2bdc464c20f7d568f3d482c9fb2d04f5d266f982
Template:UF-hcal
10
301
601
600
2024-06-03T23:46:42Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Microformat message
| format = hCalendar
| data = event details
| subtemplates =
{{#if:{{{hide_subtemplates}}} |<noinclude>}}
Dates will only be included if you use {{tl|start date}} (for single dates) or {{tl|end date}}. Do not, however, use these templates [[Wikipedia:WikiProject Microformats/dates|if a date before 1583 CE is involved]].
To include URLs, use {{tl|URL}}.
{{#if:{{{hide_subtemplates}}} |</noinclude>}}
|attendee |contact |description |dtend |dtstart |location |organiser |summary |url |vevent
| nocollapse = on
}}<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars|{{PAGENAME}}]]}} }}</includeonly><noinclude>
{{Documentation |content={{Microformat message templates}}}}
[[Category:Microformat (uF) message templates]]
</noinclude>
f453b47f676a5c474e14155f7013b69b4716748b
Template:UF-hcal-geo
10
302
603
602
2024-06-03T23:46:42Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
The HTML markup produced by this template includes an [[hCalendar|hCalendar microformat]], which makes the event details [[parsing|parsable]] by computers, either acting automatically to catalogue article across Wikipedia, or via a browser tool operated by a person, to (for example) add the subject to a calendar or diary application. Within the hCalendar is a [[Geo (microformat)|Geo microformat]], which additionally makes the [[geographic coordinate system|coordinates]] (latitude & longitude) parsable, so that they can be, say, looked up on a map, or downloaded to a [[Global Positioning System|GPS]] unit. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
Dates will only be included if you use {{tl|Start date}} or {{tl|End date}} (use the former for single dates, [[Wikipedia:WikiProject Microformats/dates|but do not use any of these if the date is before 1583 CE]]). {{tl|End date}} requires that a time be specified, but display of this time may be suppressed by adding {{para|nodate|yes}} to the end.
To include a URL, use {{tl|URL}}.
hCalendar uses HTML classes including:
{{Flatlist/microformat|indent=1|
*attendee
*dtend
*dtstart
*location
*summary
*url
*vevent
}}
Geo is produced by calling {{tl|coord}}, and uses HTML classes:
{{Flatlist/microformat|indent=1|
*geo
*latitude
*longitude
}}
'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<br/>Also, when giving coordinates, please don't be [[wikipedia:WikiProject Geographical coordinates#Precision|overly precise]].
<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCalendars and Geo|{{PAGENAME}}]]}} }}</includeonly><noinclude>
[[Category:Microformat (uF) message templates]]
</noinclude>
edfbf3e672c2ee4cfb945f299b5cc960ea00e7ae
Template:WPMILHIST Infobox style
10
303
605
604
2024-06-03T23:46:43Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}
|main_box=class="{{#if:{{{2|}}}|infobox {{{2}}}|infobox}}" style="{{#invoke:Data|Module:WPMILHIST Infobox style|main_box_raw}}"
|{{#invoke:Data|Module:WPMILHIST Infobox style|{{{1|}}}}}
}}</includeonly><noinclude>
{{documentation}}
</noinclude>
b117547056afc703e2f1371497b0a53fa5a22751
Template:Wrap
10
304
607
606
2024-06-03T23:46:43Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><span class="wrap">{{{1| }}}</span></includeonly><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>
aa85f77c2939e3f50fa04a160b08510cf331ee11
Template:Yes/no
10
305
609
608
2024-06-03T23:46:43Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
#REDIRECT [[Template:Yesno]]
80e458cd4d851471d13896c26ecf96ce6dcdd579
Module:Data
828
306
611
610
2024-06-03T23:46:43Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local mt = {}
function mt.__index(t, k)
return function(frame)
local data = mw.loadData(k)
local i = 1
for _,v in ipairs(frame.args) do
local ty = type(data)
if ty ~= 'table' then
local args = {}
for j = 1, i - 1 do
args[j] = frame.args[j]
end
if frame.args.softfail then
return '<span class="error">[[Category:Pages with failed Module:Data lookups]]Error: Tried to read index "' .. mw.text.nowiki(v) .. '" of mw.loadData("' .. mw.text.nowiki(k) .. '").' .. mw.text.nowiki(table.concat(args, '.')) .. ', which is a ' .. ty .. '</span>'
else
error('Tried to read index "' .. v .. '" of mw.loadData("' .. k .. '").' .. table.concat(args, '.') .. ', which is a ' .. ty)
end
end
data = data[v]
i = i + 1
end
return data
end
end
return setmetatable({}, mt)
654c5ba2e0c73e7415457ca7a67fe0dfacfdba3b
Module:Infobox military conflict
828
307
613
612
2024-06-03T23:46:44Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
require('Module:No globals')
local infoboxStyle = mw.loadData('Module:WPMILHIST Infobox style')
local templatestyles = 'Module:Infobox military conflict/styles.css'
local IMC = {}
IMC.__index = IMC
function IMC:renderPerCombatant(builder, headerText, prefix, suffix)
prefix = prefix or ''
suffix = suffix or ''
local colspans = {}
-- This may result in colspans[1] getting set twice, but
-- this is no big deal. The second set will be correct.
local lastCombatant = 1
for i = 1,self.combatants do
if self.args[prefix .. i .. suffix] then
colspans[lastCombatant] = i - lastCombatant
lastCombatant = i
end
end
local jointText = self.args[prefix .. (self.combatants + 1) .. suffix]
if headerText and (colspans[1] or jointText) then
builder:tag('tr')
:tag('th')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(headerText)
end
-- The only time colspans[1] wouldn't be set is if no
-- combatant has a field with the given prefix and suffix.
if colspans[1] then
-- Since each found argument set the colspan for the previous
-- one, the final one wasn't set above, so set it now.
colspans[lastCombatant] = self.combatants - lastCombatant + 1
builder = builder:tag('tr')
for i = 1,self.combatants do
-- At this point, colspans[i] will be set for i=1 unconditionally, and for
-- any other value of i where self.args[prefix .. i .. suffix] is set.
if colspans[i] then
builder:tag('td')
-- don't bother emitting colspan="1"
:attr('colspan', colspans[i] ~= 1 and colspans[i] or nil)
:css('width', math.floor(100 / self.combatants * colspans[i] + 0.5) .. '%')
-- no border on the right of the rightmost column
:css('border-right', i ~= lastCombatant and infoboxStyle.internal_border or nil)
-- no padding on the left of the leftmost column
:css('padding-left', i ~= 1 and '0.25em' or nil)
-- don't show the border if we're directly under a header
:css('border-top', not headerText and infoboxStyle.internal_border or nil)
:newline()
:wikitext(self.args[prefix .. i .. suffix])
end
end
end
if jointText then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('text-align', 'center')
-- don't show the border if we're directly under a header
:css('border-top', (not headerText or colspans[1]) and infoboxStyle.internal_border or nil)
:newline()
:wikitext(jointText)
end
end
function IMC:renderHeaderTable(builder)
builder = builder:tag('table')
:css('width', '100%')
:css('margin', 0)
:css('padding', 0)
:css('border', 0)
if self.args.date then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Date')
:done()
:tag('td')
:wikitext(self.args.date)
end
builder = builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Location')
:done()
:tag('td')
:tag('div')
:addClass('location')
:wikitext(self.args.place or '{{{place}}}') -- hack so that people who don't know Lua know that this parameter is required
:done()
if self.args.coordinates then
builder:wikitext(self.args.coordinates)
end
builder = builder:done():done()
-- only for "Putsch"
if self.args.action then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.action and 'Action')
:done()
:tag('td')
:wikitext(self.args.action)
end
if self.args.status or self.args.result then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext(self.args.status and 'Status' or 'Result')
:done()
:tag('td')
:addClass('status')
:newline()
:wikitext(self.args.status or self.args.result)
end
if self.args.territory then
builder:tag('tr')
:tag('th')
:css('padding-right', '1em')
:wikitext('Territorial<br />changes')
:done()
:tag('td')
:newline()
:wikitext(self.args.territory)
end
end
function IMC:render()
local builder = mw.html.create()
if self.args.campaignbox then
-- this should be the same as using {{stack|clear=right|...}}
builder:wikitext(self.frame:expandTemplate{ title = 'stack begin', args = { clear='true'} })
end
builder = builder:tag('table')
:addClass('infobox vevent')
:cssText(infoboxStyle.main_box_raw)
:css('width', self.args.width or nil)
builder:tag('tr')
:tag('th')
:addClass('summary')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.header_raw)
:wikitext(self.args.conflict or mw.title.getCurrentTitle().text)
if self.args.partof then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.sub_header_raw)
:wikitext('Part of ' .. self.args.partof)
end
if self.args.image then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:cssText(infoboxStyle.image_box_raw)
:wikitext(string.format('%s%s%s',
require('Module:InfoboxImage').InfoboxImage{args = {
image = self.args.image,
size = self.args.image_size,
sizedefault = 'frameless',
upright = 1,
alt = self.args.alt
}},
self.args.caption and '<br />' or '',
self.args.caption or ''
))
end
self:renderHeaderTable(builder:tag('tr'):tag('td'):attr('colspan', self.combatants))
self:renderPerCombatant(builder, self.args.combatants_header or 'Belligerents', 'combatant')
-- can be un-hardcoded once gerrit:165108 is merged
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'combatant', v)
end
self:renderPerCombatant(builder, 'Commanders and leaders', 'commander')
for _,v in ipairs{'a','b','c','d'} do
self:renderPerCombatant(builder, nil, 'commander', v)
end
self:renderPerCombatant(builder, 'Units involved', 'units')
self:renderPerCombatant(builder, 'Strength', 'strength')
self:renderPerCombatant(builder, 'Political support', 'polstrength')
self:renderPerCombatant(builder, 'Military support', 'milstrength')
self:renderPerCombatant(builder, 'Casualties and losses', 'casualties')
if self.args.notes then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.section_border)
:newline()
:wikitext(self.args.notes)
end
if self.args.map_type then
builder:tag('tr')
:tag('td')
:attr('colspan', self.combatants)
:css('border-top', infoboxStyle.internal_border)
:node(require('Module:Location map').main(self.frame, {
self.args.map_type,
relief = self.args.map_relief,
coordinates = self.args.coordinates,
width = self.args.map_size or 220,
float = 'center',
border = 'none',
mark = self.args.map_mark,
marksize = self.args.map_marksize or 8,
label = self.args.map_label,
alt = self.args.map_alt,
caption = self.args.map_caption or ('Location within '
.. (require('Module:Location map').data(self.frame, {self.args.map_type, 'name'})))
}))
end
builder = builder:done()
if self.args.campaignbox then
builder = builder:done()
builder:wikitext(self.args.campaignbox .. self.frame:expandTemplate{ title = 'stack end'})
end
return builder
end
function IMC.new(frame, args)
if not args then
args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Infobox military conflict'})
end
local obj = {
frame = frame,
args = args
}
-- until gerrit:165108 is merged, there's still a cap on combatants, but as soon as it merges, we can update this little bit of code to uncap it
-- also, don't try to make this more efficient, or references could be in the wrong order
obj.combatants = 2
for _,v in ipairs{'', 'a', 'b', 'c', 'd'} do
for i = 1,5 do
if args['combatant' .. i .. v] then
obj.combatants = math.max(obj.combatants, i)
end
end
end
return setmetatable(obj, IMC)
end
local p = {}
function p.main(frame)
return frame:extensionTag{ name = 'templatestyles', args = { src = templatestyles} } .. tostring(IMC.new(frame):render())
end
return p
5977f9959e2b25b7630a8f3da9612c9e362545aa
Module:Infobox military conflict/styles.css
828
308
615
614
2024-06-03T23:46:44Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp-template}} */
@media all and (min-width:720px) {
.desktop-float-right {
box-sizing: border-box;
float: right;
clear: right;
}
}
.infobox.vevent .status > p:first-child {
margin: 0;
}
1acb4afebca5f88c4679a397575d07b5de04407d
Module:Location map/data/Earth
828
309
617
616
2024-06-03T23:46:45Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
return {
name = 'Earth',
top = 90,
bottom = -90,
left = -180,
right = 180,
image = 'World location map (equirectangular 180).svg',
image1='World location map (equirectangular 180).svg'}
0c7a9c4349065ea43134d0a61037d31862f2a042
Module:Military navigation
828
310
619
618
2024-06-03T23:46:45Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local p = { }
local Navbox = require('Module:Navbox')
local Styles = require('Module:WPMILHIST Infobox style')
local function isblank(s)
return (not s) or s == ''
end
local function isnotblank(s)
return s and s ~= ''
end
function p.main(frame)
local args = { }
local pargs = frame:getParent().args
local sargs = {}
local tcats = ''
-- process bodystyle and titlestyle
if (pargs['style'] or '') == 'wide' then
args['titlestyle'] = Styles['nav_box_wide_header']
args['bodystyle'] = Styles['nav_box_wide']
else
args['titlestyle'] = Styles['nav_box_header']
if (pargs['border'] or '') == 'child' or
(pargs['border'] or '') == 'subgroup' then
args['bodystyle'] = Styles['nav_box_child']
tcats = tcats .. '[[Category:Pages using military navigation subgroups without wide style]]'
else
args['bodystyle'] = Styles['nav_box']
end
end
sargs['titlestyle'] = 1
sargs['bodystyle'] = 1
-- process groupstyle, abovestyle, belowstyle
args['groupstyle'] = Styles['nav_box_label'] .. (pargs['groupstyle'] or '')
sargs['groupstyle'] = 1
args['abovestyle'] = Styles['nav_box_label'] .. (pargs['abovestyle'] or '')
sargs['abovestyle'] = 1
args['belowstyle'] = Styles['nav_box_label'] .. (pargs['belowstyle'] or '')
sargs['belowstyle'] = 1
-- process oddstyle, evenstyle
args['oddstyle'] = isnotblank(pargs['odd_color'])
and ('background:' .. pargs['odd_color']) or nil
sargs['oddstyle'] = 1
args['evenstyle'] = isnotblank(pargs['even_color'])
and ('background:' .. pargs['even_color']) or nil
sargs['evenstyle'] = 1
-- process name and rawname
args['name'] = (isnotblank(pargs['name']) and pargs['name']) or pargs['rawname']
if isblank(args['name']) then args['navbar'] = 'plain' end
sargs['name'] = 1
sargs['rawname'] = 1
-- copy the remaining args
for k, v in pairs(pargs) do
if v and v ~= '' and sargs[k] == nil then
args[k] = v
end
end
-- add allow wrap
if args['title'] and (pargs['style'] or '') ~= 'wide' then
if not mw.ustring.match(args['title'], '<span class="wrap">') then
-- probably a more efficient way to match 15 or more characters
local m = '[^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|][^%[%]<>|]'
m = m .. m .. m
args['title'] = mw.ustring.gsub(args['title'],
'%[%[(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%1</span>]]')
args['title'] = mw.ustring.gsub(args['title'],
'%[%[([^%[%]<>|]*)|(' .. m .. '[^%[%]<>|]*)%]%]',
'[[%1|<span class="wrap">%2</span>]]')
end
end
-- add navbox-vertical for non-wide format
if (pargs['style'] or '') ~= 'wide' then
args['bodyclass'] = 'navbox-vertical' .. (args['bodyclass'] and (' ' .. args['bodyclass']) or '')
end
return tcats .. Navbox._navbox(args)
end
return p
26dd1b8952c65fbc4d05e418e8d7c3daed93fa49
Module:WPMILHIST Infobox style
828
311
621
620
2024-06-03T23:46:45Z
Odazk9041
2
1 revision imported
Scribunto
text/plain
local retval = {
main_box_raw_auto_width = 'border-spacing:2px;',
header_raw = 'background-color:#C3D6EF;text-align:center;vertical-align:middle;font-size:110%;',
sub_header_raw = 'background-color:#DCDCDC;text-align:center;vertical-align:middle;',
header_color = 'background-color:#C3D6EF;',
nav_box = 'margin:0;float:right;clear:right;width:25.5em;margin-bottom:0.5em;margin-left:1em;',
nav_box_child = 'margin:0;float:right;clear:right;width:25em;margin-bottom:0.5em;',
nav_box_wide = '',
nav_box_header = 'background-color:#C3D6EF;',
nav_box_wide_header = 'background-color:#C3D6EF;',
nav_box_label = 'background-color:#DCDCDC;',
image_box_raw = 'text-align:center;border-bottom:1px solid #aaa;line-height:1.5em;',
image_box_plain_raw = 'text-align:center;line-height:1.5em;',
internal_border = '1px dotted #aaa;',
section_border = '1px solid #aaa;'
}
retval.main_box_raw = 'width:25.5em;' .. retval.main_box_raw_auto_width
retval.header_bar = 'style="' .. retval.header_raw .. '"'
retval.sub_header_bar = 'style="' .. retval.sub_header_raw .. '"'
retval.image_box = 'style="' .. retval.image_box_raw .. '"'
retval.image_box_plain = 'style="' .. retval.image_box_plain_raw .. '"'
return retval
0f9ea47bc17e40cdabbae6de54f63e40ae502f8e
Template:Hlist/styles.css
10
312
623
622
2024-06-03T23:46:46Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
635
623
2024-06-03T23:53:21Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Template:Hlist/styles.css]] from "plain text" to "CSS"
css
text/css
/* {{pp-protected|reason=match parent|small=yes}} */
/*
* hlist styles are defined in core and Minerva and differ in Minerva. The
* current definitions here (2023-01-01) are sufficient to override Minerva
* without use of the hlist-separated class. The most problematic styles were
* related to margin, padding, and the bullet. Check files listed at
* [[MediaWiki talk:Common.css/to do#hlist-separated]]
*/
/*
* TODO: When the majority of readership supports it (or some beautiful world
* in which grade C support is above the minimum threshold), use :is()
*/
.hlist dl,
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
/*
* don't trust the note that says margin doesn't work with inline
* removing margin: 0 makes dds have margins again
* We also want to reset margin-right in Minerva
*/
margin: 0;
display: inline;
}
/* Display requested top-level lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
/* Display nested lists inline */
.hlist dl dl,
.hlist dl ol,
.hlist dl ul,
.hlist ol dl,
.hlist ol ol,
.hlist ol ul,
.hlist ul dl,
.hlist ul ol,
.hlist ul ul {
display: inline;
}
/* Hide empty list items */
.hlist .mw-empty-li {
display: none;
}
/* TODO: :not() can maybe be used here to remove the later rule. naive test
* seems to work. more testing needed. like so:
*.hlist dt:not(:last-child)::after {
* content: ": ";
*}
*.hlist dd:not(:last-child)::after,
*.hlist li:not(:last-child)::after {
* content: " · ";
* font-weight: bold;
*}
*/
/* Generate interpuncts */
.hlist dt::after {
content: ": ";
}
.hlist dd::after,
.hlist li::after {
content: " · ";
font-weight: bold;
}
.hlist dd:last-child::after,
.hlist dt:last-child::after,
.hlist li:last-child::after {
content: none;
}
/* Add parentheses around nested lists */
.hlist dd dd:first-child::before,
.hlist dd dt:first-child::before,
.hlist dd li:first-child::before,
.hlist dt dd:first-child::before,
.hlist dt dt:first-child::before,
.hlist dt li:first-child::before,
.hlist li dd:first-child::before,
.hlist li dt:first-child::before,
.hlist li li:first-child::before {
content: " (";
font-weight: normal;
}
.hlist dd dd:last-child::after,
.hlist dd dt:last-child::after,
.hlist dd li:last-child::after,
.hlist dt dd:last-child::after,
.hlist dt dt:last-child::after,
.hlist dt li:last-child::after,
.hlist li dd:last-child::after,
.hlist li dt:last-child::after,
.hlist li li:last-child::after {
content: ")";
font-weight: normal;
}
/* Put ordinals in front of ordered list items */
.hlist ol {
counter-reset: listitem;
}
.hlist ol > li {
counter-increment: listitem;
}
.hlist ol > li::before {
content: " " counter(listitem) "\a0";
}
.hlist dd ol > li:first-child::before,
.hlist dt ol > li:first-child::before,
.hlist li ol > li:first-child::before {
content: " (" counter(listitem) "\a0";
}
8c9dd9c9c00f30eead17fe10f51d183333e81f33
Module:Message box/ombox.css
828
313
625
624
2024-06-03T23:46:46Z
Odazk9041
2
1 revision imported
text
text/plain
/* {{pp|small=y}} */
.ombox {
margin: 4px 0;
border-collapse: collapse;
border: 1px solid #a2a9b1; /* Default "notice" gray */
background-color: #f8f9fa;
box-sizing: border-box;
}
/* For the "small=yes" option. */
.ombox.mbox-small {
font-size: 88%;
line-height: 1.25em;
}
.ombox-speedy {
border: 2px solid #b32424; /* Red */
background-color: #fee7e6; /* Pink */
}
.ombox-delete {
border: 2px solid #b32424; /* Red */
}
.ombox-content {
border: 1px solid #f28500; /* Orange */
}
.ombox-style {
border: 1px solid #fc3; /* Yellow */
}
.ombox-move {
border: 1px solid #9932cc; /* Purple */
}
.ombox-protection {
border: 2px solid #a2a9b1; /* Gray-gold */
}
.ombox .mbox-text {
border: none;
/* @noflip */
padding: 0.25em 0.9em;
width: 100%;
}
.ombox .mbox-image {
border: none;
/* @noflip */
padding: 2px 0 2px 0.9em;
text-align: center;
}
.ombox .mbox-imageright {
border: none;
/* @noflip */
padding: 2px 0.9em 2px 0;
text-align: center;
}
/* An empty narrow cell */
.ombox .mbox-empty-cell {
border: none;
padding: 0;
width: 1px;
}
.ombox .mbox-invalid-type {
text-align: center;
}
@media (min-width: 720px) {
.ombox {
margin: 4px 10%;
}
.ombox.mbox-small {
/* @noflip */
clear: right;
/* @noflip */
float: right;
/* @noflip */
margin: 4px 0 4px 1em;
width: 238px;
}
}
8fe3df4bb607e699eab2dbd23bd4a1a446391002
Template:Infobox character
10
314
627
626
2024-06-03T23:47:10Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Infobox
| title = <small>{{{title|}}}</small>
| abovestyle = background:#ffc757; text-align:center;
| above = {{#if: {{{name|}}} | {{{name|}}} | {{PAGENAME}}}}
| subheaderstyle = text-align:center;
| subheader = {{{nickname|}}}
| imagestyle = text-align:center;
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
| captionstyle = text-align:center;
| caption = {{{caption|}}}
| headerstyle = background:#f5dba6; text-align:center;
| header1 = {{{governance|}}}
| data2 = {{{govern_period|}}}
| label3 = Preceded by
| data3 = {{#if: {{{governance|}}} | {{{predecessor|}}}}}
| label4 = Succeeded by
| data4 = {{#if: {{{governance|}}} | {{{successor|}}}}}
| header5 = Personal information
| label6 = Born
| data6 = {{#if: {{{birth_name|}}} | {{#if: {{{birth_date|}}} | {{#if: {{{birth_place|}}} | {{{birth_name|}}}</br>{{{birth_date|}}}</br>{{{birth_place|}}} | {{{birth_name|}}}</br>{{{birth_date|}}}}} | {{{birth_name|}}}}} | {{#if: {{{birth_date|}}} | {{#if: {{{birth_place|}}} | {{{birth_date|}}}</br>{{{birth_place|}}} | {{{birth_date|}}}}} | {{{birth_place|}}}}}
}}
| label7 = Died
| data7 = {{#if: {{{death_date|}}} | {{#if: {{{death_place|}}} | {{{death_date|}}}</br>{{{death_place|}}} | {{{death_date|}}}}} | {{{death_place|}}}}}
| label8 = Former names
| data8 = {{{former_names|}}}
| label9 = Resting place
| data9 = {{{resting_place|}}}
| label10 = Nationality
| data10 = {{{nationality|}}}
| label11 = Citizenship
| data11 = {{{citizenship|}}}
| label12 = Education
| data12 = {{{education|}}}
| label13 = Occupation
| data13 = {{{occupation|}}}
| label14 = Years active
| data14 = {{{years_active|}}}
| label15 = Organization
| data15 = {{{organization|}}}
| label16 = Height
| data16 = {{{height|}}}
| label17 = Awards
| data17 = {{{awards|}}}
| label18 = Notable work
| data18 = {{{notable_work|}}}
| header19 = {{#if: {{{spouse1|}}}{{{children|}}}{{{parents|}}} | Family info}}
| label20 = {{#if: {{{spouse2|}}}{{{spouse3|}}} | Spouses | Spouse}}
| data20 = {{#if: {{{spouse2|}}} | {{{spouse1|}}}</br>{{{spouse2|}}} | {{{spouse1|}}}}}{{#if: {{{spouse3|}}} | </br>{{{spouse3|}}}}}
| label21 = Children
| data21 = {{{children|}}}
| label22 = Parents
| data22 = {{{parents|}}}
| data23 = {{#if: {{{signature|}}} | ''Signature''}}
| data24 = {{{module1|}}}
| data25 = {{{module1|}}}
| data26 = {{#invoke:InfoboxImage|InfoboxImage|image={{{signature|}}}|size={{{signature_size|}}}|sizedefault=150px|alt={{{signature alt|{{{signature_alt|}}}}}}}}
}}<noinclude>
{{Documentation}}
</noinclude>
d08a64d7bfca81fbc507465be1c78770ea62411c
Template:Infobox character/doc
10
315
629
628
2024-06-03T23:47:14Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
{{Documentation subpage}}
== Usage ==
Users should note that all parameters are made to be optional. Provide as much or as little information as you choose. If you wish to enter more than one data line to a single parameter, use <code><nowiki></br></nowiki></code> between the entries.
<syntaxhighlight>
{{Infobox character
|title = <!-- use only for royal, governmental or honorary titles -->
|name = <!-- if left blank, will default to the title of the page -->
|nickname = <!-- short and/or commonly used name for the character -->
|image =
|image_size = <!-- use this if the image appears too large/small, set a value e.g. 200px -->
|caption =
|governance = <!-- political/hereditary position of power -->
|govern_period = <!-- time spent governing -->
|predecessor = <!-- character previously in the governing position -->
|successor = <!-- character following in the governing position -->
|birth_name =
|birth_date =
|birth_place =
|death_date =
|death_place =
|former_names = <!-- use if the same character has changed names -->
|resting_place = <!-- place of burial/memorial -->
|nationality = <!-- usually country/region of birth -->
|citizenship = <!-- the country the character is formally associated with -->
|education =
|occupation = <!-- use this for regular jobs, for political positions/rulers, use "governance" given above -->
|years_active =
|organization =
|height =
|awards =
|notable_work = <!-- italics to work titles need to be added manually -->
|spouse1 =
|spouse2 =
|spouse3 =
|children =
|parents =
|signature =
|signature_size = <!-- use this if the image appears too large/small, set a value e.g. 100px -->
}}
</syntaxhighlight>
0e63b6f14443f222bfbe29aa2665853bf0df5f13
Template:Start date and age
10
316
631
630
2024-06-03T23:48:24Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
<includeonly><!--
IMPLEMENTATION OF DATE
-->{{#if: {{{1|}}}<!--
-->|{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{#ifeq:{{yesno|{{{df|no}}}}}|yes<!--
-->|{{#expr:{{{3}}}}} {{MONTHNAME|{{{2}}}}}<!--
-->|{{MONTHNAME|{{{2}}}}} {{#expr:{{{3}}}}},<!--
-->}} {{{1}}}<!--
-->|{{MONTHNAME|{{{2}}}}} {{{1}}}<!--
-->}}<!--
-->|{{{1}}}<!--
-->}}<!--
--><span class="noprint">{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes||;}}<!--
-->{{#ifeq:{{yesno|{{{br|no}}}}}|yes|<br/>| }}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|(}}<!--
-->{{#if: {{{2|}}}<!--
-->|{{#if: {{{3|}}}<!--
-->|{{time ago|{{{1}}}-{{{2}}}-{{{3}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{{1}}}|{{#time:n|1-{{trim|{{{2}}}}}-1}}}}<!--
-->}}<!--
-->|{{#iferror:{{#expr:{{{1}}}}}<!--
-->|{{time ago|{{{1}}}|min_magnitude=days}}<!--
-->|{{years or months ago|{{{1}}}}}<!--
-->}}<!--
-->}}<!--
-->{{#ifeq:{{yesno|{{{paren|{{{p|no}}}}}}}}|yes|)}}</span><!--
-->|{{Error|Error: first parameter is missing.|tag=span}}<!--
-->}}<!--
IMPLEMENTATION OF microformat date classes
--><span style="display:none"> (<span class="{{#ifeq:{{yesno|{{{end|no}}}}}|yes|dtend|bday dtstart published updated}}"><!--
-->{{#if: {{{1|}}}<!--
-->|{{{1}}}<!--
-->{{#if: {{{2|}}}<!--
-->| -{{#time:m|1-{{trim|{{{2}}}}}-1}}<!--
-->{{#if: {{{3|}}}<!--
-->| -{{padleft:{{{3}}}|2|0}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
--></span>)</span></includeonly><noinclude>
{{documentation}}
</noinclude>
0139749a9182b26b7b234679b4c10a231c37519f
Template:Menu
10
317
632
2024-06-03T23:51:10Z
Odazk9041
2
Created page with "<gallery style="text-align:center" widths="125px" heights="125px" mode="traditional"> File:Countries_Icon.png|link=Country|[[Country]] File:Organization_icon.png|link=Organization|[[Organization]] File:Events_icon.png|link=Event|[[Event]] File:Docs_icon.png|link=Document|[[Document]] File:Player_icon.png|link=Player|[[Player|Player/Character]] File:Infrastructure_icon.png|link=Infrastructure|[[Infrastructure|Infrastructure/Cities]] File:Other_icon.png|link=Other|[[Other]..."
wikitext
text/x-wiki
<gallery style="text-align:center" widths="125px" heights="125px" mode="traditional">
File:Countries_Icon.png|link=Country|[[Country]]
File:Organization_icon.png|link=Organization|[[Organization]]
File:Events_icon.png|link=Event|[[Event]]
File:Docs_icon.png|link=Document|[[Document]]
File:Player_icon.png|link=Player|[[Player|Player/Character]]
File:Infrastructure_icon.png|link=Infrastructure|[[Infrastructure|Infrastructure/Cities]]
File:Other_icon.png|link=Other|[[Other]]
</gallery>
3fcb1e97ca4868550313eb6bbf8ee094d95cfa0b
Module:Infobox/styles.css
828
14
633
27
2024-06-03T23:52:01Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Module:Infobox/styles.css]] from "plain text" to "CSS"
css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
4e60b3cfbf50d1fd637f4a5af11a460a6569e988
634
633
2024-06-03T23:52:30Z
Odazk9041
2
css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
e8de6d96f4fde53afc4a6b0fed534405ab59b0a7
648
634
2024-06-04T00:13:59Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Module:Infobox/styles.css]] from "CSS" to "Sanitized CSS"
sanitized-css
text/css
/* {{pp|small=y}} */
/*
* This TemplateStyles sheet deliberately does NOT include the full set of
* infobox styles. We are still working to migrate all of the manual
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
* DO NOT ADD THEM HERE
*/
/*
* not strictly certain these styles are necessary since the modules now
* exclusively output infobox-subbox or infobox, not both
* just replicating the module faithfully
*/
.infobox-subbox {
padding: 0;
border: none;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
.infobox-3cols-child {
margin: auto;
}
.infobox .navbar {
font-size: 100%;
}
/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva .infobox-image,
body.skin-minerva .infobox-full-data,
body.skin-minerva .infobox-below {
text-align: center;
}
e8de6d96f4fde53afc4a6b0fed534405ab59b0a7
Module:Navbar/styles.css
828
194
636
387
2024-06-03T23:54:08Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Module:Navbar/styles.css]] from "plain text" to "CSS"
css
text/css
/* {{pp|small=yes}} */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
/* Navbar styling when nested in infobox and navbox
Should consider having a separate TemplateStyles for those specific places
using an infobox/navbox and a navbar, or possibly override from using template */
.infobox .navbar {
font-size: 100%;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
f4cf6b1111f177ad6af0154b14f9c942400f3636
649
636
2024-06-04T00:14:19Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Module:Navbar/styles.css]] from "CSS" to "Sanitized CSS"
sanitized-css
text/css
/* {{pp|small=yes}} */
.navbar {
display: inline;
font-size: 88%;
font-weight: normal;
}
.navbar-collapse {
float: left;
text-align: left;
}
.navbar-boxtext {
word-spacing: 0;
}
.navbar ul {
display: inline-block;
white-space: nowrap;
line-height: inherit;
}
.navbar-brackets::before {
margin-right: -0.125em;
content: '[ ';
}
.navbar-brackets::after {
margin-left: -0.125em;
content: ' ]';
}
.navbar li {
word-spacing: -0.125em;
}
.navbar-mini abbr {
font-variant: small-caps;
border-bottom: none;
text-decoration: none;
cursor: inherit;
}
.navbar-ct-full {
font-size: 114%;
margin: 0 7em;
}
.navbar-ct-mini {
font-size: 114%;
margin: 0 4em;
}
/* Navbar styling when nested in infobox and navbox
Should consider having a separate TemplateStyles for those specific places
using an infobox/navbox and a navbar, or possibly override from using template */
.infobox .navbar {
font-size: 100%;
}
.navbox .navbar {
display: block;
font-size: 100%;
}
.navbox-title .navbar {
/* @noflip */
float: left;
/* @noflip */
text-align: left;
/* @noflip */
margin-right: 0.5em;
}
f4cf6b1111f177ad6af0154b14f9c942400f3636
Template:Menu-navbar
10
318
637
2024-06-03T23:57:50Z
Odazk9041
2
Created page with "<templatestyles src="Menu/styles.css" /> {| width=98% align=center style="text-align:center;" |- | width="14%" class="tab-label" | [[File:Countries_Icon.png|30x30px|link=Country|Country]] '''''[[Country|Countries]]''''' | min-width="25px" | | width="14%" class="tab-label" | [[File:Organization_icon.png|30x30px|link=Organizations|Organizations]] '''''[[Orgs]]''''' | min-width="25px" | | width="14%" class="tab-label" | [[File:Events_icon.png|30x30px|link=Events|Events]] '..."
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.png|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.png|30x30px|link=Organizations|Organizations]] '''''[[Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.png|30x30px|link=Events|Events]] '''''[[Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.png|30x30px|link=Documents|Documents]] '''''[[Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.png|30x30px|link=Characters|Characters]] '''''[[People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.png|30x30px|link=Places|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.png|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
1cfae556a067c3959e7d750fe703848aea600d9c
645
637
2024-06-04T00:05:10Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organizations|Organizations]] '''''[[Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Events|Events]] '''''[[Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Documents|Documents]] '''''[[Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Characters|Characters]] '''''[[People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Places|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
af77037a0411f3c963bc5d30faffc6e953c5b4f9
File:Countries Icon.webp
6
319
638
2024-06-04T00:01:50Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Organization icon.webp
6
320
639
2024-06-04T00:02:10Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Events icon.webp
6
321
640
2024-06-04T00:02:27Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Docs icon.webp
6
322
641
2024-06-04T00:02:44Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Player icon.webp
6
323
642
2024-06-04T00:03:06Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Infrastructure icon.webp
6
324
643
2024-06-04T00:03:22Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Other icon.webp
6
325
644
2024-06-04T00:03:42Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Template:Menu/styles.css
10
326
646
2024-06-04T00:08:56Z
Odazk9041
2
Created page with ".tab-label { border: solid 2px #cfc095; background-color: #cfc095; } .tab-label a, .tab-label a:visited, .tab-label a:hover { color: #776A4E; }"
sanitized-css
text/css
.tab-label {
border: solid 2px #cfc095;
background-color: #cfc095;
}
.tab-label a, .tab-label a:visited, .tab-label a:hover {
color: #776A4E;
}
458684fb53ebb0154e4893ea947dd5b245cee834
Main Page
0
1
647
1
2024-06-04T00:09:14Z
Odazk9041
2
Replaced content with "{{Template:Menu-navbar}} __NOTOC__ == Welcome to {{SITENAME}}! == This Main Page was created automatically and it seems it hasn't been replaced yet."
wikitext
text/x-wiki
{{Template:Menu-navbar}}
__NOTOC__
== Welcome to {{SITENAME}}! ==
This Main Page was created automatically and it seems it hasn't been replaced yet.
fb61c3b9a7a4f1205011531a2d94ddb3aea31f08
Template:Menu
10
317
650
632
2024-06-04T00:23:01Z
Odazk9041
2
wikitext
text/x-wiki
<gallery style="text-align:center" widths="125px" heights="125px" mode="traditional">
File:Countries_Icon.webp|link=Country|[[Country]]
File:Organization_icon.webp|link=Organization|[[Organization]]
File:Events_icon.webp|link=Event|[[Event]]
File:Docs_icon.webp|link=Document|[[Document]]
File:Player_icon.webp|link=Player|[[Player|Player/Character]]
File:Infrastructure_icon.webp|link=Infrastructure|[[Infrastructure|Infrastructure/Cities]]
File:Other_icon.webp|link=Other|[[Other]]
</gallery>
e4c55b8c6b6ce94426506bb74b929290a54054fa
687
650
2024-06-04T21:55:56Z
Odazk9041
2
wikitext
text/x-wiki
<gallery style="text-align:center" widths="125px" heights="125px" mode="traditional">
File:Countries_Icon.webp|link=Country|[[Country]]
File:Organization_icon.webp|link=Organization|[[Organization]]
File:Events_icon.webp|link=Event|[[Event]]
File:Docs_icon.webp|link=Document|[[Document]]
File:Player_icon.webp|link=Player|[[Player|Player/Character]]
File:Infrastructure_icon.webp|link=Infrastructure|[[Infrastructure|Cities]]
File:Other_icon.webp|link=Other|[[Other]]
</gallery>
89e9aab66f4fd73861a0f74644a3e5776ae4691f
Main Page
0
1
651
647
2024-06-04T00:23:11Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__ __EXPECTUNUSEDCATEGORY__ __NOGALLERY__
{{#css:Main Page/styles.css}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
9858ba29bad826ed41ada7dadeba65cc6b2bef7b
654
651
2024-06-04T00:32:57Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
{{#css:Main Page/styles.css}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
030cd600843d0fcd99089e4f44c8340ba345b7e6
657
654
2024-06-04T00:41:31Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Main Page]] from "wikitext" to "CSS"
css
text/css
{{Template:Menu-navbar}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
{{#css:Main Page/styles.css}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
030cd600843d0fcd99089e4f44c8340ba345b7e6
658
657
2024-06-04T00:41:52Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Main Page]] from "CSS" to "wikitext"
wikitext
text/x-wiki
{{Template:Menu-navbar}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
{{#css:Main Page/styles.css}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
030cd600843d0fcd99089e4f44c8340ba345b7e6
659
658
2024-06-04T00:44:40Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
{{Template:Menu-navbar}}
{{#css:Main Page/styles.css}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
5ea195732b5bd7728f8b27111a0ec44151edc8a0
660
659
2024-06-04T00:45:03Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
{{#css:Main Page/styles.css}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
eb03d0887e4d1cee2213f7e9608eb104d9d3b65d
661
660
2024-06-04T00:51:51Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
a8ffb1cea1f186d7bee6e74143a25079ed3e38b6
674
661
2024-06-04T21:03:32Z
2601:244:4B03:DC80:ED55:DBF9:D722:E22D
0
wikitext
text/x-wiki
{{Template:Menu-navbar}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
<br><br><imagemap>
File:Main_Banner.png|800px|center|class=header-img
default [[Main Page|Banner]]
desc none
</imagemap><br><Br>
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
2683098ea7d775b4b294d0999a550e10c605fb3e
676
674
2024-06-04T21:06:54Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
[[File:Main Banner.png|center|frameless|551x551px]]
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
20183ef9ca3ddcd462e53ef58d8de82468b39e4a
677
676
2024-06-04T21:30:34Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
{{Template:Menu-buttons}}
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[CreatePage|Create Page]] | [[Special:Random|Random Page]] | [[Special:Upload|Upload File]]</div>
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
[[File:Main Banner.png|center|frameless|551x551px]]
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
55ef96e0cbd8f6ecffd5b81296b518921685e70a
680
677
2024-06-04T21:39:43Z
Odazk9041
2
wikitext
text/x-wiki
{{Template:Menu-navbar}}
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
[[File:Main Banner.png|center|frameless|551x551px]]
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
07519b8dd79840f7fbd8e63974186e4062cbe708
681
680
2024-06-04T21:40:03Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
'''<big>Rhaya Encyclopedia</big>'''
Welcome to Rhaya
[[File:Main Banner.png|center|frameless|551x551px]]
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
e0c6286ecc313e9d4d18be17cad1a27642d614b2
683
681
2024-06-04T21:43:03Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">'''<big>Rhaya Encyclopedia</big>'''</div>
Welcome to Rhaya
[[File:Main Banner.png|center|frameless|551x551px]]
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
1e2b39fe8d013c54e355f8c144aa75300ac05eac
684
683
2024-06-04T21:43:59Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
Welcome to Rhaya
[[File:Main Banner.png|center|frameless|551x551px]]
'''Community Links:'''
[[File:Rhaya_icon.png|36px|link= https://discord.gg/GJvjHyhmPT|Discord Server]]
== Menu ==
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
97696f25f946ea743784b0e9608d48c516e28084
685
684
2024-06-04T21:47:25Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:Rhaya_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Menu</big>''' =
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
f4637a14a553083ab5b2307bda96bd6474b5d37f
686
685
2024-06-04T21:47:48Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:Rhaya_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
== '''<big>Menu</big>''' ==
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
dd5abc72ccdbbf31f03b8af501bae2fa756cb835
Main Page/styles.css
0
327
653
652
2024-06-04T00:32:31Z
Odazk9041
2
1 revision imported
wikitext
text/x-wiki
.header-img
{
border-radius: 15px;
}
.menu {
background-color: #7E7E7E;
font-size: 24;
}
35a1b2a34195b7e4f604fc3001c0266455611d05
655
653
2024-06-04T00:34:07Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Main Page/styles.css]] from "wikitext" to "CSS"
css
text/css
.header-img
{
border-radius: 15px;
}
.menu {
background-color: #7E7E7E;
font-size: 24;
}
35a1b2a34195b7e4f604fc3001c0266455611d05
656
655
2024-06-04T00:34:54Z
Odazk9041
2
Odazk9041 changed the content model of the page [[Main Page/styles.css]] from "CSS" to "wikitext"
wikitext
text/x-wiki
.header-img
{
border-radius: 15px;
}
.menu {
background-color: #7E7E7E;
font-size: 24;
}
35a1b2a34195b7e4f604fc3001c0266455611d05
MediaWiki:Sidebar
8
328
662
2024-06-04T07:47:05Z
Odazk9041
2
Created page with " * navigation ** mainpage|mainpage-description ** recentchanges-url|recentchanges ** randompage-url|randompage ** helppage|help-mediawiki * Menu ** Country|Country ** Organization|Organizations ** Event|Events ** Document|Documents ** Player|Player/Character ** Infrastructure|Infrastructure/cities ** Other|Other ** Create|Page Creation Workshop * SEARCH * TOOLBOX * LANGUAGES"
wikitext
text/x-wiki
* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
* Menu
** Country|Country
** Organization|Organizations
** Event|Events
** Document|Documents
** Player|Player/Character
** Infrastructure|Infrastructure/cities
** Other|Other
** Create|Page Creation Workshop
* SEARCH
* TOOLBOX
* LANGUAGES
3f5b23a3d8cd47bba09d8476eb6acf60d9f4151e
Template:Menu/styles.css
10
326
663
646
2024-06-04T07:52:39Z
Odazk9041
2
sanitized-css
text/css
.tab-label {
border: solid 2px #000000;
background-color: #3864cc;
}
.tab-label a, .tab-label a:visited, .tab-label a:hover {
color: #FFFFFF;
}
9b35ed9c209f61a03a2fda35f934d8b8521a9216
664
663
2024-06-04T07:54:42Z
Odazk9041
2
sanitized-css
text/css
.tab-label {
border: solid 2px #3864cc;
background-color: #3864cc;
}
.tab-label a, .tab-label a:visited, .tab-label a:hover {
color: #FFFFFF;
}
bd0107ce51b5b925c7dc7dff23136cc51bcce046
File:Other icon.webp
6
325
665
644
2024-06-04T08:06:11Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Other icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Countries Icon.webp
6
319
666
638
2024-06-04T08:06:36Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Countries Icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Docs icon.webp
6
322
667
641
2024-06-04T08:06:52Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Docs icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Events icon.webp
6
321
668
640
2024-06-04T08:06:59Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Events icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Infrastructure icon.webp
6
324
669
643
2024-06-04T08:07:10Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Infrastructure icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Organization icon.webp
6
320
670
639
2024-06-04T08:07:28Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Organization icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Player icon.webp
6
323
671
642
2024-06-04T08:07:37Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Player icon.webp]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
MediaWiki:Common.css
8
329
672
2024-06-04T08:15:47Z
Odazk9041
2
Created page with "/* CSS placed here will be applied to all skins */ /* * This is the CSS common to all desktop skins on en.Wikipedia. * Styling inside .mw-parser-output should generally use TemplateStyles. */ /* Reset italic styling set by user agent */ cite, dfn { font-style: inherit; } /* Straight quote marks for <q> */ q { quotes: '"' '"' "'" "'"; } /* Avoid collision of blockquote with floating elements by swapping margin and padding */ blockquote { overflow: hidden; margin..."
css
text/css
/* CSS placed here will be applied to all skins */
/*
* This is the CSS common to all desktop skins on en.Wikipedia.
* Styling inside .mw-parser-output should generally use TemplateStyles.
*/
/* Reset italic styling set by user agent */
cite,
dfn {
font-style: inherit;
}
/* Straight quote marks for <q> */
q {
quotes: '"' '"' "'" "'";
}
/* Avoid collision of blockquote with floating elements by swapping margin and padding */
blockquote {
overflow: hidden;
margin: 1em 0;
padding: 0 40px;
}
/* Consistent size for <small>, <sub> and <sup> */
small {
font-size: 85%;
}
.mw-body-content sub,
.mw-body-content sup {
font-size: 80%;
background-color: #E1E1E1;
}
/* Same spacing for indented and unindented paragraphs on talk pages */
.ns-talk .mw-body-content dd {
margin-top: 0.4em;
margin-bottom: 0.4em;
background-color: #E1E1E1;
}
/* Reduce page jumps by hiding collapsed/dismissed content */
.client-js .collapsible:not( .mw-made-collapsible).collapsed > tbody > tr:not(:first-child),
/* Avoid FOUC/reflows on collapsed elements. */
/* This copies MediaWiki's solution for T42812 to apply to innercollapse/outercollapse (T325115). */
/* TODO: Use :is() selector at some reasonable future when support is good for Most Clients */
/* Reference: https://gerrit.wikimedia.org/g/mediawiki/core/+/ecda06cb2aef55b77c4b4d7ecda492d634419ead/resources/src/jquery/jquery.makeCollapsible.styles.less#75 */
.client-js .outercollapse .innercollapse.mw-collapsible:not( .mw-made-collapsible ) > p,
.client-js .outercollapse .innercollapse.mw-collapsible:not( .mw-made-collapsible ) > table,
.client-js .outercollapse .innercollapse.mw-collapsible:not( .mw-made-collapsible ) > thead + tbody,
.client-js .outercollapse .innercollapse.mw-collapsible:not( .mw-made-collapsible ) tr:not( :first-child ),
.client-js .outercollapse .innercollapse.mw-collapsible:not( .mw-made-collapsible ) .mw-collapsible-content,
/* Hide charinsert base for those not using the gadget */
#editpage-specialchars {
display: none;
}
/* Make the list of references smaller
* Keep in sync with Template:Refbegin/styles.css
* And Template:Reflist/styles.css
*/
ol.references {
font-size: 90%;
margin-bottom: 0.5em;
}
/* Cite customizations for Parsoid
* Once everything uses the one true parser these are just customizations
*/
span[ rel="mw:referencedBy" ] {
counter-reset: mw-ref-linkback 0;
}
span[ rel='mw:referencedBy' ] > a::before {
content: counter( mw-ref-linkback, lower-alpha );
font-size: 80%;
font-weight: bold;
font-style: italic;
}
a[ rel="mw:referencedBy" ]::before {
font-weight: bold;
content: "^";
}
span[ rel="mw:referencedBy" ]::before {
content: "^ ";
}
.mw-ref > a[data-mw-group=lower-alpha]::after {
content: '[' counter( mw-Ref, lower-alpha ) ']';
}
.mw-ref > a[data-mw-group=upper-alpha]::after {
content: '[' counter( mw-Ref, upper-alpha ) ']';
}
.mw-ref > a[data-mw-group=decimal]::after {
content: '[' counter( mw-Ref, decimal ) ']';
}
.mw-ref > a[data-mw-group=lower-roman]::after {
content: '[' counter( mw-Ref, lower-roman ) ']';
}
.mw-ref > a[data-mw-group=upper-roman]::after {
content: '[' counter( mw-Ref, upper-roman ) ']';
}
.mw-ref > a[data-mw-group=lower-greek]::after {
content: '[' counter( mw-Ref, lower-greek ) ']';
}
/* Styling for jQuery makeCollapsible, matching that of collapseButton */
.mw-parser-output .mw-collapsible-toggle:not(.mw-ui-button) {
font-weight: normal;
padding-right: 0.2em;
padding-left: 0.2em;
}
.mw-collapsible-leftside-toggle .mw-collapsible-toggle {
/* @noflip */
float: left;
}
/* Lists in wikitable data cells are always left-aligned */
.wikitable td ul,
.wikitable td ol,
.wikitable td dl {
/* @noflip */
text-align: left;
vertical-align: top;
}
/* Change the external link icon to a PDF icon for all PDF files */
.mw-parser-output a[href$=".pdf"].external,
.mw-parser-output a[href*=".pdf?"].external,
.mw-parser-output a[href*=".pdf#"].external,
.mw-parser-output a[href$=".PDF"].external,
.mw-parser-output a[href*=".PDF?"].external,
.mw-parser-output a[href*=".PDF#"].external {
background: url("//upload.wikimedia.org/wikipedia/commons/4/4d/Icon_pdf_file.png") no-repeat right;
/* @noflip */
padding: 8px 18px 8px 0;
}
/* System messages styled similarly to fmbox */
/* for .mw-warning-with-logexcerpt, behavior of this line differs between
* the edit-protected notice and the special:Contribs for blocked users
* The latter has specificity of 3 classes so we have to triple up here.
*/
.mw-warning-with-logexcerpt.mw-warning-with-logexcerpt.mw-warning-with-logexcerpt,
div.mw-lag-warn-high,
div.mw-cascadeprotectedwarning,
div#mw-protect-cascadeon {
clear: both;
margin: 0.2em 0;
border: 1px solid #bb7070;
background-color: #ffdbdb;
padding: 0.25em 0.9em;
box-sizing: border-box;
}
/* default colors for partial block message */
/* gotta get over the hump introduced by the triple class above */
.mw-contributions-blocked-notice-partial .mw-warning-with-logexcerpt.mw-warning-with-logexcerpt {
border-color: #fc3;
background-color: #fef6e7;
}
/* Minimum thumb width */
figure[typeof~='mw:File/Thumb'],
figure[typeof~='mw:File/Frame'],
.thumbinner {
min-width: 100px;
}
/* Prevent floating boxes from overlapping any category listings,
file histories, edit previews, and edit [Show changes] views. */
#mw-subcategories,
#mw-pages,
#mw-category-media,
#filehistory,
#wikiPreview,
#wikiDiff {
clear: both;
}
/* Styling for tags in changes pages */
.mw-tag-markers {
font-style: italic;
font-size: 90%;
}
/* Hide stuff meant for accounts with special permissions. Made visible again in
[[MediaWiki:Group-checkuser.css]], [[MediaWiki:Group-sysop.css]], [[MediaWiki:Group-abusefilter.css]],
[[MediaWiki:Group-abusefilter-helper.css]], [[MediaWiki:Group-patroller.css]],
[[MediaWiki:Group-templateeditor.css]], [[MediaWiki:Group-extendedmover.css]],
[[MediaWiki:Group-extendedconfirmed.css]], and [[Mediawiki:Group-autoconfirmed.css]]. */
.checkuser-show,
.sysop-show,
.abusefilter-show,
.abusefilter-helper-show,
.patroller-show,
.templateeditor-show,
.extendedmover-show,
.extendedconfirmed-show,
.autoconfirmed-show,
.user-show {
display: none;
}
/* Hide the redlink generated by {{Editnotice}},
this overrides the ".sysop-show { display: none; }" above that applies
to the same link as well. See [[phab:T45013]]
Hide the images in editnotices to keep them readable in VE view.
Long term, editnotices should become a core feature so that they can be designed responsive. */
.ve-ui-mwNoticesPopupTool-item .editnotice-redlink,
.ve-ui-mwNoticesPopupTool-item .mbox-image,
.ve-ui-mwNoticesPopupTool-item .mbox-imageright {
display: none !important;
}
/* Remove bullets when there are multiple edit page warnings */
ul.permissions-errors {
margin: 0;
}
ul.permissions-errors > li {
list-style: none;
}
/* larger inline math */
span.mwe-math-mathml-inline {
font-size: 118%;
}
/* Make <math display="block"> be left aligned with one space indent for
* compatibility with style conventions
*/
.mwe-math-fallback-image-display,
.mwe-math-mathml-display {
margin-left: 1.6em !important;
margin-top: 0.6em;
margin-bottom: 0.6em;
}
.mwe-math-mathml-display math {
display: inline;
}
@media screen {
/* Put a chequered background behind images, only visible if they have transparency,
* except on main, user, and portal namespaces
*/
body:not(.ns-0):not(.ns-2):not(.ns-100) .gallerybox .thumb img {
background: #fff url(//upload.wikimedia.org/wikipedia/commons/5/5d/Checker-16x16.png) repeat;
}
/* Display "From Wikipedia, the free encyclopedia" in skins that support it,
do not apply to print mode */
#siteSub {
display: block;
}
}
/* Hide FlaggedRevs notice UI when there are no pending changes */
.flaggedrevs_draft_synced,
.flaggedrevs_stable_synced,
/* "Temporary" to remove links in sidebar T255381 */
#t-upload,
/* Hide broken download box on Special:Book pending T285400 */
.mw-special-Book #coll-downloadbox {
display: none;
}
/*
* BELOW HERE THERE BE SOONTOBE TEMPLATESTYLES THINGS;
* SEE [[MediaWiki talk:Common.css/to do]]
*/
/* Infobox template style */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
/* @noflip */
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
/* @noflip */
float: right;
/* @noflip */
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
.infobox-header,
.infobox-label,
.infobox-above,
.infobox-full-data,
.infobox-data,
.infobox-below,
.infobox-subheader,
.infobox-image,
.infobox-navbar,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
vertical-align: top;
}
.infobox-label,
.infobox-data,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox th,
.infobox td {
/* @noflip */
text-align: left;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-above,
.infobox .infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
font-size: 125%;
font-weight: bold;
text-align: center;
}
.infobox-title,
/* Remove element selector when every .infobox thing is using the standard module/templates */
.infobox caption {
padding: 0.2em;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-header,
.infobox .infobox-subheader,
.infobox .infobox-image,
.infobox .infobox-full-data,
.infobox .infobox-below {
text-align: center;
}
/* Remove .infobox when element selectors above are removed */
.infobox .infobox-navbar {
/* @noflip */
text-align: right;
}
/* Normal font styling for wikitable row headers with scope="row" tag */
.wikitable.plainrowheaders th[scope=row],
.wikitable.plainrowheaders th[scope=rowgroup] {
font-weight: normal;
/* @noflip */
text-align: left;
}
/* Remove underlines from certain links */
.nounderlines a,
.IPA a:link,
.IPA a:visited {
text-decoration: none !important;
}
/* Prevent line breaks in silly places where desired (nowrap)
and links when we don't want them to (nowraplinks a) */
.nowrap,
.nowraplinks a {
white-space: nowrap;
}
/* But allow wrapping where desired: */
.wrap,
.wraplinks a {
white-space: normal;
}
/* texhtml class for inline math (based on generic times-serif class) */
span.texhtml {
font-family: "Nimbus Roman No9 L", "Times New Roman", Times, serif;
font-size: 118%;
line-height: 1;
white-space: nowrap;
/* Force tabular and lining display for texhtml */
font-variant-numeric: lining-nums tabular-nums;
font-kerning: none;
}
span.texhtml span.texhtml {
font-size: 100%;
}
@media screen {
.nochecker .gallerybox .thumb img {
background-image: none;
}
}
/* Put anything you mean to be a sitewide addition above the TemplateStyles
* comment above.
*/
465d44ebfe3dfd06997ccf340e7d94d749b5b260
File:Main Banner.png
6
331
675
2024-06-04T21:04:10Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
CreatePage
0
332
678
2024-06-04T21:31:27Z
Odazk9041
2
Created page with "<inputbox> type=create break=no </inputbox>"
wikitext
text/x-wiki
<inputbox>
type=create
break=no
</inputbox>
35dc05cfc85b96bba4a70eb89a86d38b213655a2
Template:Menu-buttons
10
333
679
2024-06-04T21:37:35Z
Odazk9041
2
Created page with "<templatestyles src="Menu/styles.css" /> {| width=98% align=center style="text-align:center;" |- | width="14%" class="tab-label" | [[CreatePage|'''''Create''''']] | min-width="25px" | | width="14%" class="tab-label" | [[Special:Random|'''''Random''''']] | min-width="25px" | | width="14%" class="tab-label" | [[Special:Upload|'''''Upload''''']] | min-width="25px" | |- | |}"
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[CreatePage|'''''Create''''']]
| min-width="25px" |
| width="14%" class="tab-label" | [[Special:Random|'''''Random''''']]
| min-width="25px" |
| width="14%" class="tab-label" | [[Special:Upload|'''''Upload''''']]
| min-width="25px" |
|-
|
|}
8648949453fda0b6c3ae75cb3952ab4b10ff2cb5
682
679
2024-06-04T21:41:45Z
Odazk9041
2
wikitext
text/x-wiki
'''[[CreatePage|Create Page]] | [[Special:Random|Random Page]] | [[Special:Upload|Upload File]]'''
160c4aad8b37ad0b885dc374a33bff214314070e
Country
0
334
688
2024-06-04T22:43:55Z
Odazk9041
2
Redirected page to [[Category:Country]]
wikitext
text/x-wiki
#REDIRECT [[Category:Country]]
81ac5afde8d8d6d975ac801f11499f1845b03ded
690
688
2024-06-04T22:45:10Z
Odazk9041
2
wikitext
text/x-wiki
#REDIRECT [[Category:Country]]
Test
6379c2606966a4dc2b96f4965b69ae7d2164d7d6
Category:Country
14
335
689
2024-06-04T22:44:17Z
Odazk9041
2
Created page with "This is a list of all countries on Rhaya."
wikitext
text/x-wiki
This is a list of all countries on Rhaya.
e845ebbfcdf73860cdb502beee0851d3536d1050
691
689
2024-06-04T23:03:44Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
[[File:NationOfNorthSeaMap.png]]
<div style="margin-top:-5px;">{{Menu/Sandbox}}</div>
There are countless number of nations, both inside and outside the documented map world. Most nations are concentrated in the core region and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page:<br>
[[:category:historical_country]]
12844e3a04becf33249c50cc39c24a478880d44e
692
691
2024-06-04T23:03:53Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu/Sandbox}}</div>
There are countless number of nations, both inside and outside the documented map world. Most nations are concentrated in the core region and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page:<br>
[[:category:historical_country]]
6ed70f5a3a1c59f1352e16a0d3f05d612c3303df
693
692
2024-06-04T23:04:28Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu/navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Most nations are concentrated in the core region and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page:<br>
[[:category:historical_country]]
21b7fa8928898b9942e2e9d7464a749b6e8cdea7
694
693
2024-06-04T23:04:46Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Most nations are concentrated in the core region and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page:<br>
[[:category:historical_country]]
a5a00178a272d4db8485e2955171c792f3414042
695
694
2024-06-04T23:06:19Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Nations are concentrated in the core regions and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page:<br>
[[Category:historical_country]]
b2b946b485017057c4f1f764c2a30a9383ec9c83
696
695
2024-06-04T23:06:48Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Nations are concentrated in the core regions and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page: [[Category:Historical_Country]]
3770b53e7a9794948f79fe21ff370b05ae9b218f
697
696
2024-06-04T23:07:00Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Nations are concentrated in the core regions and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this page: Category:Historical_Country
6ec1e8f3f72657a75985c8b6df751ba02bac5aef
698
697
2024-06-04T23:08:18Z
Odazk9041
2
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Nations are concentrated in the core regions and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this [[Historical_Country|page]].
674aff850a4ea8d9766571db7759d33bcc4df906
Historical Country
0
336
699
2024-06-04T23:10:20Z
Odazk9041
2
Redirected page to [[Category:Historical Country]]
wikitext
text/x-wiki
#REDIRECT [[Category:Historical_Country]]
cf0c17517144533be391ffc7b47a3db90b50e5e3
Category:Historical Country
14
337
700
2024-06-04T23:11:50Z
Odazk9041
2
Created page with "<div style="margin-top:-5px;">{{Menu-navbar}}</div> There are many countries that rise and fall. This page contains the historical countries of Rhaya. For present countries, please go to this [[Category:Country|page]]."
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are many countries that rise and fall. This page contains the historical countries of Rhaya.
For present countries, please go to this [[Category:Country|page]].
7b469d8d8ed4e428a8e086dae1cb37e1901dd0ed
701
700
2024-06-04T23:12:07Z
Odazk9041
2
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are many countries that rise and fall. This page contains the historical countries of Rhaya.
For present countries, please go to this [[Country|page]].
e353f051441f73079b3488414127281322d13b08
Country
0
334
702
690
2024-06-05T01:40:19Z
Odazk9041
2
wikitext
text/x-wiki
#REDIRECT [[Category:Country]]
81ac5afde8d8d6d975ac801f11499f1845b03ded
712
702
2024-06-06T21:18:37Z
Odazk9041
2
Protected "[[Country]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:Country]]
81ac5afde8d8d6d975ac801f11499f1845b03ded
Main Page
0
1
703
686
2024-06-06T20:57:15Z
WrentheiaOwner
6
wikitext
text/x-wiki
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:Rhaya_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
== '''<big>Menu</big>''' ==
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
473df1cafbeb802af0ec291f3a2d208aae44b6dd
704
703
2024-06-06T20:58:36Z
WrentheiaOwner
6
wikitext
text/x-wiki
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:Rhaya_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
== '''<big>Menu</big>''' ==
</div>
{{menu}}
5d0912ab5c07e7ebf06c76751c8b9cb61918bea4
705
704
2024-06-06T20:59:44Z
WrentheiaOwner
6
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:Rhaya_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
== '''<big>Menu</big>''' ==
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
dd5abc72ccdbbf31f03b8af501bae2fa756cb835
706
705
2024-06-06T21:14:27Z
WrentheiaOwner
6
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:discord_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
== '''<big>Menu</big>''' ==
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
4e0f5808d73756b15176d9617b1c67064b2f2191
709
706
2024-06-06T21:16:58Z
Odazk9041
2
Protected "[[Main Page]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:discord_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
== '''<big>Menu</big>''' ==
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
4e0f5808d73756b15176d9617b1c67064b2f2191
750
709
2024-06-12T02:58:26Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:discord_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
'''<big>Menu</big>'''
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
887d2aa1d2956b480d7b028dd3a1fa4a64e9c561
751
750
2024-06-12T02:58:43Z
Odazk9041
2
wikitext
text/x-wiki
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
= '''<big>Rhaya Encyclopedia</big>''' =
</div>
[[File:Main Banner.png|center|frameless|551x551px]]
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">[[File:discord_icon.png|36px|link= https://discord.gg/rhaya|Discord Server]]</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{Template:Menu-buttons}}</div>
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">
'''<big><u>Menu</u></big>'''
</div>
{{menu}}
__NOTOC__
__NOEDITSECTION__
__NONEWSECTIONLINK__
__HIDDENCAT__
__EXPECTUNUSEDCATEGORY__
__NOGALLERY__
f732673106935a9965b0ff2a67661658ce364a90
File:Discord icon.png
6
338
707
2024-06-06T21:15:13Z
Odazk9041
2
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
708
707
2024-06-06T21:16:24Z
Odazk9041
2
Odazk9041 uploaded a new version of [[File:Discord icon.png]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Category:Country
14
335
710
698
2024-06-06T21:17:42Z
Odazk9041
2
Protected "[[Category:Country]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of nations, both inside and outside the documented map world. Nations are concentrated in the core regions and its surroundings. The politics and nations are purely player-based. There is no admin intervention, assuming no base rules were broken.
This page only shows the present-day country. For historical nations, please visit this [[Historical_Country|page]].
674aff850a4ea8d9766571db7759d33bcc4df906
Category:Historical Country
14
337
711
701
2024-06-06T21:17:56Z
Odazk9041
2
Protected "[[Category:Historical Country]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are many countries that rise and fall. This page contains the historical countries of Rhaya.
For present countries, please go to this [[Country|page]].
e353f051441f73079b3488414127281322d13b08
Organization
0
339
713
2024-06-06T21:19:04Z
Odazk9041
2
Redirected page to [[Category:Organization]]
wikitext
text/x-wiki
#REDIRECT [[Category:Organization]]
fa74af50851d176d120d4907f92488083db32f15
714
713
2024-06-06T21:19:10Z
Odazk9041
2
Protected "[[Organization]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:Organization]]
fa74af50851d176d120d4907f92488083db32f15
Category:Organization
14
340
715
2024-06-06T21:21:48Z
Odazk9041
2
Created page with "__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__ <div style="margin-top:-5px;">{{Menu-navbar}}</div> Organizations in Rhaya are categorized into diverse range of objectives. There are a variety of organizations, including religious, corporations, governmental, international, and educational organizations. Some nations are directly affiliated with the organization, and sometimes organizations are under nation's funding or agency."
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
Organizations in Rhaya are categorized into diverse range of objectives. There are a variety of organizations, including religious, corporations, governmental, international, and educational organizations. Some nations are directly affiliated with the organization, and sometimes organizations are under nation's funding or agency.
614cb59e149b464da5efc46d5332fe9bd9ecfe46
716
715
2024-06-06T21:22:22Z
Odazk9041
2
Protected "[[Category:Organization]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
Organizations in Rhaya are categorized into diverse range of objectives. There are a variety of organizations, including religious, corporations, governmental, international, and educational organizations. Some nations are directly affiliated with the organization, and sometimes organizations are under nation's funding or agency.
614cb59e149b464da5efc46d5332fe9bd9ecfe46
Event
0
341
717
2024-06-06T21:22:51Z
Odazk9041
2
Redirected page to [[Category:Event]]
wikitext
text/x-wiki
#REDIRECT [[Category:Event]]
7c9308aa4c6b41ac591e0a1313343101a84795e8
718
717
2024-06-06T21:22:57Z
Odazk9041
2
Protected "[[Event]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:Event]]
7c9308aa4c6b41ac591e0a1313343101a84795e8
Category:Event
14
342
719
2024-06-06T21:25:18Z
Odazk9041
2
Created page with "__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__ <div style="margin-top:-5px;">{{Menu-navbar}}</div> Numerous things happen each day on Rhaya, some notable, some forgettable. This page shows all the documented notable events."
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
Numerous things happen each day on Rhaya, some notable, some forgettable. This page shows all the documented notable events.
c936839d9fda565f58e62e911db6a102de6a860b
720
719
2024-06-06T21:25:26Z
Odazk9041
2
Protected "[[Category:Event]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
Numerous things happen each day on Rhaya, some notable, some forgettable. This page shows all the documented notable events.
c936839d9fda565f58e62e911db6a102de6a860b
Document
0
343
721
2024-06-06T21:26:36Z
Odazk9041
2
Redirected page to [[Category:Document]]
wikitext
text/x-wiki
#REDIRECT [[Category:Document]]
465016141ad190e2acb06265078f59472b77a1ec
722
721
2024-06-06T21:26:43Z
Odazk9041
2
Protected "[[Document]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:Document]]
465016141ad190e2acb06265078f59472b77a1ec
Category:Document
14
344
723
2024-06-06T21:28:14Z
Odazk9041
2
Created page with "__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__ <div style="margin-top:-5px;">{{Menu-navbar}}</div> There is a lot of important papers that pass through each country every day. Some can be simple bills or decrees, others can be constitutions that have been worked on for months. The most notable documents will be listed here."
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There is a lot of important papers that pass through each country every day. Some can be simple bills or decrees, others can be constitutions that have been worked on for months. The most notable documents will be listed here.
3a305163199e4f01c7c44763f6e569b8259e51b6
724
723
2024-06-06T21:28:21Z
Odazk9041
2
Protected "[[Category:Document]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There is a lot of important papers that pass through each country every day. Some can be simple bills or decrees, others can be constitutions that have been worked on for months. The most notable documents will be listed here.
3a305163199e4f01c7c44763f6e569b8259e51b6
Player
0
345
725
2024-06-06T21:28:39Z
Odazk9041
2
Redirected page to [[Category:Player]]
wikitext
text/x-wiki
#REDIRECT [[Category:Player]]
f91d7dd1d594cdab179dada4001b914a9dbb91b4
726
725
2024-06-06T21:28:45Z
Odazk9041
2
Protected "[[Player]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:Player]]
f91d7dd1d594cdab179dada4001b914a9dbb91b4
Category:Player
14
346
727
2024-06-06T21:46:28Z
Odazk9041
2
Created page with "__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__ <div style="margin-top:-5px;">{{Menu-navbar}}</div> Rhaya contains tons of notable players. Some are real players, others are characters in legends or in distant family trees. This page contains all characters documented."
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
Rhaya contains tons of notable players. Some are real players, others are characters in legends or in distant family trees. This page contains all characters documented.
2d0d83dd2a915c27f4fe26464c2611aee7b5bc1e
747
727
2024-06-06T22:00:19Z
Odazk9041
2
Protected "[[Category:Player]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
Rhaya contains tons of notable players. Some are real players, others are characters in legends or in distant family trees. This page contains all characters documented.
2d0d83dd2a915c27f4fe26464c2611aee7b5bc1e
Template:Menu-navbar
10
318
728
645
2024-06-06T21:49:45Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organizations|Organizations]] '''''[[Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Events]] '''''[[Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Documents|Documents]] '''''[[Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Characters|Characters]] '''''[[People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Places|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
7123663113b3ec7408b53dbfbace323794e62516
729
728
2024-06-06T21:50:01Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Events]] '''''[[Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Documents|Documents]] '''''[[Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Characters|Characters]] '''''[[People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Places|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
aa022159505d5c3128e0bd231f58de85c33c1721
730
729
2024-06-06T21:50:39Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Events]] '''''[[Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Document|Documents]] '''''[[Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Player|Characters]] '''''[[People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Place|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
19ecdf3ed5dfecf2ca6c084488717810cd8d15d1
731
730
2024-06-06T21:51:23Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Event]] '''''[[Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Document|Documents]] '''''[[Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Player|Characters]] '''''[[People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Place|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
7103b983edc48083fdce70cc5344a49edcd998e7
732
731
2024-06-06T21:52:48Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Organization|Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Event]] '''''[[Event|Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Document|Documents]] '''''[[Document|Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Player|Characters]] '''''[[Player|People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Place|Places]] '''''[[Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
de69b36e57356035ffb019a126b250397b15bc83
735
732
2024-06-06T21:55:28Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Organization|Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Event]] '''''[[Event|Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Document|Documents]] '''''[[Document|Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Player|Characters]] '''''[[Player|People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Place|Places]] '''''[[Infrastructure|Places]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
4f1dbd5d4f30c62585678fb978ac36e2886e09f2
736
735
2024-06-06T21:55:57Z
Odazk9041
2
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Organization|Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Event]] '''''[[Event|Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Document|Documents]] '''''[[Document|Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Player|Characters]] '''''[[Player|People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Place|Places]] '''''[[Infrastructure|Cities]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
30418338f11f99b92bbc66eff837d0358c4d0d55
748
736
2024-06-06T22:01:24Z
Odazk9041
2
Protected "[[Template:Menu-navbar]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
<templatestyles src="Menu/styles.css" />
{| width=98% align=center style="text-align:center;"
|-
| width="14%" class="tab-label" | [[File:Countries_Icon.webp|30x30px|link=Country|Country]] '''''[[Country|Countries]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Organization_icon.webp|30x30px|link=Organization|Organizations]] '''''[[Organization|Orgs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Events_icon.webp|30x30px|link=Event|Event]] '''''[[Event|Events]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Docs_icon.webp|30x30px|link=Document|Documents]] '''''[[Document|Docs]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Player_icon.webp|30x30px|link=Player|Characters]] '''''[[Player|People]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Infrastructure_icon.webp|30x30px|link=Place|Places]] '''''[[Infrastructure|Cities]]'''''
| min-width="25px" |
| width="14%" class="tab-label" | [[File:Other_icon.webp|30x30px|link=Other|Other]] '''''[[Other]]'''''
|-
|
|}
30418338f11f99b92bbc66eff837d0358c4d0d55
Infrastructure
0
347
733
2024-06-06T21:53:43Z
Odazk9041
2
Redirected page to [[Category:City]]
wikitext
text/x-wiki
#REDIRECT [[Category:City]]
dddfe94a429bfbce32afe0a9cbd1a381225c2411
746
733
2024-06-06T22:00:09Z
Odazk9041
2
Protected "[[Infrastructure]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:City]]
dddfe94a429bfbce32afe0a9cbd1a381225c2411
Category:City
14
348
734
2024-06-06T21:54:53Z
Odazk9041
2
Created page with "__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__ <div style="margin-top:-5px;">{{Menu-navbar}}</div> There are countless number of towns, both inside and outside the documented map world. Towns house nation's populace, and are well documented communities. This page only shows the present-day towns. For historical towns, please visit this [[Historical_Town|page]]."
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of towns, both inside and outside the documented map world. Towns house nation's populace, and are well documented communities.
This page only shows the present-day towns. For historical towns, please visit this [[Historical_Town|page]].
0476fd154c4492d3c8c0a176d9caa0420c39de44
745
734
2024-06-06T21:59:58Z
Odazk9041
2
Protected "[[Category:City]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
__NOTOC__ __NOEDITSECTION__ __NONEWSECTIONLINK__
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are countless number of towns, both inside and outside the documented map world. Towns house nation's populace, and are well documented communities.
This page only shows the present-day towns. For historical towns, please visit this [[Historical_Town|page]].
0476fd154c4492d3c8c0a176d9caa0420c39de44
Historical Town
0
349
737
2024-06-06T21:56:32Z
Odazk9041
2
Redirected page to [[Category:Historical Town]]
wikitext
text/x-wiki
#REDIRECT [[Category:Historical_Town]]
dbcfda87d609a0dacd4249346b33ecf073db8754
Category:Historical Town
14
350
738
2024-06-06T21:57:11Z
Odazk9041
2
Created page with "<div style="margin-top:-5px;">{{Menu-navbar}}</div> There are many towns that rise and fall. This page contains the historical towns of Rhaya. For present countries, please go to this [[Infrastructure|page]]."
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are many towns that rise and fall. This page contains the historical towns of Rhaya.
For present countries, please go to this [[Infrastructure|page]].
4dc49b5dba0001747fb3600a6acfcfd85fdffa83
739
738
2024-06-06T21:57:26Z
Odazk9041
2
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
There are many towns that rise and fall. This page contains the historical towns of Rhaya.
For present towns, please go to this [[Infrastructure|page]].
b77cf410296deed3818c817db4d7823222f8691f
Other
0
351
740
2024-06-06T21:58:49Z
Odazk9041
2
Redirected page to [[Category:Other]]
wikitext
text/x-wiki
#REDIRECT [[Category:Other]]
2365cd1d5944adc58c116e313954ae144f0319eb
744
740
2024-06-06T21:59:48Z
Odazk9041
2
Protected "[[Other]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
#REDIRECT [[Category:Other]]
2365cd1d5944adc58c116e313954ae144f0319eb
Category:Other
14
352
741
2024-06-06T21:59:08Z
Odazk9041
2
Created page with "This page contains wiki pages that don't fit the given categories."
wikitext
text/x-wiki
This page contains wiki pages that don't fit the given categories.
b9341aacec8e45e88fa2f0dd1b3a52b324574733
742
741
2024-06-06T21:59:29Z
Odazk9041
2
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
This page contains wiki pages that don't fit the given categories.
23e7af6d1bcc1c93c93f2a0624d2ae034bdf83a2
743
742
2024-06-06T21:59:36Z
Odazk9041
2
Protected "[[Category:Other]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
<div style="margin-top:-5px;">{{Menu-navbar}}</div>
This page contains wiki pages that don't fit the given categories.
23e7af6d1bcc1c93c93f2a0624d2ae034bdf83a2
Main Page/styles.css
0
327
749
656
2024-06-06T23:45:14Z
Odazk9041
2
Protected "[[Main Page/styles.css]]" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
wikitext
text/x-wiki
.header-img
{
border-radius: 15px;
}
.menu {
background-color: #7E7E7E;
font-size: 24;
}
35a1b2a34195b7e4f604fc3001c0266455611d05